123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277 |
- <?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.zhyc.xps.goaf.mapper.GoafTaskMapper">
- <resultMap id="GoafTaskMapper" type="com.zhyc.xps.goaf.entity.GoafTask">
- <id column="task_id" property="taskId" jdbcType="BIGINT"/>
- <result column="oc_id" property="ocId" jdbcType="BIGINT"/>
- <result column="goaf_id" property="goafId" jdbcType="BIGINT"/>
- <result column="job_id" property="jobId" jdbcType="BIGINT"/>
- <result column="check_def_id" property="checkDefId" jdbcType="BIGINT"/>
- <result column="checklist_id" property="checklistId" jdbcType="BIGINT"/>
- <result column="task_title" property="taskTitle" jdbcType="VARCHAR"/>
- <result column="task_desc" property="taskDesc" jdbcType="VARCHAR"/>
- <result column="expected_start_date" property="expectedStartDate" jdbcType="DATE"/>
- <result column="expected_end_date" property="expectedEndDate" jdbcType="DATE"/>
- <result column="handle_account_id" property="handleAccountId" jdbcType="BIGINT"/>
- <result column="handle_account_name" property="handleAccountName" jdbcType="VARCHAR"/>
- <result column="handle_position_id" property="handlePositionId" jdbcType="BIGINT"/>
- <result column="handle_position_name" property="handlePositionName" jdbcType="VARCHAR"/>
- <result column="handle_group_id" property="handleGroupId" jdbcType="BIGINT"/>
- <result column="handle_group_name" property="handleGroupName" jdbcType="VARCHAR"/>
- <result column="status" property="status" jdbcType="BIGINT"/>
- </resultMap>
- <resultMap id="GoafTaskDtoMapper" type="com.zhyc.xps.goaf.dto.GoafTaskDto">
- <id column="task_id" property="taskId" jdbcType="BIGINT"/>
- <result column="oc_id" property="ocId" jdbcType="BIGINT"/>
- <result column="goaf_id" property="goafId" jdbcType="BIGINT"/>
- <result column="job_id" property="jobId" jdbcType="BIGINT"/>
- <result column="check_def_id" property="checkDefId" jdbcType="BIGINT"/>
- <result column="checklist_id" property="checklistId" jdbcType="BIGINT"/>
- <result column="task_title" property="taskTitle" jdbcType="VARCHAR"/>
- <result column="task_desc" property="taskDesc" jdbcType="VARCHAR"/>
- <result column="expected_start_date" property="expectedStartDate" jdbcType="DATE"/>
- <result column="expected_end_date" property="expectedEndDate" jdbcType="DATE"/>
- <result column="handle_account_id" property="handleAccountId" jdbcType="BIGINT"/>
- <result column="handle_account_name" property="handleAccountName" jdbcType="VARCHAR"/>
- <result column="handle_position_id" property="handlePositionId" jdbcType="BIGINT"/>
- <result column="handle_position_name" property="handlePositionName" jdbcType="VARCHAR"/>
- <result column="handle_group_id" property="handleGroupId" jdbcType="BIGINT"/>
- <result column="handle_group_name" property="handleGroupName" jdbcType="VARCHAR"/>
- <result column="status" property="status" jdbcType="BIGINT"/>
- <result column="goaf_orebelt" property="goafOrebelt" jdbcType="BIGINT"/>
- <result column="goaf_orebody" property="goafOrebody" jdbcType="BIGINT"/>
- <result column="goaf_oreheight" property="goafOreheight" jdbcType="BIGINT"/>
- <result column="goaf_name" property="goafName" jdbcType="VARCHAR"/>
- </resultMap>
- <select id="getByList" parameterType="java.util.Map" resultMap="GoafTaskDtoMapper">
- SELECT A.*,
- B.goaf_orebelt,
- B.goaf_orebody,
- B.goaf_oreheight,
- B.goaf_name
- FROM goaf_task AS A
- LEFT JOIN goaf_baseinfo AS B ON A.goaf_id = B.goaf_id
- WHERE A.oc_id = #{ocId ,jdbcType=BIGINT}
- <if test="goafId !=null">
- AND A.goaf_id = #{goafId ,jdbcType=BIGINT}
- </if>
- <if test="jobId !=null">
- AND A.job_id = #{jobId ,jdbcType=BIGINT}
- </if>
- <if test="checkDefId !=null">
- AND A.check_def_id = #{checkDefId ,jdbcType=BIGINT}
- </if>
- <if test="taskTitle !=null and taskTitle != '' ">
- AND A.task_title like "%"#{taskTitle}"%"
- </if>
- <if test="handleGroupId !=null">
- AND A.handle_group_id = #{handleGroupId ,jdbcType=BIGINT}
- </if>
- <if test="handleAccountId !=null">
- AND A.handle_account_id = #{handleAccountId ,jdbcType=BIGINT}
- </if>
- <if test="status !=null">
- AND A.status = #{status ,jdbcType=BIGINT}
- </if>
- <if test="expectedStartDate != null and expectedEndDate != null">
- <![CDATA[
- AND A.expected_end_date >= #{expectedStartDate, jdbcType=TIMESTAMP}
- AND A.expected_end_date <= #{expectedEndDate, jdbcType=TIMESTAMP}
- ]]>
- </if>
- </select>
- <!--分页查询-->
- <select id="getByPage" parameterType="java.util.Map" resultMap="GoafTaskDtoMapper">
- SELECT A.*,
- B.goaf_orebelt,
- B.goaf_orebody,
- B.goaf_oreheight,
- B.goaf_name
- FROM goaf_task AS A
- LEFT JOIN goaf_baseinfo AS B ON A.goaf_id = B.goaf_id
- WHERE A.oc_id = #{ocId ,jdbcType=BIGINT}
- <if test="goafId !=null">
- AND A.goaf_id = #{goafId ,jdbcType=BIGINT}
- </if>
- <if test="jobId !=null">
- AND A.job_id = #{jobId ,jdbcType=BIGINT}
- </if>
- <if test="checkDefId !=null">
- AND A.check_def_id = #{checkDefId ,jdbcType=BIGINT}
- </if>
- <if test="taskTitle !=null and taskTitle != '' ">
- AND A.task_title like "%"#{taskTitle}"%"
- </if>
- <if test="handleGroupId !=null">
- AND A.handle_group_id = #{handleGroupId ,jdbcType=BIGINT}
- </if>
- <if test="handleAccountId !=null">
- AND A.handle_account_id = #{handleAccountId ,jdbcType=BIGINT}
- </if>
- <if test="status !=null">
- AND A.status = #{status ,jdbcType=BIGINT}
- </if>
- <if test="expectedStartDate != null and expectedEndDate != null">
- <![CDATA[
- AND A.expected_end_date >= #{expectedStartDate, jdbcType=TIMESTAMP}
- AND A.expected_end_date <= #{expectedEndDate, jdbcType=TIMESTAMP}
- ]]>
- </if>
- </select>
-
- <select id="getBytaskId" resultMap="GoafTaskMapper">
- SELECT *
- FROM goaf_task
- WHERE task_id = #{taskId, jdbcType=BIGINT}
- </select>
- <insert id="create" parameterType="com.zhyc.xps.goaf.entity.GoafTask">
- insert into goaf_task
- <trim prefix="(" suffix=")" suffixOverrides=",">
- <if test="taskId != null">
- task_id,
- </if>
- <if test="ocId != null">
- oc_id,
- </if>
- <if test="goafId != null">
- goaf_id,
- </if>
- <if test="jobId != null">
- job_id,
- </if>
- <if test="checkDefId != null">
- check_def_id,
- </if>
- <if test="checklistId != null">
- checklist_id,
- </if>
- <if test="taskTitle != null and taskTitle != ''">
- task_title,
- </if>
- <if test="taskDesc != null and taskDesc != ''">
- task_desc,
- </if>
- <if test="expectedStartDate != null">
- expected_start_date,
- </if>
- <if test="expectedEndDate != null">
- expected_end_date,
- </if>
- <if test="handleAccountId != null">
- handle_account_id,
- </if>
- <if test="handleAccountName != null and handleAccountName != ''">
- handle_account_name,
- </if>
- <if test="handlePositionId != null">
- handle_position_id,
- </if>
- <if test="handlePositionName != null and handlePositionName != ''">
- handle_position_name,
- </if>
- <if test="handleGroupId != null">
- handle_group_id,
- </if>
- <if test="handleGroupName != null and handleGroupName != ''">
- handle_group_name,
- </if>
- <if test="status != null">
- status,
- </if>
- </trim>
- <trim prefix="values (" suffix=")" suffixOverrides=",">
- <if test="taskId != null">
- #{taskId, jdbcType=BIGINT},
- </if>
- <if test="ocId != null">
- #{ocId, jdbcType=BIGINT},
- </if>
- <if test="goafId != null">
- #{goafId, jdbcType=BIGINT},
- </if>
- <if test="jobId != null">
- #{jobId, jdbcType=BIGINT},
- </if>
- <if test="checkDefId != null">
- #{checkDefId, jdbcType=BIGINT},
- </if>
- <if test="checklistId != null">
- #{checklistId, jdbcType=BIGINT},
- </if>
- <if test="taskTitle != null and taskTitle != ''">
- #{taskTitle, jdbcType=VARCHAR},
- </if>
- <if test="taskDesc != null and taskDesc != ''">
- #{taskDesc, jdbcType=VARCHAR},
- </if>
- <if test="expectedStartDate != null">
- #{expectedStartDate, jdbcType=DATE},
- </if>
- <if test="expectedEndDate != null">
- #{expectedEndDate, jdbcType=DATE},
- </if>
- <if test="handleAccountId != null">
- #{handleAccountId, jdbcType=BIGINT},
- </if>
- <if test="handleAccountName != null and handleAccountName != ''">
- #{handleAccountName, jdbcType=VARCHAR},
- </if>
- <if test="handlePositionId != null">
- #{handlePositionId, jdbcType=BIGINT},
- </if>
- <if test="handlePositionName != null and handlePositionName != ''">
- #{handlePositionName, jdbcType=VARCHAR},
- </if>
- <if test="handleGroupId != null">
- #{handleGroupId, jdbcType=BIGINT},
- </if>
- <if test="handleGroupName != null and handleGroupName != ''">
- #{handleGroupName, jdbcType=VARCHAR},
- </if>
- <if test="status != null">
- #{status, jdbcType=BIGINT},
- </if>
- </trim>
- </insert>
- <!--Update更新-->
- <update id="updatebyjobid" parameterType="com.zhyc.xps.goaf.entity.GoafTask">
- UPDATE goaf_task
- <trim suffixOverrides=",">
- <set>
- <if test="status != null">
- status = #{status ,jdbcType=BIGINT},
- </if>
- </set>
- </trim>
- WHERE job_id = #{jobId ,jdbcType=BIGINT}
- </update>
- <!--Update更新-->
- <update id="update" parameterType="com.zhyc.xps.goaf.entity.GoafTask">
- UPDATE goaf_task
- status = #{status ,jdbcType=BIGINT}
- WHERE oc_id = #{ocId, jdbcType=BIGINT} AND task_id = #{taskId ,jdbcType=BIGINT}
- </update>
- <delete id="delete" >
- DELETE FROM goaf_task
- WHERE task_id = #{taskId, jdbcType=BIGINT}
- </delete>
- <delete id="deletebystatus" parameterType="java.util.Map">
- DELETE FROM goaf_task
- WHERE oc_id = #{ocId, jdbcType=BIGINT} AND status = #{status, jdbcType=BIGINT}
- AND check_def_id = #{checkDefId, jdbcType=BIGINT}
- </delete>
- </mapper>
|