|
@@ -0,0 +1,117 @@
|
|
|
|
|
+<?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.hssx.pcbms.mapper.TaskMapper">
|
|
|
|
|
+
|
|
|
|
|
+ <!-- 通用查询映射结果 -->
|
|
|
|
|
+ <resultMap id="BaseResultMap" type="com.hssx.pcbms.entity.Task">
|
|
|
|
|
+ <id column="id" property="id" />
|
|
|
|
|
+ <result column="name" property="name" />
|
|
|
|
|
+ <result column="code" property="code" />
|
|
|
|
|
+ <result column="plan_time" property="planTime" />
|
|
|
|
|
+ <result column="work_load" property="workLoad" />
|
|
|
|
|
+ <result column="recipient_id" property="recipientId" />
|
|
|
|
|
+ <result column="payer" property="payer" />
|
|
|
|
|
+ <result column="payee" property="payee" />
|
|
|
|
|
+ <result column="fee" property="fee" />
|
|
|
|
|
+ <result column="tag_id" property="tagId" />
|
|
|
|
|
+ <result column="delay_time" property="delayTime" />
|
|
|
|
|
+ <result column="state" property="state" />
|
|
|
|
|
+ <result column="publish_id" property="publishId" />
|
|
|
|
|
+ </resultMap>
|
|
|
|
|
+ <resultMap id="BaseResultMapVO" type="com.hssx.pcbms.entity.vo.TaskDTO">
|
|
|
|
|
+ <id column="id" property="id" />
|
|
|
|
|
+ <result column="name" property="name" />
|
|
|
|
|
+ <result column="code" property="code" />
|
|
|
|
|
+ <result column="plan_time" property="planTime" />
|
|
|
|
|
+ <result column="work_load" property="workLoad" />
|
|
|
|
|
+ <result column="recipient_id" property="recipientId" />
|
|
|
|
|
+ <result column="payer" property="payer" />
|
|
|
|
|
+ <result column="payee" property="payee" />
|
|
|
|
|
+ <result column="fee" property="fee" />
|
|
|
|
|
+ <result column="tag_id" property="tagId" />
|
|
|
|
|
+ <result column="delay_time" property="delayTime" />
|
|
|
|
|
+ <result column="state" property="state" />
|
|
|
|
|
+ <result column="publish_id" property="publishId" />
|
|
|
|
|
+ <result column="publishName" property="publishName" />
|
|
|
|
|
+ <result column="tag_name" property="tagName" />
|
|
|
|
|
+ <result column="recipient" property="recipient" />
|
|
|
|
|
+ <collection property="participantsVOS" select="selectPaticaterByTaskId" column="{taskId=id,}"
|
|
|
|
|
+ ofType="com.hssx.pcbms.entity.vo.TaskParticipantsVO"/>
|
|
|
|
|
+ </resultMap>
|
|
|
|
|
+
|
|
|
|
|
+ <!-- 通用查询结果列 -->
|
|
|
|
|
+ <sql id="Base_Column_List">
|
|
|
|
|
+ id, name, code, plan_time, work_load, recipient_id, payer, payee, fee, tag_id, delay_time, state, publish_id
|
|
|
|
|
+ </sql>
|
|
|
|
|
+
|
|
|
|
|
+ <select id="selectListByCondition" resultMap="BaseResultMapVO">
|
|
|
|
|
+ select
|
|
|
|
|
+ t.id, t.name, t.code, t.plan_time, t.work_load, t.recipient_id,
|
|
|
|
|
+ t.payer, t.payee, t.fee, t.tag_id, t.delay_time, t.state, t.publish_id
|
|
|
|
|
+ u.name publishName,tt.name tag_name,ru.name recipient
|
|
|
|
|
+ from
|
|
|
|
|
+ task t
|
|
|
|
|
+ left join user u
|
|
|
|
|
+ on t.publish_id = u.id
|
|
|
|
|
+ left join task_tags tt
|
|
|
|
|
+ on tt.id = t.tag_id
|
|
|
|
|
+ left join user ru
|
|
|
|
|
+ on t.recipient_id = ru.id
|
|
|
|
|
+ <where>
|
|
|
|
|
+ <if test="taskVO.keyName != null and taskVO.keyName != ''">
|
|
|
|
|
+ and name like concat('%',#{taskVO.keyName},'%')
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="taskVO.startTime != null and taskVO.startTime != ''and taskVO.endTime != null and taskVO.endTime != ''">
|
|
|
|
|
+ and plan_time between #{taskVO.startTime} and #{taskVO.endTime}
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="taskVO.uid != null">
|
|
|
|
|
+ and publish_id =#{taskVO.uid}
|
|
|
|
|
+ </if>
|
|
|
|
|
+ </where>
|
|
|
|
|
+ order by t.id desc
|
|
|
|
|
+ </select>
|
|
|
|
|
+ <select id="selectListByTaskIds" resultMap="BaseResultMapVO">
|
|
|
|
|
+ select
|
|
|
|
|
+ t.id, t.name, t.code, t.plan_time, t.work_load, t.recipient_id,
|
|
|
|
|
+ t.payer, t.payee, t.fee, t.tag_id, t.delay_time, t.state, t.publish_id
|
|
|
|
|
+ u.name publishName,tt.name tag_name,ru.name recipient
|
|
|
|
|
+ from
|
|
|
|
|
+ task t
|
|
|
|
|
+ left join user u
|
|
|
|
|
+ on t.publish_id = u.id
|
|
|
|
|
+ left join task_tags tt
|
|
|
|
|
+ on tt.id = t.tag_id
|
|
|
|
|
+ left join user ru
|
|
|
|
|
+ on t.recipient_id = ru.id
|
|
|
|
|
+ <where>
|
|
|
|
|
+ <foreach collection="list" separator="," close=")" item="item" open="t.id in (" index="index">
|
|
|
|
|
+ #{item}
|
|
|
|
|
+ </foreach>
|
|
|
|
|
+ <if test="taskVO.keyName != null and taskVO.keyName != ''">
|
|
|
|
|
+ and name like concat('%',#{taskVO.keyName},'%')
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="taskVO.startTime != null and taskVO.startTime != ''and taskVO.endTime != null and taskVO.endTime != ''">
|
|
|
|
|
+ and plan_time between #{taskVO.startTime} and #{taskVO.endTime}
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="taskVO.uid != null">
|
|
|
|
|
+ and publish_id =#{taskVO.uid}
|
|
|
|
|
+ </if>
|
|
|
|
|
+ </where>
|
|
|
|
|
+ order by t.id desc
|
|
|
|
|
+ </select>
|
|
|
|
|
+ <resultMap id="PaticaterMapVO" type="com.hssx.pcbms.entity.vo.TaskParticipantsVO">
|
|
|
|
|
+ <id column="id" property="id" />
|
|
|
|
|
+ <result column="user_id" property="userId" />
|
|
|
|
|
+ <result column="task_id" property="taskId" />
|
|
|
|
|
+ <result column="head_pic" property="headPic"/>
|
|
|
|
|
+ <result column="name" property="userName"/>
|
|
|
|
|
+ </resultMap>
|
|
|
|
|
+
|
|
|
|
|
+ <select id="selectPaticaterByTaskId" resultMap="PaticaterMapVO">
|
|
|
|
|
+ select tp.id, tp.user_id, tp.task_id,u.name
|
|
|
|
|
+ from task_participants tp
|
|
|
|
|
+ left join user u
|
|
|
|
|
+ on tp.user_id = u.id
|
|
|
|
|
+ where tp.task_id = #{id}
|
|
|
|
|
+ </select>
|
|
|
|
|
+</mapper>
|