200 lines
8.3 KiB
XML
200 lines
8.3 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="com.cool.store.mapper.SysDepartmentMapper">
|
|
<resultMap id="BaseResultMap" type="com.cool.store.model.entity.SysDepartmentDO">
|
|
<id column="id" jdbcType="VARCHAR" property="id"/>
|
|
<result column="name" jdbcType="VARCHAR" property="name"/>
|
|
<result column="parent_id" jdbcType="VARCHAR" property="parentId"/>
|
|
<result column="depart_order" jdbcType="INTEGER" property="departOrder"/>
|
|
<result column="create_dept_group" jdbcType="BIT" property="createDeptGroup"/>
|
|
<result column="auto_add_user" jdbcType="BIT" property="autoAddUser"/>
|
|
<result column="dep_Hiding" jdbcType="BIT" property="depHiding"/>
|
|
<result column="dept_perimits" jdbcType="VARCHAR" property="deptPerimits"/>
|
|
<result column="user_perimits" jdbcType="VARCHAR" property="userPerimits"/>
|
|
<result column="outer_dept" jdbcType="BIT" property="outerDept"/>
|
|
<result column="outer_permit_depts" jdbcType="VARCHAR" property="outerPermitDepts"/>
|
|
<result column="outer_permit_users" jdbcType="VARCHAR" property="outerPermitUsers"/>
|
|
<result column="org_dept_owner" jdbcType="VARCHAR" property="orgDeptOwner"/>
|
|
<result column="dept_manager_userid_list" jdbcType="VARCHAR" property="deptManagerUseridList"/>
|
|
<result column="user_count" jdbcType="INTEGER" property="userCount"/>
|
|
<result column="unactive_user_count" jdbcType="INTEGER" property="unactiveUserCount"/>
|
|
</resultMap>
|
|
<resultMap extends="BaseResultMap" id="ResultMapWithBLOBs" type="com.cool.store.model.entity.SysDepartmentDO">
|
|
<result column="parent_ids" jdbcType="LONGVARCHAR" property="parentIds"/>
|
|
<result column="sub_ids" jdbcType="LONGVARCHAR" property="subIds"/>
|
|
</resultMap>
|
|
<sql id="Base_Column_List">
|
|
id, name, parent_id, depart_order, create_dept_group, auto_add_user, dep_Hiding,
|
|
dept_perimits, user_perimits, outer_dept, outer_permit_depts, outer_permit_users,
|
|
org_dept_owner, dept_manager_userid_list, user_count, unactive_user_count
|
|
</sql>
|
|
<sql id="Blob_Column_List">
|
|
parent_ids, sub_ids
|
|
</sql>
|
|
<insert id="insertSelective" keyColumn="id" keyProperty="record.id" useGeneratedKeys="true">
|
|
insert into sys_department_${enterpriseId}
|
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
|
<if test="record.name != null">
|
|
name,
|
|
</if>
|
|
<if test="record.parentId != null">
|
|
parent_id,
|
|
</if>
|
|
<if test="record.departOrder != null">
|
|
depart_order,
|
|
</if>
|
|
<if test="record.createDeptGroup != null">
|
|
create_dept_group,
|
|
</if>
|
|
<if test="record.autoAddUser != null">
|
|
auto_add_user,
|
|
</if>
|
|
<if test="record.depHiding != null">
|
|
dep_Hiding,
|
|
</if>
|
|
<if test="record.deptPerimits != null">
|
|
dept_perimits,
|
|
</if>
|
|
<if test="record.userPerimits != null">
|
|
user_perimits,
|
|
</if>
|
|
<if test="record.outerDept != null">
|
|
outer_dept,
|
|
</if>
|
|
<if test="record.outerPermitDepts != null">
|
|
outer_permit_depts,
|
|
</if>
|
|
<if test="record.outerPermitUsers != null">
|
|
outer_permit_users,
|
|
</if>
|
|
<if test="record.orgDeptOwner != null">
|
|
org_dept_owner,
|
|
</if>
|
|
<if test="record.deptManagerUseridList != null">
|
|
dept_manager_userid_list,
|
|
</if>
|
|
<if test="record.userCount != null">
|
|
user_count,
|
|
</if>
|
|
<if test="record.unactiveUserCount != null">
|
|
unactive_user_count,
|
|
</if>
|
|
<if test="record.parentIds != null">
|
|
parent_ids,
|
|
</if>
|
|
<if test="record.subIds != null">
|
|
sub_ids,
|
|
</if>
|
|
</trim>
|
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
<if test="record.name != null">
|
|
#{record.name},
|
|
</if>
|
|
<if test="record.parentId != null">
|
|
#{record.parentId},
|
|
</if>
|
|
<if test="record.departOrder != null">
|
|
#{record.departOrder},
|
|
</if>
|
|
<if test="record.createDeptGroup != null">
|
|
#{record.createDeptGroup},
|
|
</if>
|
|
<if test="record.autoAddUser != null">
|
|
#{record.autoAddUser},
|
|
</if>
|
|
<if test="record.depHiding != null">
|
|
#{record.depHiding},
|
|
</if>
|
|
<if test="record.deptPerimits != null">
|
|
#{record.deptPerimits},
|
|
</if>
|
|
<if test="record.userPerimits != null">
|
|
#{record.userPerimits},
|
|
</if>
|
|
<if test="record.outerDept != null">
|
|
#{record.outerDept},
|
|
</if>
|
|
<if test="record.outerPermitDepts != null">
|
|
#{record.outerPermitDepts},
|
|
</if>
|
|
<if test="record.outerPermitUsers != null">
|
|
#{record.outerPermitUsers},
|
|
</if>
|
|
<if test="record.orgDeptOwner != null">
|
|
#{record.orgDeptOwner},
|
|
</if>
|
|
<if test="record.deptManagerUseridList != null">
|
|
#{record.deptManagerUseridList},
|
|
</if>
|
|
<if test="record.userCount != null">
|
|
#{record.userCount},
|
|
</if>
|
|
<if test="record.unactiveUserCount != null">
|
|
#{record.unactiveUserCount},
|
|
</if>
|
|
<if test="record.parentIds != null">
|
|
#{record.parentIds},
|
|
</if>
|
|
<if test="record.subIds != null">
|
|
#{record.subIds},
|
|
</if>
|
|
</trim>
|
|
</insert>
|
|
<update id="updateByPrimaryKeySelective">
|
|
update sys_department_${enterpriseId}
|
|
<set>
|
|
<if test="record.name != null">
|
|
name = #{record.name},
|
|
</if>
|
|
<if test="record.parentId != null">
|
|
parent_id = #{record.parentId},
|
|
</if>
|
|
<if test="record.departOrder != null">
|
|
depart_order = #{record.departOrder},
|
|
</if>
|
|
<if test="record.createDeptGroup != null">
|
|
create_dept_group = #{record.createDeptGroup},
|
|
</if>
|
|
<if test="record.autoAddUser != null">
|
|
auto_add_user = #{record.autoAddUser},
|
|
</if>
|
|
<if test="record.depHiding != null">
|
|
dep_Hiding = #{record.depHiding},
|
|
</if>
|
|
<if test="record.deptPerimits != null">
|
|
dept_perimits = #{record.deptPerimits},
|
|
</if>
|
|
<if test="record.userPerimits != null">
|
|
user_perimits = #{record.userPerimits},
|
|
</if>
|
|
<if test="record.outerDept != null">
|
|
outer_dept = #{record.outerDept},
|
|
</if>
|
|
<if test="record.outerPermitDepts != null">
|
|
outer_permit_depts = #{record.outerPermitDepts},
|
|
</if>
|
|
<if test="record.outerPermitUsers != null">
|
|
outer_permit_users = #{record.outerPermitUsers},
|
|
</if>
|
|
<if test="record.orgDeptOwner != null">
|
|
org_dept_owner = #{record.orgDeptOwner},
|
|
</if>
|
|
<if test="record.deptManagerUseridList != null">
|
|
dept_manager_userid_list = #{record.deptManagerUseridList},
|
|
</if>
|
|
<if test="record.userCount != null">
|
|
user_count = #{record.userCount},
|
|
</if>
|
|
<if test="record.unactiveUserCount != null">
|
|
unactive_user_count = #{record.unactiveUserCount},
|
|
</if>
|
|
<if test="record.parentIds != null">
|
|
parent_ids = #{record.parentIds},
|
|
</if>
|
|
<if test="record.subIds != null">
|
|
sub_ids = #{record.subIds},
|
|
</if>
|
|
</set>
|
|
where id = #{record.id}
|
|
</update>
|
|
</mapper> |