254 lines
8.2 KiB
XML
254 lines
8.2 KiB
XML
|
<?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="cn.com.tenlion.systemtask.dao.receiveruser.IReceiverUserDao">
|
||
|
|
||
|
<resultMap id="receiverUserDTO" type="cn.com.tenlion.systemtask.pojo.dtos.receiveruser.ReceiverUserDTO">
|
||
|
<result column="receiver_user_id" property="receiverUserId"/>
|
||
|
<result column="distribute_id" property="distributeId"/>
|
||
|
<result column="user_id" property="userId"/>
|
||
|
<result column="is_receive" property="isReceive"/>
|
||
|
<result column="receive_type" property="receiveType"/>
|
||
|
<result column="execute_status" property="executeStatus"/>
|
||
|
<result column="task_score" property="taskScore"/>
|
||
|
</resultMap>
|
||
|
|
||
|
<resultMap id="receiverUserBO" type="cn.com.tenlion.systemtask.pojo.bos.receiveruser.ReceiverUserBO">
|
||
|
<result column="receiver_user_id" property="receiverUserId"/>
|
||
|
<result column="distribute_id" property="distributeId"/>
|
||
|
<result column="user_id" property="userId"/>
|
||
|
<result column="is_receive" property="isReceive"/>
|
||
|
<result column="receive_type" property="receiveType"/>
|
||
|
<result column="execute_status" property="executeStatus"/>
|
||
|
<result column="task_score" property="taskScore"/>
|
||
|
</resultMap>
|
||
|
|
||
|
<resultMap id="receiverUserPO" type="cn.com.tenlion.systemtask.pojo.pos.receiveruser.ReceiverUserPO">
|
||
|
<result column="receiver_user_id" property="receiverUserId"/>
|
||
|
<result column="distribute_id" property="distributeId"/>
|
||
|
<result column="user_id" property="userId"/>
|
||
|
<result column="is_receive" property="isReceive"/>
|
||
|
<result column="receive_type" property="receiveType"/>
|
||
|
<result column="execute_status" property="executeStatus"/>
|
||
|
<result column="task_score" property="taskScore"/>
|
||
|
</resultMap>
|
||
|
|
||
|
<!-- 新增任务接收人 -->
|
||
|
<insert id="save" parameterType="map">
|
||
|
INSERT INTO task_receiver_user(
|
||
|
receiver_user_id,
|
||
|
distribute_id,
|
||
|
user_id,
|
||
|
is_receive,
|
||
|
receive_type,
|
||
|
execute_status,
|
||
|
task_score
|
||
|
) VALUES(
|
||
|
#{receiverUserId},
|
||
|
#{distributeId},
|
||
|
#{userId},
|
||
|
#{isReceive},
|
||
|
#{receiveType},
|
||
|
#{executeStatus},
|
||
|
#{taskScore}
|
||
|
)
|
||
|
</insert>
|
||
|
|
||
|
|
||
|
<!-- 删除任务接收人(物理) -->
|
||
|
<update id="delete" parameterType="map">
|
||
|
DELETE FROM
|
||
|
task_receiver_user
|
||
|
WHERE
|
||
|
receiver_user_id IN
|
||
|
<foreach collection="receiverUserIds" index="index" open="(" separator="," close=")">
|
||
|
#{receiverUserIds[${index}]}
|
||
|
</foreach>
|
||
|
</update>
|
||
|
|
||
|
<!-- 修改任务接收人 -->
|
||
|
<update id="update" parameterType="map">
|
||
|
UPDATE
|
||
|
task_receiver_user
|
||
|
SET
|
||
|
<if test="distributeId != null and distributeId != ''">
|
||
|
distribute_id = #{distributeId},
|
||
|
</if>
|
||
|
<if test="userId != null and userId != ''">
|
||
|
user_id = #{userId},
|
||
|
</if>
|
||
|
<if test="isReceive != null">
|
||
|
is_receive = #{isReceive},
|
||
|
</if>
|
||
|
<if test="receiveType != null and receiveType != ''">
|
||
|
receive_type = #{receiveType},
|
||
|
</if>
|
||
|
<if test="executeStatus != null and executeStatus != ''">
|
||
|
execute_status = #{executeStatus},
|
||
|
</if>
|
||
|
<if test="taskScore != null">
|
||
|
task_score = #{taskScore},
|
||
|
</if>
|
||
|
receiver_user_id = receiver_user_id
|
||
|
WHERE
|
||
|
receiver_user_id = #{receiverUserId}
|
||
|
</update>
|
||
|
|
||
|
<!-- 任务接收人详情 -->
|
||
|
<select id="get" parameterType="map" resultMap="receiverUserDTO">
|
||
|
SELECT
|
||
|
t1.distribute_id,
|
||
|
t1.user_id,
|
||
|
t1.is_receive,
|
||
|
t1.receive_type,
|
||
|
t1.execute_status,
|
||
|
t1.task_score,
|
||
|
t1.receiver_user_id
|
||
|
FROM
|
||
|
task_receiver_user t1
|
||
|
WHERE
|
||
|
1 = 1
|
||
|
<if test="receiverUserId != null and receiverUserId != ''">
|
||
|
AND
|
||
|
t1.receiver_user_id = #{receiverUserId}
|
||
|
</if>
|
||
|
</select>
|
||
|
|
||
|
<!-- 任务接收人详情 -->
|
||
|
<select id="getBO" parameterType="map" resultMap="receiverUserBO">
|
||
|
SELECT
|
||
|
t1.receiver_user_id,
|
||
|
t1.distribute_id,
|
||
|
t1.user_id,
|
||
|
t1.is_receive,
|
||
|
t1.receive_type,
|
||
|
t1.execute_status,
|
||
|
t1.task_score
|
||
|
FROM
|
||
|
task_receiver_user t1
|
||
|
WHERE
|
||
|
1 = 1
|
||
|
<if test="receiverUserId != null and receiverUserId != ''">
|
||
|
AND
|
||
|
t1.receiver_user_id = #{receiverUserId}
|
||
|
</if>
|
||
|
</select>
|
||
|
|
||
|
<!-- 任务接收人详情 -->
|
||
|
<select id="getPO" parameterType="map" resultMap="receiverUserPO">
|
||
|
SELECT
|
||
|
t1.receiver_user_id,
|
||
|
t1.distribute_id,
|
||
|
t1.user_id,
|
||
|
t1.is_receive,
|
||
|
t1.receive_type,
|
||
|
t1.execute_status,
|
||
|
t1.task_score
|
||
|
FROM
|
||
|
task_receiver_user t1
|
||
|
WHERE
|
||
|
1 = 1
|
||
|
<if test="receiverUserId != null and receiverUserId != ''">
|
||
|
AND
|
||
|
t1.receiver_user_id = #{receiverUserId}
|
||
|
</if>
|
||
|
</select>
|
||
|
|
||
|
<!-- 任务接收人列表 -->
|
||
|
<select id="list" parameterType="map" resultMap="receiverUserDTO">
|
||
|
SELECT
|
||
|
t1.receiver_user_id,
|
||
|
t1.distribute_id,
|
||
|
t1.user_id,
|
||
|
t1.is_receive,
|
||
|
t1.receive_type,
|
||
|
t1.execute_status,
|
||
|
t1.task_score,
|
||
|
1
|
||
|
FROM
|
||
|
task_receiver_user t1
|
||
|
WHERE
|
||
|
1 = 1
|
||
|
<if test="keywords != null and keywords != ''">
|
||
|
AND (
|
||
|
<!-- 这里添加其他条件 -->
|
||
|
t1.id LIKE CONCAT('%', #{keywords}, '%')
|
||
|
)
|
||
|
</if>
|
||
|
<if test="receiverUserIds != null and receiverUserIds.size > 0">
|
||
|
AND
|
||
|
t1.receiver_user_id IN
|
||
|
<foreach collection="receiverUserIds" index="index" open="(" separator="," close=")">
|
||
|
#{receiverUserIds[${index}]}
|
||
|
</foreach>
|
||
|
</if>
|
||
|
</select>
|
||
|
|
||
|
<!-- 任务接收人列表 -->
|
||
|
<select id="listBO" parameterType="map" resultMap="receiverUserBO">
|
||
|
SELECT
|
||
|
t1.receiver_user_id,
|
||
|
t1.distribute_id,
|
||
|
t1.user_id,
|
||
|
t1.is_receive,
|
||
|
t1.receive_type,
|
||
|
t1.execute_status,
|
||
|
t1.task_score
|
||
|
FROM
|
||
|
task_receiver_user t1
|
||
|
WHERE
|
||
|
1 = 1
|
||
|
<if test="keywords != null and keywords != ''">
|
||
|
AND (
|
||
|
<!-- 这里添加其他条件 -->
|
||
|
t1.id LIKE CONCAT('%', #{keywords}, '%')
|
||
|
)
|
||
|
</if>
|
||
|
<if test="receiverUserIds != null and receiverUserIds.size > 0">
|
||
|
AND
|
||
|
t1.receiver_user_id IN
|
||
|
<foreach collection="receiverUserIds" index="index" open="(" separator="," close=")">
|
||
|
#{receiverUserIds[${index}]}
|
||
|
</foreach>
|
||
|
</if>
|
||
|
</select>
|
||
|
|
||
|
<!-- 任务接收人列表 -->
|
||
|
<select id="listPO" parameterType="map" resultMap="receiverUserPO">
|
||
|
SELECT
|
||
|
t1.receiver_user_id,
|
||
|
t1.distribute_id,
|
||
|
t1.user_id,
|
||
|
t1.is_receive,
|
||
|
t1.receive_type,
|
||
|
t1.execute_status,
|
||
|
t1.task_score
|
||
|
FROM
|
||
|
task_receiver_user t1
|
||
|
WHERE
|
||
|
1 = 1
|
||
|
<if test="keywords != null and keywords != ''">
|
||
|
AND (
|
||
|
<!-- 这里添加其他条件 -->
|
||
|
t1.id LIKE CONCAT('%', #{keywords}, '%')
|
||
|
)
|
||
|
</if>
|
||
|
<if test="receiverUserIds != null and receiverUserIds.size > 0">
|
||
|
AND
|
||
|
t1.receiver_user_id IN
|
||
|
<foreach collection="receiverUserIds" index="index" open="(" separator="," close=")">
|
||
|
#{receiverUserIds[${index}]}
|
||
|
</foreach>
|
||
|
</if>
|
||
|
</select>
|
||
|
|
||
|
<!-- 任务接收人统计 -->
|
||
|
<select id="count" parameterType="map" resultType="Integer">
|
||
|
SELECT
|
||
|
COUNT(*)
|
||
|
FROM
|
||
|
task_receiver_user t1
|
||
|
WHERE
|
||
|
1 = 1
|
||
|
</select>
|
||
|
|
||
|
</mapper>
|