| | |
| | | <?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"> |
| | |
| | | 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} |
| | |
| | | </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 <= #{startTime} |
| | | </if> |
| | | <if test="endTime !=null and endTime != ''"> |
| | | and t.plan_end_time >= #{endTime} |
| | | </if> |
| | | <if test="originalPlanUserName !=null and originalPlanUserName != ''"> |
| | | and t.original_plan_user_name= #{originalPlanUserName} |
| | |
| | | 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} |
| | |
| | | <if test="page != -1 and page != null "> |
| | | limit #{page}, #{row} |
| | | </if> |
| | | |
| | | </select> |
| | | |
| | | |
| | | <!-- 修改保养任务信息 add by wuxw 2018-07-03 --> |
| | | <update id="updateMaintainanceTaskInfo" parameterType="Map"> |
| | |
| | | <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} |
| | |
| | | </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 <= #{startTime} |
| | | </if> |
| | | <if test="endTime !=null and endTime != ''"> |
| | | and t.plan_end_time >= #{endTime} |
| | | </if> |
| | | <if test="originalPlanUserName !=null and originalPlanUserName != ''"> |
| | | and t.original_plan_user_name= #{originalPlanUserName} |
| | |
| | | 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} |
| | |
| | | #{item} |
| | | </foreach> |
| | | </if> |
| | | |
| | | |
| | | </select> |
| | | |
| | | <!-- 保存活动信息 add by wuxw 2018-07-03 --> |
| | |
| | | ) |
| | | </foreach> |
| | | </insert> |
| | | |
| | | |
| | | </mapper> |