123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298 |
- <?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.TodoMapper">
- <resultMap id="TodoDtoResultMap" type="com.zhyc.xps.sys.dto.TodoDto">
- <result column="oc_id" property="ocId" jdbcType="BIGINT" /><!--单位ID-->
- <result column="todo_id" property="todoId" jdbcType="BIGINT" /><!---->
- <result column="todo_title" property="todoTitle" jdbcType="VARCHAR" />
- <result column="todo_desc" property="todoDesc" jdbcType="VARCHAR" />
- <result column="status" property="status" jdbcType="BIGINT" />
- <result column="handle_remark" property="handleRemark" jdbcType="VARCHAR" />
- <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="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="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="parent_id" property="parentId" jdbcType="BIGINT" />
- <result column="root_id" property="rootId" jdbcType="BIGINT" />
- <result column="task_origin" property="taskOrigin" jdbcType="BIGINT" />
- <result column="wf_def_id" property="wfDefId" jdbcType="BIGINT" />
- <result column="wf_ins_id" property="wfInsId" jdbcType="BIGINT" />
- <result column="status" property="status" 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="TodoDto_Cols">
- A.oc_id,
- A.todo_id,
- A.todo_desc,
- A.todo_title,
- A.handle_remark,
- B.task_id,
- B.task_title,
- B.task_desc,
- B.task_cat_id,
- C.task_cat_title,
- B.task_type_id,
- B.expected_start_time,
- B.expected_end_time,
- B.actual_start_time,
- B.actual_end_time,
- B.task_priority,
- B.parent_id,
- B.root_id,
- B.task_origin,
- B.launch_group_id,
- B.launch_group_name,
- B.launch_position_id,
- B.launch_position_name,
- B.launch_account_id,
- B.launch_account_name,
- B.launch_time,
- B.handle_group_id,
- B.handle_group_name,
- B.handle_position_id,
- B.handle_position_name,
- B.handle_account_id,
- B.handle_account_name,
- B.handle_time,
- W.wf_def_id,
- W.wf_ins_id,
- W.status,
- 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="TodoDtoResultMap">
- SELECT
- <include refid="TodoDto_Cols"/>
- FROM todo AS A
- LEFT JOIN task AS B ON (A.oc_id = B.oc_id AND A.todo_id = B.task_id )
- LEFT JOIN task_cat AS C ON (B.oc_id = C.oc_id AND B.task_cat_id = C.task_cat_id )
- LEFT JOIN wf_ins AS W ON (A.oc_id = W.oc_id AND A.todo_id = W.wf_ins_id )
- WHERE A.oc_id = #{ocId ,jdbcType=BIGINT} AND A.todo_id = #{todoId ,jdbcType=BIGINT}
- </select>
- <!--列表查询-->
- <select id="getByList" parameterType="java.util.Map" resultMap="TodoDtoResultMap" >
- SELECT
- <include refid="TodoDto_Cols"/>
- FROM todo AS A
- LEFT JOIN task AS B ON (A.oc_id = B.oc_id AND A.todo_id = B.task_id )
- LEFT JOIN task_cat AS C ON (B.oc_id = C.oc_id AND B.task_cat_id = C.task_cat_id )
- LEFT JOIN wf_ins AS W ON (A.oc_id = W.oc_id AND A.todo_id = W.wf_ins_id )
- WHERE A.oc_id = #{ocId ,jdbcType=BIGINT} AND A.deleted_flag = 0
- <if test="todoId !=null">
- AND A.todo_id = #{todoId ,jdbcType=BIGINT}
- </if>
- <if test="keywords != null and keywords != ''">
- AND A.todo_title like "%"#{keywords}"%"
- </if>
- <if test="taskTypeId != null">
- AND B.task_type_id = #{taskTypeId ,jdbcType=BIGINT}
- </if>
- <if test="taskCatId != null">
- AND B.task_cat_id = #{taskCatId ,jdbcType=BIGINT}
- </if>
- <if test="status != null">
- AND D.status = #{status ,jdbcType=BIGINT}
- </if>
- <if test="day != null">
- AND date_format(B.launch_time, '%Y-%m-%d') = #{day}
- </if>
- <if test="startDate != null and endDate != null">
- AND B.launch_time BETWEEN #{startDate} and #{endDate}
- </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="curGroupNodeLeft != null and curGroupNodeRight != null">
- <![CDATA[
- AND X.node_left >= #{curGroupNodeLeft, jdbcType=BIGINT}
- AND X.node_right <= #{curGroupNodeRight, jdbcType=BIGINT}
- ]]>
- </if>
- ORDER BY B.launch_time DESC
- </select>
- <!--分页查询-->
- <select id="getByPage" parameterType="java.util.Map" resultMap="TodoDtoResultMap">
- SELECT
- <include refid="TodoDto_Cols"/>
- FROM todo AS A
- LEFT JOIN task AS B ON (A.oc_id = B.oc_id AND A.todo_id = B.task_id )
- LEFT JOIN task_cat AS C ON (B.oc_id = C.oc_id AND B.task_cat_id = C.task_cat_id )
- LEFT JOIN wf_ins AS W ON (A.oc_id = W.oc_id AND A.todo_id = W.wf_ins_id )
- WHERE A.oc_id = #{ocId ,jdbcType=BIGINT} AND A.deleted_flag = 0
- <if test="todoId !=null">
- AND A.todo_id = #{todoId ,jdbcType=BIGINT}
- </if>
- <if test="keywords != null and keywords != ''">
- AND A.todo_title like "%"#{keywords}"%"
- </if>
- <if test="taskTypeId != null">
- AND B.task_type_id = #{taskTypeId ,jdbcType=BIGINT}
- </if>
- <if test="taskCatId != null">
- AND B.task_cat_id = #{taskCatId ,jdbcType=BIGINT}
- </if>
- <if test="status != null">
- AND D.status = #{status ,jdbcType=BIGINT}
- </if>
- <if test="day != null">
- AND date_format(B.launch_time , '%Y-%m-%d') = #{day}
- </if>
- <if test="startDate != null and endDate != null">
- AND A.launch_time BETWEEN #{startDate} and #{endDate}
- </if>
- <if test="nodeLeft != null and nodeRight != null">
- <![CDATA[
- AND C.node_left >= #{nodeLeft ,jdbcType=BIGINT}
- AND C.node_right <= #{nodeRight ,jdbcType=BIGINT}
- ]]>
- </if>
- ORDER BY B.launch_time DESC
- </select>
- <!--Create-->
- <insert id="create" parameterType="com.zhyc.xps.sys.entity.Todo">
- INSERT INTO todo
- <trim prefix="(" suffix=")" suffixOverrides=",">
- <if test="ocId != null">
- oc_id,
- </if>
- <if test="todoId != null">
- todo_id,
- </if>
- <if test="todoTitle != null and todoTitle!=''">
- todo_title,
- </if>
- <if test="todoDesc != null and todoDesc != ''">
- todo_desc,
- </if>
- <if test="handleRemark != null">
- handle_remark,
- </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="todoId != null">
- #{todoId ,jdbcType=BIGINT},
- </if>
- <if test="todoTitle != null and todoTitle!=''">
- #{todoTitle ,jdbcType=VARCHAR},
- </if>
- <if test="todoDesc != null and todoDesc != ''">
- #{todoDesc ,jdbcType=VARCHAR},
- </if>
- <if test="handleRemark != null">
- #{handleRemark ,jdbcType=VARCHAR},
- </if>
- <if test="createdBy != null">
- #{createdBy ,jdbcType=BIGINT},
- </if>
- <if test="createdAt != null">
- #{createdAt ,jdbcType=TIMESTAMP},
- </if>
- </trim>
- </insert>
- <!--更新-->
- <update id="update" parameterType="com.zhyc.xps.sys.entity.Todo">
- UPDATE todo
- <trim suffixOverrides=",">
- <set>
- <if test="todoTitle != null">
- todo_title =#{todoTitle ,jdbcType=VARCHAR},
- </if>
- <if test="todoDesc != null and todoDesc != ''">
- todo_desc = #{todoDesc ,jdbcType=VARCHAR},
- </if>
- <if test="handleRemark != null">
- handle_remark = #{handleRemark ,jdbcType=VARCHAR},
- </if>
- <if test="updatedBy != null">
- updated_by = #{updatedBy ,jdbcType=BIGINT},
- </if>
- <if test="updatedAt != null">
- updated_at = #{updatedAt ,jdbcType=TIMESTAMP},
- </if>
- </set>
- </trim>
- WHERE oc_id = #{ocId, jdbcType=BIGINT} AND todo_id = #{todoId, jdbcType=BIGINT}
- </update>
- <!--删除 -->
- <update id="delete" parameterType="java.util.Map">
- UPDATE todo
- <trim suffixOverrides=",">
- <set>
- <if test="deletedBy != null">
- deleted_by = #{deletedBy ,jdbcType=BIGINT},
- </if>
- <if test="deletedAt != null">
- deleted_at = #{deletedAt ,jdbcType=DATE},
- </if>
- <if test="deletedFlag != null">
- deleted_flag = #{deletedFlag ,jdbcType=BIGINT},
- </if>
- </set>
- </trim>
- WHERE oc_id = #{ocId ,jdbcType=BIGINT} AND deleted_flag = 0
- <if test="todoId != null ">
- AND todo_id = #{todoId ,jdbcType=BIGINT}
- </if>
- </update>
- </mapper>
|