53 lines
2.0 KiB
XML
53 lines
2.0 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="org.xyzh.study.mapper.TaskUserMapper">
|
||
|
|
|
||
|
|
<!-- 基础结果映射 -->
|
||
|
|
<resultMap id="BaseResultMap" type="org.xyzh.common.dto.study.TbTaskUser">
|
||
|
|
<id column="id" property="id" jdbcType="VARCHAR"/>
|
||
|
|
<result column="task_id" property="taskID" jdbcType="VARCHAR"/>
|
||
|
|
<result column="user_id" property="userID" jdbcType="VARCHAR"/>
|
||
|
|
<result column="dept_id" property="deptID" jdbcType="VARCHAR"/>
|
||
|
|
<result column="status" property="status" jdbcType="INTEGER"/>
|
||
|
|
<result column="progress" property="progress" jdbcType="DECIMAL"/>
|
||
|
|
<result column="complete_time" property="completeTime" jdbcType="TIMESTAMP"/>
|
||
|
|
<result column="creator" property="creator" jdbcType="VARCHAR"/>
|
||
|
|
<result column="create_time" property="createTime" jdbcType="TIMESTAMP"/>
|
||
|
|
<result column="update_time" property="updateTime" jdbcType="TIMESTAMP"/>
|
||
|
|
</resultMap>
|
||
|
|
|
||
|
|
<!-- 基础字段 -->
|
||
|
|
<sql id="Base_Column_List">
|
||
|
|
id, task_id, user_id, dept_id, status, progress, complete_time,
|
||
|
|
creator, create_time, update_time
|
||
|
|
</sql>
|
||
|
|
|
||
|
|
<!-- 通用条件 -->
|
||
|
|
<sql id="Where_Clause">
|
||
|
|
<where>
|
||
|
|
<if test="taskID != null and taskID != ''">
|
||
|
|
AND task_id = #{taskID}
|
||
|
|
</if>
|
||
|
|
<if test="userID != null and userID != ''">
|
||
|
|
AND user_id = #{userID}
|
||
|
|
</if>
|
||
|
|
<if test="deptID != null and deptID != ''">
|
||
|
|
AND dept_id = #{deptID}
|
||
|
|
</if>
|
||
|
|
<if test="status != null">
|
||
|
|
AND status = #{status}
|
||
|
|
</if>
|
||
|
|
</where>
|
||
|
|
</sql>
|
||
|
|
|
||
|
|
<!-- selectTaskUsers -->
|
||
|
|
<select id="selectTaskUsers" resultMap="BaseResultMap">
|
||
|
|
SELECT
|
||
|
|
<include refid="Base_Column_List"/>
|
||
|
|
FROM tb_task_user
|
||
|
|
<include refid="Where_Clause"/>
|
||
|
|
ORDER BY create_time DESC
|
||
|
|
</select>
|
||
|
|
|
||
|
|
</mapper>
|