chengf
2026-01-30 b8bf2507bc7b23c90bc6dc71ea2460e277d3800a
java110-db/src/main/resources/mapper/community/MaintainanceTaskV1ServiceDaoImplMapper.xml
@@ -1,19 +1,17 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
        PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
        "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="maintainanceTaskV1ServiceDaoImpl">
    <!-- 保存保养任务信息 add by wuxw 2018-07-03 -->
    <insert id="saveMaintainanceTaskInfo" parameterType="Map">
        insert into maintainance_task(
        plan_user_id,act_ins_time,plan_ins_time,original_plan_user_name,transfer_desc,act_user_name,auth_desc,original_plan_user_id,task_type,plan_id,plan_end_time,plan_user_name,community_id,act_user_id,task_id,mps_id
        ) values (
        #{planUserId},#{actInsTime},#{planInsTime},#{originalPlanUserName},#{transferDesc},#{actUserName},#{authDesc},#{originalPlanUserId},#{taskType},#{planId},#{planEndTime},#{planUserName},#{communityId},#{actUserId},#{taskId},#{mpsId}
        )
        insert into maintainance_task(plan_user_id, act_ins_time, plan_ins_time, original_plan_user_name, transfer_desc,
                                      act_user_name, auth_desc, original_plan_user_id, task_type, plan_id,
                                      plan_end_time, plan_user_name, community_id, act_user_id, task_id, mps_id)
        values (#{planUserId}, #{actInsTime}, #{planInsTime}, #{originalPlanUserName}, #{transferDesc}, #{actUserName},
                #{authDesc}, #{originalPlanUserId}, #{taskType}, #{planId}, #{planEndTime}, #{planUserName},
                #{communityId}, #{actUserId}, #{taskId}, #{mpsId})
    </insert>
    <!-- 查询保养任务信息 add by wuxw 2018-07-03 -->
    <select id="getMaintainanceTaskInfo" parameterType="Map" resultType="Map">
@@ -28,7 +26,8 @@
        mp.plan_name planName,td.`name` stateName
        from maintainance_task t
        left join maintainance_plan mp on t.plan_id = mp.plan_id and mp.status_cd = '0'
        left join t_dict td on t.state = td.status_cd and td.table_name = 'maintainance_task' and td.table_columns = 'state'
        left join t_dict td on t.state = td.status_cd and td.table_name = 'maintainance_task' and td.table_columns =
        'state'
        where 1 =1
        <if test="planUserId !=null and planUserId != ''">
            and t.plan_user_id= #{planUserId}
@@ -38,6 +37,12 @@
        </if>
        <if test="planInsTime !=null and planInsTime != ''">
            and DATE_FORMAT(t.plan_ins_time,'%Y-%m-%d')= #{planInsTime}
        </if>
        <if test="startTime !=null and startTime != ''">
            and t.plan_ins_time &lt;= #{startTime}
        </if>
        <if test="endTime !=null and endTime != ''">
            and t.plan_end_time &gt;= #{endTime}
        </if>
        <if test="originalPlanUserName !=null and originalPlanUserName != ''">
            and t.original_plan_user_name= #{originalPlanUserName}
@@ -67,7 +72,10 @@
            and t.plan_end_time= #{planEndTime}
        </if>
        <if test="planUserName !=null and planUserName != ''">
            and t.plan_user_name= #{planUserName}
            and t.plan_user_name like '%${planUserName}%'
        </if>
        <if test="planName !=null and planName != ''">
            and mp.plan_name like '%${planName}%'
        </if>
        <if test="communityId !=null and communityId != ''">
            and t.community_id= #{communityId}
@@ -81,13 +89,20 @@
        <if test="mpsId !=null and mpsId != ''">
            and t.mps_id= #{mpsId}
        </if>
        <if test="state !=null and state != ''">
            and t.state= #{state}
        </if>
        <if test="states !=null ">
            and t.state in
            <foreach collection="states" item="item" open="(" close=")" separator=",">
                #{item}
            </foreach>
        </if>
        order by t.create_time desc
        <if test="page != -1 and page != null ">
            limit #{page}, #{row}
        </if>
    </select>
    <!-- 修改保养任务信息 add by wuxw 2018-07-03 -->
    <update id="updateMaintainanceTaskInfo" parameterType="Map">
@@ -140,17 +155,20 @@
        <if test="mpsId !=null and mpsId != ''">
            , t.mps_id= #{mpsId}
        </if>
        <if test="state !=null and state != ''">
            , t.state= #{state}
        </if>
        where 1=1
        <if test="taskId !=null and taskId != ''">
            and t.task_id= #{taskId}
        </if>
    </update>
    <!-- 查询保养任务数量 add by wuxw 2018-07-03 -->
    <select id="queryMaintainanceTasksCount" parameterType="Map" resultType="Map">
        select count(1) count
        from maintainance_task t
        left join maintainance_plan mp on t.plan_id = mp.plan_id and mp.status_cd = '0'
        where 1 =1
        <if test="planUserId !=null and planUserId != ''">
            and t.plan_user_id= #{planUserId}
@@ -160,6 +178,12 @@
        </if>
        <if test="planInsTime !=null and planInsTime != ''">
            and DATE_FORMAT(t.plan_ins_time,'%Y-%m-%d')= #{planInsTime}
        </if>
        <if test="startTime !=null and startTime != ''">
            and t.plan_ins_time &lt;= #{startTime}
        </if>
        <if test="endTime !=null and endTime != ''">
            and t.plan_end_time &gt;= #{endTime}
        </if>
        <if test="originalPlanUserName !=null and originalPlanUserName != ''">
            and t.original_plan_user_name= #{originalPlanUserName}
@@ -189,7 +213,10 @@
            and t.plan_end_time= #{planEndTime}
        </if>
        <if test="planUserName !=null and planUserName != ''">
            and t.plan_user_name= #{planUserName}
            and t.plan_user_name like '%${planUserName}%'
        </if>
        <if test="planName !=null and planName != ''">
            and mp.plan_name like '%${planName}%'
        </if>
        <if test="communityId !=null and communityId != ''">
            and t.community_id= #{communityId}
@@ -203,8 +230,15 @@
        <if test="mpsId !=null and mpsId != ''">
            and t.mps_id= #{mpsId}
        </if>
        <if test="state !=null and state != ''">
            and t.state= #{state}
        </if>
        <if test="states !=null ">
            and t.state in
            <foreach collection="states" item="item" open="(" close=")" separator=",">
                #{item}
            </foreach>
        </if>
    </select>
    <!-- 保存活动信息 add by wuxw 2018-07-03 -->
@@ -230,6 +264,4 @@
            )
        </foreach>
    </insert>
</mapper>