• impl实现


    ICMSTypeService接口

    /**
     * 修改公告类型
     * @param cmsType
     * @return
     */
    int updateCMSType(CMSType cmsType);
    

      

    CMSTypeServiceImpl实现类

    /**
     * 修改公告类型
     * @param cmsType
     * @return
     */
    @Override
    public int updateCMSType(CMSType cmsType) {
        cmsType.setUpdateBy(ShiroUtils.getLoginName());
        return cmsTypeMapper.updateCMSType(cmsType);
    }
    

      

    CMSTypeMapper接口

    /**
     * 修改公告类型
     * @param cmsType
     * @return
     */
    int updateCMSType(CMSType cmsType);
    

     

    CMSTypeMapper.xml

    <!--修改公告类型-->
    <update id="updateCMSType">
        update cms_type
        <set>
            <if test="typeName != null and typeName != ''">type_name = #{typeName},</if>
            <if test="typeSort != null and typeSort != ''">type_sort = #{typeSort},</if>
            <if test="typeDesc != null">type_desc = #{typeDesc},</if>
            <if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
            update_time = sysdate()
        </set>
        where type_id = #{typeId}
    </update>
    

      

    CMSTypeController中新增删除的单元方法

    /**
     * 删除公告类型
     */
    @RequiresPermissions("cms:type:remove")
    @Log(title = "公告管理", businessType = BusinessType.DELETE)
    @PostMapping("/remove")
    @ResponseBody
    public AjaxResult remove(String ids)
    {
        try
        {
            return toAjax(cmsTypeService.deleteCMSTypeByIds(ids));
        }
        catch (Exception e)
        {
            return error(e.getMessage());
        }
    }
    

      

     

  • 相关阅读:
    Ubuntu_14.04安装docker
    CentOS配置java运行环境
    github上传自己的开源代码
    eclipse使用maven插件创建web项目
    jar包解压后,修改完配置文件,再还原成jar包
    Python学习的几本建议书籍
    流批
    函数
    程序
    习 题
  • 原文地址:https://www.cnblogs.com/vincentmax/p/14363169.html
Copyright © 2020-2023  润新知