<?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.basic.face.discern.baseApi.mapper.user.UserDepartmentDao" >
|
<resultMap id="BaseResultMap" type="cn.com.basic.face.discern.baseApi.entity.user.UserDepartment" >
|
<result column="userID" property="userid" jdbcType="VARCHAR" />
|
<result column="departmentID" property="departmentid" jdbcType="VARCHAR" />
|
<result column="post" property="post" jdbcType="VARCHAR" />
|
<result column="mobilePhone" property="mobilephone" jdbcType="CHAR" />
|
<result column="phone" property="phone" jdbcType="CHAR" />
|
<result column="companyID" property="companyid" jdbcType="VARCHAR" />
|
<result column="resign" property="resign" jdbcType="BIT" />
|
<result column="dataStatus" property="datastatus" jdbcType="TINYINT" />
|
<result column="createTime" property="createtime" jdbcType="TIMESTAMP" />
|
<result column="creator" property="creator" jdbcType="VARCHAR" />
|
<result column="updatetime" property="updatetime" jdbcType="TIMESTAMP" />
|
<result column="updator" property="updator" jdbcType="VARCHAR" />
|
</resultMap>
|
<sql id="Example_Where_Clause" >
|
<where >
|
<foreach collection="oredCriteria" item="criteria" separator="or" >
|
<if test="criteria.valid" >
|
<trim prefix="(" suffix=")" prefixOverrides="and" >
|
<foreach collection="criteria.criteria" item="criterion" >
|
<choose >
|
<when test="criterion.noValue" >
|
and ${criterion.condition}
|
</when>
|
<when test="criterion.singleValue" >
|
and ${criterion.condition} #{criterion.value}
|
</when>
|
<when test="criterion.betweenValue" >
|
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
|
</when>
|
<when test="criterion.listValue" >
|
and ${criterion.condition}
|
<foreach collection="criterion.value" item="listItem" open="(" close=")" separator="," >
|
#{listItem}
|
</foreach>
|
</when>
|
</choose>
|
</foreach>
|
</trim>
|
</if>
|
</foreach>
|
</where>
|
</sql>
|
<sql id="Update_By_Example_Where_Clause" >
|
<where >
|
<foreach collection="example.oredCriteria" item="criteria" separator="or" >
|
<if test="criteria.valid" >
|
<trim prefix="(" suffix=")" prefixOverrides="and" >
|
<foreach collection="criteria.criteria" item="criterion" >
|
<choose >
|
<when test="criterion.noValue" >
|
and ${criterion.condition}
|
</when>
|
<when test="criterion.singleValue" >
|
and ${criterion.condition} #{criterion.value}
|
</when>
|
<when test="criterion.betweenValue" >
|
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
|
</when>
|
<when test="criterion.listValue" >
|
and ${criterion.condition}
|
<foreach collection="criterion.value" item="listItem" open="(" close=")" separator="," >
|
#{listItem}
|
</foreach>
|
</when>
|
</choose>
|
</foreach>
|
</trim>
|
</if>
|
</foreach>
|
</where>
|
</sql>
|
<sql id="Base_Column_List" >
|
<if test="fields == null" >
|
userID, departmentID, post, mobilePhone, phone, companyID, resign, dataStatus, createTime,
|
creator, updatetime, updator
|
</if>
|
<if test="fields != null" >
|
${fields}
|
</if>
|
</sql>
|
<select id="selectByExample" resultMap="BaseResultMap" parameterType="cn.com.basic.face.discern.baseApi.entity.user.UserDepartmentQuery" >
|
select
|
<if test="distinct" >
|
distinct
|
</if>
|
<include refid="Base_Column_List" />
|
from t_user_department
|
<if test="_parameter != null" >
|
<include refid="Example_Where_Clause" />
|
</if>
|
<if test="orderByClause != null" >
|
order by ${orderByClause}
|
</if>
|
<if test="startRow != null" >
|
limit #{startRow} , #{pageSize}
|
</if>
|
</select>
|
<delete id="deleteByExample" parameterType="cn.com.basic.face.discern.baseApi.entity.user.UserDepartmentQuery" >
|
delete from t_user_department
|
<if test="_parameter != null" >
|
<include refid="Example_Where_Clause" />
|
</if>
|
</delete>
|
<insert id="insert" parameterType="cn.com.basic.face.discern.baseApi.entity.user.UserDepartment" >
|
insert into t_user_department (userID, departmentID, post,
|
mobilePhone, phone, companyID,
|
resign, dataStatus, createTime,
|
creator, updatetime, updator
|
)
|
values (#{userid,jdbcType=VARCHAR}, #{departmentid,jdbcType=VARCHAR}, #{post,jdbcType=VARCHAR},
|
#{mobilephone,jdbcType=CHAR}, #{phone,jdbcType=CHAR}, #{companyid,jdbcType=VARCHAR},
|
#{resign,jdbcType=BIT}, #{datastatus,jdbcType=TINYINT}, #{createtime,jdbcType=TIMESTAMP},
|
#{creator,jdbcType=VARCHAR}, #{updatetime,jdbcType=TIMESTAMP}, #{updator,jdbcType=VARCHAR}
|
)
|
</insert>
|
<insert id="insertSelective" parameterType="cn.com.basic.face.discern.baseApi.entity.user.UserDepartment" >
|
insert into t_user_department
|
<trim prefix="(" suffix=")" suffixOverrides="," >
|
<if test="userid != null" >
|
userID,
|
</if>
|
<if test="departmentid != null" >
|
departmentID,
|
</if>
|
<if test="post != null" >
|
post,
|
</if>
|
<if test="mobilephone != null" >
|
mobilePhone,
|
</if>
|
<if test="phone != null" >
|
phone,
|
</if>
|
<if test="companyid != null" >
|
companyID,
|
</if>
|
<if test="resign != null" >
|
resign,
|
</if>
|
<if test="datastatus != null" >
|
dataStatus,
|
</if>
|
<if test="createtime != null" >
|
createTime,
|
</if>
|
<if test="creator != null" >
|
creator,
|
</if>
|
<if test="updatetime != null" >
|
updatetime,
|
</if>
|
<if test="updator != null" >
|
updator,
|
</if>
|
</trim>
|
<trim prefix="values (" suffix=")" suffixOverrides="," >
|
<if test="userid != null" >
|
#{userid,jdbcType=VARCHAR},
|
</if>
|
<if test="departmentid != null" >
|
#{departmentid,jdbcType=VARCHAR},
|
</if>
|
<if test="post != null" >
|
#{post,jdbcType=VARCHAR},
|
</if>
|
<if test="mobilephone != null" >
|
#{mobilephone,jdbcType=CHAR},
|
</if>
|
<if test="phone != null" >
|
#{phone,jdbcType=CHAR},
|
</if>
|
<if test="companyid != null" >
|
#{companyid,jdbcType=VARCHAR},
|
</if>
|
<if test="resign != null" >
|
#{resign,jdbcType=BIT},
|
</if>
|
<if test="datastatus != null" >
|
#{datastatus,jdbcType=TINYINT},
|
</if>
|
<if test="createtime != null" >
|
#{createtime,jdbcType=TIMESTAMP},
|
</if>
|
<if test="creator != null" >
|
#{creator,jdbcType=VARCHAR},
|
</if>
|
<if test="updatetime != null" >
|
#{updatetime,jdbcType=TIMESTAMP},
|
</if>
|
<if test="updator != null" >
|
#{updator,jdbcType=VARCHAR},
|
</if>
|
</trim>
|
</insert>
|
<select id="countByExample" parameterType="cn.com.basic.face.discern.baseApi.entity.user.UserDepartmentQuery" resultType="java.lang.Integer" >
|
select count(*) from t_user_department
|
<if test="_parameter != null" >
|
<include refid="Example_Where_Clause" />
|
</if>
|
</select>
|
<update id="updateByExampleSelective" parameterType="map" >
|
update t_user_department
|
<set >
|
<if test="record.userid != null" >
|
userID = #{record.userid,jdbcType=VARCHAR},
|
</if>
|
<if test="record.departmentid != null" >
|
departmentID = #{record.departmentid,jdbcType=VARCHAR},
|
</if>
|
<if test="record.post != null" >
|
post = #{record.post,jdbcType=VARCHAR},
|
</if>
|
<if test="record.mobilephone != null" >
|
mobilePhone = #{record.mobilephone,jdbcType=CHAR},
|
</if>
|
<if test="record.phone != null" >
|
phone = #{record.phone,jdbcType=CHAR},
|
</if>
|
<if test="record.companyid != null" >
|
companyID = #{record.companyid,jdbcType=VARCHAR},
|
</if>
|
<if test="record.resign != null" >
|
resign = #{record.resign,jdbcType=BIT},
|
</if>
|
<if test="record.datastatus != null" >
|
dataStatus = #{record.datastatus,jdbcType=TINYINT},
|
</if>
|
<if test="record.createtime != null" >
|
createTime = #{record.createtime,jdbcType=TIMESTAMP},
|
</if>
|
<if test="record.creator != null" >
|
creator = #{record.creator,jdbcType=VARCHAR},
|
</if>
|
<if test="record.updatetime != null" >
|
updatetime = #{record.updatetime,jdbcType=TIMESTAMP},
|
</if>
|
<if test="record.updator != null" >
|
updator = #{record.updator,jdbcType=VARCHAR},
|
</if>
|
</set>
|
<if test="_parameter != null" >
|
<include refid="Update_By_Example_Where_Clause" />
|
</if>
|
</update>
|
<update id="updateByExample" parameterType="map" >
|
update t_user_department
|
set userID = #{record.userid,jdbcType=VARCHAR},
|
departmentID = #{record.departmentid,jdbcType=VARCHAR},
|
post = #{record.post,jdbcType=VARCHAR},
|
mobilePhone = #{record.mobilephone,jdbcType=CHAR},
|
phone = #{record.phone,jdbcType=CHAR},
|
companyID = #{record.companyid,jdbcType=VARCHAR},
|
resign = #{record.resign,jdbcType=BIT},
|
dataStatus = #{record.datastatus,jdbcType=TINYINT},
|
createTime = #{record.createtime,jdbcType=TIMESTAMP},
|
creator = #{record.creator,jdbcType=VARCHAR},
|
updatetime = #{record.updatetime,jdbcType=TIMESTAMP},
|
updator = #{record.updator,jdbcType=VARCHAR}
|
<if test="_parameter != null" >
|
<include refid="Update_By_Example_Where_Clause" />
|
</if>
|
</update>
|
</mapper>
|