<?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.DepartmentDao" >
|
<resultMap id="BaseResultMap" type="cn.com.basic.face.discern.baseApi.entity.user.Department" >
|
<result column="departmentID" property="departmentid" jdbcType="VARCHAR" />
|
<result column="fatherDepartmentID" property="fatherdepartmentid" jdbcType="VARCHAR" />
|
<result column="departmentName" property="departmentname" jdbcType="VARCHAR" />
|
<result column="nameSpell" property="namespell" jdbcType="CHAR" />
|
<result column="companyID" property="companyid" jdbcType="VARCHAR" />
|
<result column="phone" property="phone" jdbcType="CHAR" />
|
<result column="departmentLable" property="departmentlable" jdbcType="VARCHAR" />
|
<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" >
|
departmentID, fatherDepartmentID, departmentName, nameSpell, companyID, phone, departmentLable,
|
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.DepartmentQuery" >
|
select
|
<if test="distinct" >
|
distinct
|
</if>
|
<include refid="Base_Column_List" />
|
from t_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.DepartmentQuery" >
|
delete from t_department
|
<if test="_parameter != null" >
|
<include refid="Example_Where_Clause" />
|
</if>
|
</delete>
|
<insert id="insert" parameterType="cn.com.basic.face.discern.baseApi.entity.user.Department" >
|
insert into t_department (departmentID, fatherDepartmentID,
|
departmentName, nameSpell, companyID,
|
phone, departmentLable, dataStatus,
|
createTime, creator, updatetime,
|
updator)
|
values (#{departmentid,jdbcType=VARCHAR}, #{fatherdepartmentid,jdbcType=VARCHAR},
|
#{departmentname,jdbcType=VARCHAR}, #{namespell,jdbcType=CHAR}, #{companyid,jdbcType=VARCHAR},
|
#{phone,jdbcType=CHAR}, #{departmentlable,jdbcType=VARCHAR}, #{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.Department" >
|
insert into t_department
|
<trim prefix="(" suffix=")" suffixOverrides="," >
|
<if test="departmentid != null" >
|
departmentID,
|
</if>
|
<if test="fatherdepartmentid != null" >
|
fatherDepartmentID,
|
</if>
|
<if test="departmentname != null" >
|
departmentName,
|
</if>
|
<if test="namespell != null" >
|
nameSpell,
|
</if>
|
<if test="companyid != null" >
|
companyID,
|
</if>
|
<if test="phone != null" >
|
phone,
|
</if>
|
<if test="departmentlable != null" >
|
departmentLable,
|
</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="departmentid != null" >
|
#{departmentid,jdbcType=VARCHAR},
|
</if>
|
<if test="fatherdepartmentid != null" >
|
#{fatherdepartmentid,jdbcType=VARCHAR},
|
</if>
|
<if test="departmentname != null" >
|
#{departmentname,jdbcType=VARCHAR},
|
</if>
|
<if test="namespell != null" >
|
#{namespell,jdbcType=CHAR},
|
</if>
|
<if test="companyid != null" >
|
#{companyid,jdbcType=VARCHAR},
|
</if>
|
<if test="phone != null" >
|
#{phone,jdbcType=CHAR},
|
</if>
|
<if test="departmentlable != null" >
|
#{departmentlable,jdbcType=VARCHAR},
|
</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.DepartmentQuery" resultType="java.lang.Integer" >
|
select count(*) from t_department
|
<if test="_parameter != null" >
|
<include refid="Example_Where_Clause" />
|
</if>
|
</select>
|
<update id="updateByExampleSelective" parameterType="map" >
|
update t_department
|
<set >
|
<if test="record.departmentid != null" >
|
departmentID = #{record.departmentid,jdbcType=VARCHAR},
|
</if>
|
<if test="record.fatherdepartmentid != null" >
|
fatherDepartmentID = #{record.fatherdepartmentid,jdbcType=VARCHAR},
|
</if>
|
<if test="record.departmentname != null" >
|
departmentName = #{record.departmentname,jdbcType=VARCHAR},
|
</if>
|
<if test="record.namespell != null" >
|
nameSpell = #{record.namespell,jdbcType=CHAR},
|
</if>
|
<if test="record.companyid != null" >
|
companyID = #{record.companyid,jdbcType=VARCHAR},
|
</if>
|
<if test="record.phone != null" >
|
phone = #{record.phone,jdbcType=CHAR},
|
</if>
|
<if test="record.departmentlable != null" >
|
departmentLable = #{record.departmentlable,jdbcType=VARCHAR},
|
</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_department
|
set departmentID = #{record.departmentid,jdbcType=VARCHAR},
|
fatherDepartmentID = #{record.fatherdepartmentid,jdbcType=VARCHAR},
|
departmentName = #{record.departmentname,jdbcType=VARCHAR},
|
nameSpell = #{record.namespell,jdbcType=CHAR},
|
companyID = #{record.companyid,jdbcType=VARCHAR},
|
phone = #{record.phone,jdbcType=CHAR},
|
departmentLable = #{record.departmentlable,jdbcType=VARCHAR},
|
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>
|