123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530 |
- <?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.sys.mapper.TaskMapper">
- <resultMap id="TaskDtoResultMap" type="com.zhyc.xps.sys.dto.TaskDto">
- <result column="oc_id" property="ocId" jdbcType="BIGINT" />
- <result column="task_id" property="taskId" jdbcType="BIGINT" />
- <result column="task_title" property="taskTitle" jdbcType="VARCHAR" />
- <result column="task_desc" property="taskDesc" jdbcType="VARCHAR" />
- <result column="task_cat_id" property="taskCatId" jdbcType="BIGINT" />
- <result column="task_cat_title" property="taskCatTitle" jdbcType="VARCHAR" />
- <result column="task_type_id" property="taskTypeId" jdbcType="BIGINT" />
- <result column="expected_start_time" property="expectedStartTime" jdbcType="DATE" />
- <result column="expected_end_time" property="expectedEndTime" jdbcType="DATE" />
- <result column="actual_start_time" property="actualStartTime" jdbcType="DATE" />
- <result column="actual_end_time" property="actualEndTime" jdbcType="DATE" />
- <result column="task_priority" property="taskPriority" jdbcType="BIGINT" />
- <result column="status" property="status" jdbcType="BIGINT" />
- <result column="launch_group_id" property="launchGroupId" jdbcType="BIGINT" />
- <result column="launch_position_id" property="launchPositionId" jdbcType="BIGINT" />
- <result column="launch_account_id" property="launchAccountId" jdbcType="BIGINT" />
- <result column="launch_group_name" property="launchGroupName" jdbcType="VARCHAR" />
- <result column="launch_position_name" property="launchPositionName" jdbcType="VARCHAR" />
- <result column="launch_account_name" property="launchAccountName" jdbcType="VARCHAR" />
- <result column="launch_time" property="launchTime" jdbcType="DATE" />
- <result column="parent_id" property="parentId" jdbcType="BIGINT" />
- <result column="root_id" property="rootId" jdbcType="BIGINT" />
- <result column="task_origin" property="taskOrigin" jdbcType="BIGINT" />
- <result column="handle_group_id" property="handleGroupId" jdbcType="BIGINT" />
- <result column="handle_position_id" property="handlePositionId" jdbcType="BIGINT" />
- <result column="handle_account_id" property="handleAccountId" jdbcType="BIGINT" />
- <result column="handle_group_name" property="handleGroupName" jdbcType="VARCHAR" />
- <result column="handle_position_name" property="handlePositionName" jdbcType="VARCHAR" />
- <result column="handle_account_name" property="handleAccountName" jdbcType="VARCHAR" />
- <result column="handle_time" property="handleTime" jdbcType="DATE" />
- <result column="wf_def_id" property="wfDefId" jdbcType="BIGINT" />
- <result column="wf_ins_id" property="wfInsId" jdbcType="BIGINT" />
- <result column="cur_activity_ins_id" property="curActivityInsId" jdbcType="BIGINT" />
- <result column="cur_activity_code" property="curActivityCode" jdbcType="VARCHAR" />
- <result column="cur_activity_title" property="curActivityTitle" jdbcType="VARCHAR" />
- <result column="cur_activity_begin_time" property="curActivityBeginTime" jdbcType="TIMESTAMP"/>
- <result column="cur_form_code" property="curFormCode" jdbcType="VARCHAR" />
- <result column="cur_group_id" property="curGroupId" jdbcType="BIGINT" />
- <result column="cur_position_id" property="curPositionId" jdbcType="BIGINT" />
- <result column="cur_account_id" property="curAccountId" jdbcType="BIGINT" />
- <result column="cur_group_name" property="curGroupName" jdbcType="VARCHAR" />
- <result column="cur_position_name" property="curPositionName" jdbcType="VARCHAR" />
- <result column="cur_account_name" property="curAccountName" jdbcType="VARCHAR" />
- </resultMap>
- <sql id="TaskDto_Cols">
- A.oc_id,
- A.task_id,
- A.task_title,
- A.task_desc,
- A.task_cat_id,
- B.task_cat_title,
- A.task_type_id,
- A.expected_start_time,
- A.expected_end_time,
- A.actual_start_time,
- A.actual_end_time,
- A.task_priority,
- A.parent_id,
- A.root_id,
- A.status,
- A.task_origin,
- A.launch_group_id,
- A.launch_group_name,
- A.launch_position_id,
- A.launch_position_name,
- A.launch_account_id,
- A.launch_account_name,
- A.launch_time,
- A.handle_group_id,
- A.handle_group_name,
- A.handle_position_id,
- A.handle_position_name,
- A.handle_account_id,
- A.handle_account_name,
- A.handle_time,
- W.wf_def_id,
- W.wf_ins_id,
- W.cur_activity_title,
- W.cur_activity_code,
- W.cur_form_code,
- W.cur_activity_ins_id,
- W.cur_activity_begin_time,
- W.cur_group_id,
- W.cur_group_name,
- W.cur_position_id,
- W.cur_position_name,
- W.cur_account_id,
- W.cur_account_name
- </sql>
- <!--基于ID查询-->
- <select id="getById" resultMap="TaskDtoResultMap">
- SELECT
- <include refid="TaskDto_Cols"/>
- FROM task AS A
- LEFT JOIN task_cat AS B ON (A.task_cat_id = B.task_cat_id )
- LEFT JOIN wf_ins AS W ON (A.oc_id = W.oc_id AND A.task_id = W.wf_ins_id )
- WHERE A.deleted_flag = 0
- AND A.oc_id = #{ocId, jdbcType=BIGINT}
- AND A.task_id = #{taskId, jdbcType=BIGINT}
- </select>
- <!--分页查询-->
- <select id="getByPage" parameterType="java.util.Map" resultMap="TaskDtoResultMap">
- SELECT
- <include refid="TaskDto_Cols"/>
- FROM task AS A
- LEFT JOIN task_cat AS B ON (A.task_cat_id = B.task_cat_id )
- LEFT JOIN s_group AS C ON (A.oc_id = C.oc_id AND A.handle_group_id = C.group_id )
- LEFT JOIN wf_ins AS W ON (A.oc_id = W.oc_id AND A.task_id = W.wf_ins_id )
- WHERE A.deleted_flag = 0
- <if test="ocId != null">
- AND A.oc_id = #{ocId ,jdbcType=BIGINT}
- </if>
- <if test="taskId != null">
- AND A.task_id = #{taskId ,jdbcType=BIGINT}
- </if>
- <if test="taskTypeId != null">
- AND A.task_type_id = #{taskTypeId ,jdbcType=BIGINT}
- </if>
- <if test="taskCatId != null">
- AND A.task_cat_id = #{taskCatId ,jdbcType=BIGINT}
- </if>
- <if test="keywords != null and keywords != ''">
- AND A.task_title like "%"#{keywords}"%"
- </if>
- <if test="launchAccountId != null">
- AND A.launch_account_id = #{launchAccountId,jdbcType=BIGINT}
- </if>
- <if test="launchPositionId != null">
- AND A.launch_position_id = #{launchPositionId,jdbcType=BIGINT}
- </if>
- <if test="launchGroupId != null">
- AND A.launch_group_id = #{launchGroupId,jdbcType=BIGINT}
- </if>
- <if test="handleAccountId != null">
- AND A.handle_account_id = #{handleAccountId,jdbcType=BIGINT}
- </if>
- <if test="handlePositionId != null">
- AND A.handle_position_id = #{handlePositionId,jdbcType=BIGINT}
- </if>
- <if test="handleGroupId != null">
- AND A.handle_group_id = #{handleGroupId,jdbcType=BIGINT}
- </if>
- <if test="handleGroupNodeLeft != null and handleGroupNodeRight != null">
- <![CDATA[
- AND C.node_left >= #{handleGroupNodeLeft, jdbcType=BIGINT}
- AND C.node_right <= #{handleGroupNodeRight, jdbcType=BIGINT}
- ]]>
- </if>
- <if test="curAccountId != null">
- AND W.cur_account_id = #{curAccountId, jdbcType=BIGINT}
- </if>
- <if test="status != null">
- AND A.status = #{status ,jdbcType=BIGINT}
- </if>
- ORDER BY A.task_id ASC
- </select>
- <!--列表查询-->
- <select id="getByList" parameterType="java.util.Map" resultMap="TaskDtoResultMap">
- SELECT
- <include refid="TaskDto_Cols"/>
- FROM task AS A
- LEFT JOIN task_cat AS B ON (A.task_cat_id = B.task_cat_id )
- LEFT JOIN wf_ins AS W ON (A.oc_id = W.oc_id AND A.task_id = W.wf_ins_id)
- WHERE A.deleted_flag = 0
- <if test="ocId != null">
- AND A.oc_id = #{ocId ,jdbcType=BIGINT}
- </if>
- <if test="taskTypeId != null">
- AND A.task_type_id = #{taskTypeId ,jdbcType=BIGINT}
- </if>
- <if test="taskCatId != null">
- AND A.task_cat_id = #{taskCatId ,jdbcType=BIGINT}
- </if>
- <if test="keywords != null and keywords != ''">
- AND A.task_title like "%"#{keywords}"%"
- </if>
- <if test="launchAccountId != null">
- AND A.launch_account_id = #{launchAccountId,jdbcType=BIGINT}
- </if>
- <if test="launchPositionId != null">
- AND A.launch_position_id = #{launchPositionId,jdbcType=BIGINT}
- </if>
- <if test="launchGroupId != null">
- AND A.launch_group_id = #{launchGroupId,jdbcType=BIGINT}
- </if>
- <if test="handleAccountId != null">
- AND A.handle_account_id = #{handleAccountId,jdbcType=BIGINT}
- </if>
- <if test="handlePositionId != null">
- AND A.handle_position_id = #{handlePositionId,jdbcType=BIGINT}
- </if>
- <if test="handleGroupId != null">
- AND A.handle_group_id = #{handleGroupId,jdbcType=BIGINT}
- </if>
- <if test="handleGroupNodeLeft != null and handleGroupNodeRight != null">
- <![CDATA[
- AND C.node_left >= #{handleGroupNodeLeft, jdbcType=BIGINT}
- AND C.node_right <= #{handleGroupNodeRight, jdbcType=BIGINT}
- ]]>
- </if>
- <if test="status != null">
- AND A.status = #{status ,jdbcType=BIGINT}
- </if>
- ORDER BY A.expected_end_time DESC
- <if test="limit!=null">
- LIMIT 0, #{limit, jdbcType=BIGINT}
- </if>
- </select>
- <insert id="create" parameterType="com.zhyc.xps.sys.entity.Task">
- INSERT INTO task
- <trim prefix="(" suffix=")" suffixOverrides=",">
- <if test="ocId != null">
- oc_id ,
- </if>
- <if test="taskId != null">
- task_id,
- </if>
- <if test="taskCode != null and taskCode != ''">
- task_code,
- </if>
- <if test="taskTitle != null and taskTitle != ''">
- task_title,
- </if>
- <if test="taskDesc != null and taskDesc != ''">
- task_desc,
- </if>
- <if test="taskCatId != null">
- task_cat_id,
- </if>
- <if test="taskTypeId != null">
- task_type_id,
- </if>
- <if test="expectedStartTime != null">
- expected_start_time,
- </if>
- <if test="expectedEndTime != null">
- expected_end_time,
- </if>
- <if test="actualStartTime != null">
- actual_start_time,
- </if>
- <if test="actualEndTime != null">
- actual_end_time,
- </if>
- <if test="taskPriority!= null">
- task_priority,
- </if>
- <if test="parentId != null">
- parent_id,
- </if>
- <if test="rootId != null">
- root_id,
- </if>
- <if test="taskOrigin != null">
- task_origin,
- </if>
- <if test="launchGroupId != null">
- launch_group_id,
- </if>
- <if test="launchPositionId != null">
- launch_position_id,
- </if>
- <if test="launchAccountId != null">
- launch_account_id,
- </if>
- <if test="launchGroupName != null and launchGroupName != ''">
- launch_group_name,
- </if>
- <if test="launchPositionName != null and launchPositionName != ''">
- launch_position_name,
- </if>
- <if test="launchAccountName != null and launchAccountName != ''">
- launch_account_name,
- </if>
- <if test="launchTime != null">
- launch_time,
- </if>
- <if test="handleGroupId != null">
- handle_group_id,
- </if>
- <if test="handlePositionId != null">
- handle_position_id,
- </if>
- <if test="handleAccountId != null">
- handle_account_id,
- </if>
- <if test="handleGroupName != null and handleGroupName != ''">
- handle_group_name,
- </if>
- <if test="handlePositionName != null and handlePositionName != ''">
- handle_position_name,
- </if>
- <if test="handleAccountName != null and handleAccountName != ''">
- handle_account_name,
- </if>
- <if test="handleTime != null">
- handle_time,
- </if>
- <if test="status != null">
- status,
- </if>
- <if test="createdBy != null">
- created_by,
- </if>
- <if test="createdAt != null">
- created_at,
- </if>
- </trim>
- <trim prefix="values (" suffix=")" suffixOverrides=",">
- <if test="ocId != null">
- #{ocId ,jdbcType=BIGINT},
- </if>
- <if test="taskId != null">
- #{taskId ,jdbcType=BIGINT},
- </if>
- <if test="taskCode != null and taskCode != ''">
- #{taskCode ,jdbcType=VARCHAR},
- </if>
- <if test="taskTitle != null and taskTitle != ''">
- #{taskTitle ,jdbcType=VARCHAR},
- </if>
- <if test="taskDesc != null and taskDesc != ''">
- #{taskDesc ,jdbcType=VARCHAR},
- </if>
- <if test="taskCatId != null">
- #{taskCatId ,jdbcType=BIGINT},
- </if>
- <if test="taskTypeId != null">
- #{taskTypeId ,jdbcType=BIGINT},
- </if>
- <if test="expectedStartTime != null">
- #{expectedStartTime ,jdbcType=DATE},
- </if>
- <if test="expectedEndTime != null">
- #{expectedEndTime ,jdbcType=DATE},
- </if>
- <if test="actualStartTime != null">
- #{actualStartTime ,jdbcType=DATE},
- </if>
- <if test="actualEndTime != null">
- #{actualEndTime ,jdbcType=DATE},
- </if>
- <if test="taskPriority!= null">
- #{taskPriority ,jdbcType=BIGINT},
- </if>
- <if test="parentId != null">
- #{parentId ,jdbcType=BIGINT},
- </if>
- <if test="rootId != null">
- #{rootId ,jdbcType=BIGINT},
- </if>
- <if test="taskOrigin != null">
- #{taskOrigin ,jdbcType=BIGINT},
- </if>
- <if test="launchGroupId != null">
- #{launchGroupId ,jdbcType=BIGINT},
- </if>
- <if test="launchPositionId != null">
- #{launchPositionId ,jdbcType=BIGINT},
- </if>
- <if test="launchAccountId != null">
- #{launchAccountId ,jdbcType=BIGINT},
- </if>
- <if test="launchGroupName != null and launchGroupName != ''">
- #{launchGroupName ,jdbcType=VARCHAR},
- </if>
- <if test="launchPositionName != null and launchPositionName != ''">
- #{launchPositionName ,jdbcType=VARCHAR},
- </if>
- <if test="launchAccountName != null and launchAccountName != ''">
- #{launchAccountName ,jdbcType=VARCHAR},
- </if>
- <if test="launchTime != null">
- #{launchTime ,jdbcType=DATE},
- </if>
- <if test="handleGroupId != null">
- #{handleGroupId ,jdbcType=BIGINT},
- </if>
- <if test="handlePositionId != null">
- #{handlePositionId ,jdbcType=BIGINT},
- </if>
- <if test="handleAccountId != null">
- #{handleAccountId ,jdbcType=BIGINT},
- </if>
- <if test="handleGroupName != null and handleGroupName != ''">
- #{handleGroupName ,jdbcType=VARCHAR},
- </if>
- <if test="handlePositionName != null and handlePositionName != ''">
- #{handlePositionName ,jdbcType=VARCHAR},
- </if>
- <if test="handleAccountName != null and handleAccountName != ''">
- #{handleAccountName ,jdbcType=VARCHAR},
- </if>
- <if test="handleTime != null">
- #{handleTime ,jdbcType=DATE},
- </if>
- <if test="status != null">
- #{status ,jdbcType=BIGINT},
- </if>
- <if test="createdBy != null">
- #{createdBy ,jdbcType=BIGINT},
- </if>
- <if test="createdAt != null">
- #{createdAt ,jdbcType=DATE},
- </if>
- </trim>
- </insert>
- <!--更新-->
- <update id="update" parameterType="com.zhyc.xps.sys.entity.Task">
- UPDATE task
- <trim suffixOverrides=",">
- <set>
- <if test="taskCode != null and taskCode != ''">
- task_code = #{taskCode ,jdbcType=VARCHAR},
- </if>
- <if test="taskTitle != null and taskTitle != ''">
- task_title = #{taskTitle, jdbcType=VARCHAR},
- </if>
- <if test="taskDesc != null and taskDesc != ''">
- task_desc = #{taskDesc, jdbcType=VARCHAR},
- </if>
- <if test="taskCatId != null">
- task_cat_id = #{taskCatId ,jdbcType=BIGINT},
- </if>
- <if test="taskTypeId != null">
- task_type_id = #{taskTypeId ,jdbcType=BIGINT},
- </if>
- <if test="expectedStartTime != null">
- expected_start_time = #{expectedStartTime ,jdbcType=DATE},
- </if>
- <if test="expectedEndTime != null">
- expected_end_time = #{expectedEndTime ,jdbcType=DATE},
- </if>
- <if test="actualStartTime != null">
- actual_start_time = #{actualStartTime ,jdbcType=DATE},
- </if>
- <if test="actualEndTime != null">
- actual_end_time = #{actualEndTime ,jdbcType=DATE},
- </if>
- <if test="taskPriority!= null">
- task_priority = #{taskPriority ,jdbcType=BIGINT},
- </if>
- <if test="parentId != null">
- parent_id = #{parentId ,jdbcType=BIGINT},
- </if>
- <if test="rootId != null">
- root_id = #{rootId ,jdbcType=BIGINT},
- </if>
- <if test="taskOrigin != null">
- task_origin = #{taskOrigin ,jdbcType=BIGINT},
- </if>
- <if test="handleGroupId != null">
- handle_group_id = #{handleGroupId ,jdbcType=BIGINT},
- </if>
- <if test="handlePositionId != null">
- handle_position_id = #{handlePositionId ,jdbcType=BIGINT},
- </if>
- <if test="handleAccountId != null">
- handle_account_id = #{handleAccountId ,jdbcType=BIGINT},
- </if>
- <if test="handleGroupName != null and handleGroupName != ''">
- handle_group_name = #{handleGroupName ,jdbcType=VARCHAR},
- </if>
- <if test="handlePositionName != null and handlePositionName != ''">
- handle_position_name = #{handlePositionName ,jdbcType=VARCHAR},
- </if>
- <if test="handleAccountName != null and handleAccountName != ''">
- handle_account_name = #{handleAccountName ,jdbcType=VARCHAR},
- </if>
- <if test="handleTime != null">
- handle_time = #{handleTime ,jdbcType=DATE},
- </if>
- <if test="status != null">
- status = #{status ,jdbcType=BIGINT},
- </if>
- <if test="updatedBy != null ">
- updated_by = #{updatedBy ,jdbcType=BIGINT},
- </if>
- <if test="updatedAt != null">
- updated_at = #{updatedAt ,jdbcType=DATE},
- </if>
- </set>
- </trim>
- WHERE oc_id = #{ocId, jdbcType=BIGINT}
- AND task_id = #{taskId, jdbcType=BIGINT}
- </update>
- <!--删除-->
- <update id="delete" parameterType="java.util.Map">
- UPDATE task
- <trim suffixOverrides=",">
- <set>
- <if test="deletedFlag != null">
- deleted_flag = #{deletedFlag,jdbcType=BIGINT},
- </if>
- <if test="deletedTime != null">
- deleted_time = #{deletedTime,jdbcType=DATE},
- </if>
- <if test="deletedBy != null">
- deleted_by = #{deletedBy,jdbcType=BIGINT},
- </if>
- </set>
- </trim>
- WHERE oc_id = #{ocId ,jdbcType=BIGINT}
- <if test="rootId != null">
- AND root_id = #{rootId ,jdbcType=BIGINT}
- </if>
- <if test="parentId != null">
- AND parent_id = #{parentId ,jdbcType=BIGINT}
- </if>
- <if test="taskCatId != null">
- AND task_cat_id = #{taskCatId ,jdbcType=BIGINT}
- </if>
- <if test="taskId != null">
- AND task_id = #{taskId ,jdbcType=BIGINT}
- </if>
- </update>
- </mapper>
|