提交 7f137aac authored 作者: 宋文杰's avatar 宋文杰

fix(attendance template): fix bug to can't see attendance info when remove the attendance template

上级 72761d0e
......@@ -94,7 +94,7 @@ public class AttendanceTemplatesController extends BaseController {
@SysLog("删除班次表")
@DeleteMapping("/{shiftId}")
public R removeById(@PathVariable Integer shiftId){
return new R<>(attendanceTemplatesService.removeById(shiftId));
return new R<>(attendanceTemplatesService.delTemplate(shiftId));
}
}
......@@ -77,4 +77,9 @@ public class AttendanceTemplates extends Model<AttendanceTemplates> {
*/
private Integer unitId;
/**
* 是否删除
*/
private Boolean isDel;
}
......@@ -33,4 +33,13 @@ public interface AttendanceTemplatesMapper extends BaseMapper<AttendanceTemplate
* @Date: 2019/4/23
*/
IPage<AttendanceTemplateDto> getShiftPage(Page page,Integer unitId);
/**
* @Description: 删除排班模板
* @param: [shiftId]
* @return: java.lang.Boolean
* @Author: songwenjie
* @Date: 2019/5/21
*/
Boolean delTemplate(Integer shiftId);
}
......@@ -34,4 +34,13 @@ public interface AttendanceTemplatesService extends IService<AttendanceTemplates
* @Date: 2019/4/23
*/
IPage<AttendanceTemplateDto> getShiftPage(Page page,Integer unitId);
/**
* @Description: 删除排班模板
* @param: [shiftId]
* @return: java.lang.Boolean
* @Author: songwenjie
* @Date: 2019/5/21
*/
Boolean delTemplate(Integer shiftId);
}
......@@ -46,4 +46,15 @@ public class AttendanceTemplatesServiceImpl extends ServiceImpl<AttendanceTempla
IPage<AttendanceTemplateDto> templates = baseMapper.getShiftPage(page,unitId);
return templates;
}
/**
* @Description: 删除排班模板
* @param: [shiftId]
* @return: java.lang.Boolean
* @Author: songwenjie
* @Date: 2019/5/21
*/
public Boolean delTemplate(Integer shiftId){
return baseMapper.delTemplate(shiftId);
}
}
......@@ -14,6 +14,7 @@
<result property="isCrossDay" column="is_cross_day"/>
<result property="position" column="position"/>
<result property="remark" column="remark"/>
<result property="isDel" column="is_del"/>
</resultMap>
<select id="getShiftSelection" resultMap="attendanceTemplatesMap">
......@@ -23,6 +24,8 @@
attendance_templates
where
unit_id = #{unitId}
and
is_del=0
</select>
......@@ -30,5 +33,11 @@
select t.*,d.name as dept_name from attendance_templates t inner join sys_dept d
on t.unit_id = d.dept_id
where t.unit_id = #{unitId}
and is_del=0
</select>
<update id="delTemplate">
update attendance_templates set is_del=1
where shift_id=#{shiftId}
</update>
</mapper>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论