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()); } }