<?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.cloud.control.dao.TaskUserPendMapper">
|
<resultMap id="BaseResultMap" type="com.cloud.control.model.TaskUserPend">
|
<id column="id" jdbcType="VARCHAR" property="id" />
|
<result column="userId" jdbcType="VARCHAR" property="userId" />
|
<result column="imgUrl" jdbcType="VARCHAR" property="imgUrl" />
|
<result column="createTime" jdbcType="TIMESTAMP" property="createTime" />
|
<result column="createBy" jdbcType="VARCHAR" property="createBy" />
|
<result column="updateTime" jdbcType="TIMESTAMP" property="updateTime" />
|
<result column="updateBy" jdbcType="VARCHAR" property="updateBy" />
|
<result column="delFlag" jdbcType="VARCHAR" property="delFlag" />
|
<result column="userName" jdbcType="VARCHAR" property="userName" />
|
<result column="sex" jdbcType="INTEGER" property="sex" />
|
<result column="mobile" jdbcType="VARCHAR" property="mobile" />
|
<result column="idCard" jdbcType="VARCHAR" property="idCard" />
|
<result column="isControl" jdbcType="VARCHAR" property="isControl" />
|
<result column="dbInfos" jdbcType="VARCHAR" property="dbInfos" />
|
</resultMap>
|
<sql id="Base_Column_List">
|
id, userId, imgUrl, createTime, createBy, updateTime, updateBy, delFlag, userName,
|
sex, mobile, idCard, isControl, dbInfos
|
</sql>
|
<select id="selectByPrimaryKey" parameterType="java.lang.String" resultMap="BaseResultMap">
|
select
|
<include refid="Base_Column_List" />
|
from task_user_pending
|
where id = #{id,jdbcType=VARCHAR}
|
</select>
|
<delete id="deleteByPrimaryKey" parameterType="java.lang.String">
|
delete from task_user_pending
|
where id = #{id,jdbcType=VARCHAR}
|
</delete>
|
<insert id="insert" parameterType="com.cloud.control.model.TaskUserPend">
|
insert into task_user_pending (id, userId, imgUrl,
|
createTime, createBy, updateTime,
|
updateBy, delFlag, userName,
|
sex, mobile, idCard, isControl, dbInfos
|
)
|
values (#{id,jdbcType=VARCHAR}, #{userId,jdbcType=VARCHAR}, #{imgUrl,jdbcType=VARCHAR},
|
#{createTime,jdbcType=TIMESTAMP}, #{createBy,jdbcType=VARCHAR}, #{updateTime,jdbcType=TIMESTAMP},
|
#{updateBy,jdbcType=VARCHAR}, #{delFlag,jdbcType=VARCHAR}, #{userName,jdbcType=VARCHAR},
|
#{sex,jdbcType=INTEGER}, #{mobile,jdbcType=VARCHAR}, #{idCard,jdbcType=VARCHAR}, #{isControl,jdbcType=VARCHAR}, #{dbInfos,jdbcType=VARCHAR}
|
)
|
</insert>
|
<insert id="insertSelective" parameterType="com.cloud.control.model.TaskUserPend">
|
insert into task_user_pending
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
<if test="id != null">
|
id,
|
</if>
|
<if test="userId != null">
|
userId,
|
</if>
|
<if test="imgUrl != null">
|
imgUrl,
|
</if>
|
<if test="createTime != null">
|
createTime,
|
</if>
|
<if test="createBy != null">
|
createBy,
|
</if>
|
<if test="updateTime != null">
|
updateTime,
|
</if>
|
<if test="updateBy != null">
|
updateBy,
|
</if>
|
<if test="delFlag != null">
|
delFlag,
|
</if>
|
<if test="userName != null">
|
userName,
|
</if>
|
<if test="sex != null">
|
sex,
|
</if>
|
<if test="mobile != null">
|
mobile,
|
</if>
|
<if test="idCard != null">
|
idCard,
|
</if>
|
<if test="isControl != null">
|
isControl,
|
</if>
|
<if test="feature != null">
|
feature,
|
</if>
|
<if test="dbInfos != null">
|
dbInfos,
|
</if>
|
</trim>
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
<if test="id != null">
|
#{id,jdbcType=VARCHAR},
|
</if>
|
<if test="userId != null">
|
#{userId,jdbcType=VARCHAR},
|
</if>
|
<if test="imgUrl != null">
|
#{imgUrl,jdbcType=VARCHAR},
|
</if>
|
<if test="createTime != null">
|
#{createTime,jdbcType=TIMESTAMP},
|
</if>
|
<if test="createBy != null">
|
#{createBy,jdbcType=VARCHAR},
|
</if>
|
<if test="updateTime != null">
|
#{updateTime,jdbcType=TIMESTAMP},
|
</if>
|
<if test="updateBy != null">
|
#{updateBy,jdbcType=VARCHAR},
|
</if>
|
<if test="delFlag != null">
|
#{delFlag,jdbcType=VARCHAR},
|
</if>
|
<if test="userName != null">
|
#{userName,jdbcType=VARCHAR},
|
</if>
|
<if test="sex != null">
|
#{sex,jdbcType=INTEGER},
|
</if>
|
<if test="mobile != null">
|
#{mobile,jdbcType=VARCHAR},
|
</if>
|
<if test="idCard != null">
|
#{idCard,jdbcType=VARCHAR},
|
</if>
|
<if test="isControl != null">
|
#{isControl,jdbcType=VARCHAR},
|
</if>
|
<if test="feature != null">
|
#{feature,jdbcType=LONGVARBINARY},
|
</if>
|
<if test="dbInfos != null">
|
#{dbInfos,jdbcType=VARCHAR},
|
</if>
|
</trim>
|
</insert>
|
<update id="updateByPrimaryKeySelective" parameterType="com.cloud.control.model.TaskUserPend">
|
update task_user_pending
|
<set>
|
<if test="userId != null">
|
userId = #{userId,jdbcType=VARCHAR},
|
</if>
|
<if test="imgUrl != null">
|
imgUrl = #{imgUrl,jdbcType=VARCHAR},
|
</if>
|
<if test="createTime != null">
|
createTime = #{createTime,jdbcType=TIMESTAMP},
|
</if>
|
<if test="createBy != null">
|
createBy = #{createBy,jdbcType=VARCHAR},
|
</if>
|
<if test="updateTime != null">
|
updateTime = #{updateTime,jdbcType=TIMESTAMP},
|
</if>
|
<if test="updateBy != null">
|
updateBy = #{updateBy,jdbcType=VARCHAR},
|
</if>
|
<if test="delFlag != null">
|
delFlag = #{delFlag,jdbcType=VARCHAR},
|
</if>
|
<if test="userName != null">
|
userName = #{userName,jdbcType=VARCHAR},
|
</if>
|
<if test="sex != null">
|
sex = #{sex,jdbcType=INTEGER},
|
</if>
|
<if test="mobile != null">
|
mobile = #{mobile,jdbcType=VARCHAR},
|
</if>
|
<if test="idCard != null">
|
idCard = #{idCard,jdbcType=VARCHAR},
|
</if>
|
<if test="isControl != null">
|
isControl = #{isControl,jdbcType=VARCHAR},
|
</if>
|
<if test="dbInfos != null">
|
dbInfos = #{dbInfos,jdbcType=VARCHAR},
|
</if>
|
</set>
|
where id = #{id,jdbcType=VARCHAR}
|
</update>
|
<update id="updateByPrimaryKey" parameterType="com.cloud.control.model.TaskUserPend">
|
update task_user_pending
|
set userId = #{userId,jdbcType=VARCHAR},
|
imgUrl = #{imgUrl,jdbcType=VARCHAR},
|
createTime = #{createTime,jdbcType=TIMESTAMP},
|
createBy = #{createBy,jdbcType=VARCHAR},
|
updateTime = #{updateTime,jdbcType=TIMESTAMP},
|
updateBy = #{updateBy,jdbcType=VARCHAR},
|
delFlag = #{delFlag,jdbcType=VARCHAR},
|
userName = #{userName,jdbcType=VARCHAR},
|
sex = #{sex,jdbcType=INTEGER},
|
mobile = #{mobile,jdbcType=VARCHAR},
|
idCard = #{idCard,jdbcType=VARCHAR},
|
isControl = #{isControl,jdbcType=VARCHAR},
|
dbInfos = #{dbInfos,jdbcType=VARCHAR}
|
where id = #{id,jdbcType=VARCHAR}
|
</update>
|
<select id="select" resultType="map" parameterType="java.util.Map">
|
select u.*,t.name
|
from task_user u left join task t on u.taskId = t.id
|
<where>
|
u.delFlag = '0'
|
<if test=" isControl!=null and isControl!='' ">
|
and u.isControl!=#{isControl}
|
</if>
|
<if test="groupInformation != null and groupInformation != ''">
|
and (u.userName like concat('%', #{groupInformation}, '%') or u.sex like concat('%', #{groupInformation}, '%') or u.idCard like concat('%', #{groupInformation}, '%') or t.name like concat('%',#{groupInformation},'%'))
|
</if>
|
order by
|
<choose>
|
<when test="createTime != null and createTime != '' and createTime == 0">
|
u.createTime asc
|
</when>
|
<when test="createTime != null and createTime != '' and createTime == 1">
|
u.createTime desc
|
</when>
|
<when test="taskId != null and taskId != '' and taskId == 0">
|
convert(t.name using gbk) asc
|
</when>
|
<when test="taskId != null and taskId != '' and taskId == 1">
|
convert(t.name using gbk) desc
|
</when>
|
<when test=" updateBy != null and updateBy != '' and updateBy == 0 ">
|
u.updateBy asc
|
</when>
|
<when test=" updateBy != null and updateBy != '' and updateBy == 1 ">
|
u.updateBy desc
|
</when>
|
<otherwise>
|
u.updateTime desc
|
</otherwise>
|
</choose>
|
<if test="start != null and length != null and length != ''" >
|
LIMIT #{start}, #{length}
|
</if>
|
</where>
|
</select>
|
|
<update id="deleteById" parameterType="String">
|
update task_user_pending
|
set
|
delFlag = '1'
|
where id = #{id,jdbcType=VARCHAR}
|
</update>
|
|
<select id="countTaskPendingUsers" resultType="int" parameterType="java.util.Map">
|
select count(1)
|
from task_user_pending
|
where delFlag = '0'
|
<if test="name !=null and name !=''">
|
and username like concat('%',#{name,jdbcType=VARCHAR},'%')
|
</if>
|
</select>
|
|
<select id="findTaskPendingUsers" resultMap="BaseResultMap" parameterType="java.util.Map">
|
select <include refid="Base_Column_List"/>
|
from task_user_pending
|
<where>
|
delFlag = '0'
|
<if test="name !=null and name !=''">
|
and username like concat('%',#{name,jdbcType=VARCHAR},'%')
|
</if>
|
<choose>
|
<when test="orderBy !=null and orderBy !='' and sortType!=null and sortType !=''">
|
order by #{orderBy} #{sortType}
|
</when>
|
<otherwise>
|
order by createTime desc
|
</otherwise>
|
</choose>
|
<if test="start != null and start != '' and length != null and length != ''" >
|
limit #{start}, #{length}
|
</if>
|
</where>
|
</select>
|
|
<update id="deleteByUser" parameterType="String">
|
update task_user_pending
|
set
|
delFlag = '1'
|
where userId = #{userId,jdbcType=VARCHAR}
|
</update>
|
|
</mapper>
|