功能开发

This commit is contained in:
haozq 2024-03-23 18:26:24 +08:00
parent 2f81113629
commit 77a1874f7d
3 changed files with 85 additions and 42 deletions

View File

@ -16,13 +16,7 @@ import java.util.Map;
*/ */
@Repository(value = "DutyPlanMapper") @Repository(value = "DutyPlanMapper")
public interface DutyPlanMapper { public interface DutyPlanMapper {
/**
* DD
*
* @param vo
* @return
*/
int addDutyPlan(DutyPlanVo vo);
/** /**
* 获取班组列表 * 获取班组列表

View File

@ -3,19 +3,20 @@
<mapper namespace="com.securitycontrol.background.mapper.DutyPlanMapper"> <mapper namespace="com.securitycontrol.background.mapper.DutyPlanMapper">
<!--新增/修改值班计划--> <!--新增/修改值班计划-->
<insert id="addDutyPlan">
<if test="flage == 1"> <insert id="replaceDutyPlan">
INSERT INTO tb_duty_plan replace into tb_duty_plan
<trim prefix="(" suffix=")" suffixOverrides=","> <trim prefix="(" suffix=")" suffixOverrides=",">
<if test="teamId != null and teamId != ''">create_day,</if> <if test="createDay != null and createDay != ''">create_day,</if>
<if test="teamName != null and teamName != ''">type,</if> <if test="type != null and type != ''">type,</if>
<if test="teamLeader != null and teamLeader != ''">mon,</if> <if test="mon != null and mon != ''">mon,</if>
<if test="bidCode != null and bidCode!=''">tue,</if> <if test="tue != null and tue!=''">tue,</if>
<if test="teamLeaderPhone != null and teamLeaderPhone!=''">wed,</if> <if test="wed != null and wed!=''">wed,</if>
<if test="idNumber != null and idNumber!=''">thu,</if> <if test="thu != null and thu!=''">thu,</if>
<if test="status != null and status!=''">fri,</if> <if test="fri != null and fri!=''">fri,</if>
<if test="status != null and status!=''">sat,</if> <if test="sat != null and sat!=''">sat,</if>
<if test="status != null and status!=''">sun,</if> <if test="sun != null and sun!=''">sun,</if>
update_time
</trim> </trim>
<trim prefix="values (" suffix=")" suffixOverrides=","> <trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="createDay != null and createDay != ''">#{createDay},</if> <if test="createDay != null and createDay != ''">#{createDay},</if>
@ -25,22 +26,11 @@
<if test="wed != null and wed!=''">#{wed},</if> <if test="wed != null and wed!=''">#{wed},</if>
<if test="thu != null and thu!=''">#{thu},</if> <if test="thu != null and thu!=''">#{thu},</if>
<if test="fri != null and fri!=''">#{fri},</if> <if test="fri != null and fri!=''">#{fri},</if>
<if test="sat != null and sat!=''">#{sat},</if>
<if test="sun != null and sun!=''">#{sun},</if> <if test="sun != null and sun!=''">#{sun},</if>
now()
</trim> </trim>
</if>
<if test="flage == 2">
UPDATE tb_duty_plan
<set>
<if test="mon != null and mon != ''">mon = #{mon},</if>
<if test="tue != null and tue != ''">tue = #{tue},</if>
<if test="wed != null and wed != ''">wed = #{wed},</if>
<if test="thu != null and thu != ''">thu = #{thu},</if>
<if test="fri != null and fri != ''">fri = #{fri},</if>
<if test="sat != null and sat != ''">sat = #{sat},</if>
<if test="sun != null and sun != ''">sun = #{sun},</if>
</set>
WHERE create_day = #{createDay} and type=#{type}
</if>
</insert> </insert>
<!--获取值班计划列表--> <!--获取值班计划列表-->
@ -56,14 +46,15 @@
tdp.sat as sat, tdp.sat as sat,
tdp.sun as sun tdp.sun as sun
FROM tb_duty_plan tdp FROM tb_duty_plan tdp
<where> where tdp.del_flag=0
<if test="createDay !=null and createDay!=''"> <if test="createDay !=null and createDay!=''">
AND tdp.create_day=#{createDay} AND tdp.create_day=#{createDay}
</if> </if>
<if test="type !=null and type!=''"> <if test="type !=null and type!=''">
AND tdp.type=#{type} AND tdp.type=#{type}
</if> </if>
</where>
oreder by create_time ORDER by create_time
</select> </select>
</mapper> </mapper>

View File

@ -0,0 +1,58 @@
<?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" >
<mapper namespace="com.securitycontrol.background.mapper.TaskCheckMapper">
<insert id="replaceCheck">
replace into t_class_metting_check
(class_id,is_xs,user_id,check_time,create_day) values (#{classId},0,#{userId},0,CURRENT_DATE())
</insert>
<delete id="delTask">
DELETE FROM t_class_metting_check WHERE class_id = #{classId} and user_id=#{userId}
</delete>
<delete id="delAllTask">
DELETE FROM t_class_metting_check WHERE user_id=#{userId}
</delete>
<select id="getPageList" resultType="com.securitycontrol.entity.background.vo.ClassCheckVo">
select su.login_name loginName,su.user_id userId,user_name userName,count(cmc.class_id) checkNum
from sys_user su
left join sys_role sr on su.role_id=sr.role_id and sr.del_flag=0
left join t_class_metting_check cmc on cmc.user_id=su.user_id and cmc.create_day=CURRENT_DATE()
where sr.role_code='duty' and su.del_flag=0
<if test="keyWord!=null and keyWord!='' ">
AND (
su.login_name LIKE concat('%',#{keyWord},'%') or
su.user_name LIKE concat('%',#{keyWord},'%')
)
</if>
GROUP BY su.login_name,su.user_id,user_name
</select>
<select id="getClassList" resultType="com.securitycontrol.entity.background.vo.ClassCheckVo">
select tcm.user_id userId,cm.class_id classId,cm.bid_name proName,cm.org,cm.work_manager workManage,
so.city_name cityName
FROM t_class_metting cm
left join t_class_metting_check tcm on cm.class_id=tcm.class_id
left join sys_build so on so.org_id=cm.org
where cm.del_flag=0
<if test='type=="3"'>
<if test='userId!=null and userId!="" '>
and tcm.user_id=#{userId}
</if>
</if>
<if test='types=="2"'>
and tcm.user_id is null
</if>
<if test='types=="1"'>
and tcm.user_id is not null and tcm.user_id!=#{userId}
</if>
<if test="keyWord!=null and keyWord!=''">
AND (
cm.bid_name LIKE concat('%',#{keyWord},'%') or
cm.work_manager LIKE concat('%',#{keyWord},'%') or
so.city_name LIKE concat('%',#{keyWord},'%')
)
</if>
<if test="orgId!=null and orgId!=''">
AND cm.org=#{orgId}
</if>
</select>
</mapper>