|
|
|
<?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.engine.organization.mapper.personnelcard.CardAccessMapper">
|
|
|
|
<resultMap id="BaseResultMap" type="com.engine.organization.entity.personnelcard.po.CardAccessPO">
|
|
|
|
<result column="id" property="id"/>
|
|
|
|
<result column="type_id" property="typeId"/>
|
|
|
|
<result column="type_name" property="typeName"/>
|
|
|
|
<result column="status" property="status"/>
|
|
|
|
<result column="all_people" property="allPeople"/>
|
|
|
|
<result column="superior" property="superior"/>
|
|
|
|
<result column="all_superior" property="allSuperior"/>
|
|
|
|
<result column="custom" property="custom"/>
|
|
|
|
<result column="creator" property="creator"/>
|
|
|
|
<result column="delete_type" property="deleteType"/>
|
|
|
|
<result column="create_time" property="createTime"/>
|
|
|
|
<result column="update_time" property="updateTime"/>
|
|
|
|
</resultMap>
|
|
|
|
|
|
|
|
|
|
|
|
<!-- 表字段 -->
|
|
|
|
<sql id="baseColumns">
|
|
|
|
t.id
|
|
|
|
, t.type_id
|
|
|
|
, t.type_name
|
|
|
|
, t.status
|
|
|
|
, t.all_people
|
|
|
|
, t.superior
|
|
|
|
, t.all_superior
|
|
|
|
, t.custom
|
|
|
|
, t.creator
|
|
|
|
, t.delete_type
|
|
|
|
, t.create_time
|
|
|
|
, t.update_time
|
|
|
|
</sql>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<insert id="insertIgnoreNull" parameterType="com.engine.organization.entity.personnelcard.po.CardAccessPO" keyProperty="id"
|
|
|
|
keyColumn="id" useGeneratedKeys="true">
|
|
|
|
INSERT INTO jcl_org_cardaccess
|
|
|
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
|
|
|
<if test="typeId != null ">
|
|
|
|
type_id,
|
|
|
|
</if>
|
|
|
|
<if test="typeName != null ">
|
|
|
|
type_name,
|
|
|
|
</if>
|
|
|
|
<if test="status != null ">
|
|
|
|
status,
|
|
|
|
</if>
|
|
|
|
<if test="allPeople != null ">
|
|
|
|
all_people,
|
|
|
|
</if>
|
|
|
|
<if test="superior != null ">
|
|
|
|
superior,
|
|
|
|
</if>
|
|
|
|
<if test="allSuperior != null ">
|
|
|
|
all_superior,
|
|
|
|
</if>
|
|
|
|
<if test="custom != null">
|
|
|
|
custom,
|
|
|
|
</if>
|
|
|
|
<if test="creator != null">
|
|
|
|
creator,
|
|
|
|
</if>
|
|
|
|
<if test="deleteType != null">
|
|
|
|
delete_type,
|
|
|
|
</if>
|
|
|
|
<if test="createTime != null">
|
|
|
|
create_time,
|
|
|
|
</if>
|
|
|
|
<if test="updateTime != null">
|
|
|
|
update_time,
|
|
|
|
</if>
|
|
|
|
</trim>
|
|
|
|
<trim prefix="VALUES (" suffix=")" suffixOverrides=",">
|
|
|
|
<if test="typeId != null ">
|
|
|
|
#{typeId},
|
|
|
|
</if>
|
|
|
|
<if test="typeName != null ">
|
|
|
|
#{typeName},
|
|
|
|
</if>
|
|
|
|
<if test="status != null ">
|
|
|
|
#{status},
|
|
|
|
</if>
|
|
|
|
<if test="allPeople != null ">
|
|
|
|
#{allPeople},
|
|
|
|
</if>
|
|
|
|
<if test="superior != null ">
|
|
|
|
#{superior},
|
|
|
|
</if>
|
|
|
|
<if test="allSuperior != null ">
|
|
|
|
#{allSuperior},
|
|
|
|
</if>
|
|
|
|
<if test="creator != null">
|
|
|
|
#{creator},
|
|
|
|
</if>
|
|
|
|
<if test="custom != null">
|
|
|
|
#{custom},
|
|
|
|
</if>
|
|
|
|
<if test="deleteType != null">
|
|
|
|
#{deleteType},
|
|
|
|
</if>
|
|
|
|
<if test="createTime != null">
|
|
|
|
#{createTime},
|
|
|
|
</if>
|
|
|
|
<if test="updateTime != null">
|
|
|
|
#{updateTime},
|
|
|
|
</if>
|
|
|
|
</trim>
|
|
|
|
</insert>
|
|
|
|
|
|
|
|
<insert id="insertIgnoreNull" parameterType="com.engine.organization.entity.personnelcard.po.CardAccessPO" databaseId="oracle">
|
|
|
|
<selectKey keyProperty="id" resultType="long" order="AFTER">
|
|
|
|
select JCL_ORG_CARDACCESS_ID.currval from dual
|
|
|
|
</selectKey>
|
|
|
|
INSERT INTO jcl_org_cardaccess
|
|
|
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
|
|
|
<if test="typeId != null ">
|
|
|
|
type_id,
|
|
|
|
</if>
|
|
|
|
<if test="typeName != null ">
|
|
|
|
type_name,
|
|
|
|
</if>
|
|
|
|
<if test="status != null ">
|
|
|
|
status,
|
|
|
|
</if>
|
|
|
|
<if test="allPeople != null ">
|
|
|
|
all_people,
|
|
|
|
</if>
|
|
|
|
<if test="superior != null ">
|
|
|
|
superior,
|
|
|
|
</if>
|
|
|
|
<if test="allSuperior != null ">
|
|
|
|
all_superior,
|
|
|
|
</if>
|
|
|
|
<if test="custom != null">
|
|
|
|
custom,
|
|
|
|
</if>
|
|
|
|
<if test="creator != null">
|
|
|
|
creator,
|
|
|
|
</if>
|
|
|
|
<if test="deleteType != null">
|
|
|
|
delete_type,
|
|
|
|
</if>
|
|
|
|
<if test="createTime != null">
|
|
|
|
create_time,
|
|
|
|
</if>
|
|
|
|
<if test="updateTime != null">
|
|
|
|
update_time,
|
|
|
|
</if>
|
|
|
|
</trim>
|
|
|
|
<trim prefix="VALUES (" suffix=")" suffixOverrides=",">
|
|
|
|
<if test="typeId != null ">
|
|
|
|
#{typeId},
|
|
|
|
</if>
|
|
|
|
<if test="typeName != null ">
|
|
|
|
#{typeName},
|
|
|
|
</if>
|
|
|
|
<if test="status != null ">
|
|
|
|
#{status},
|
|
|
|
</if>
|
|
|
|
<if test="allPeople != null ">
|
|
|
|
#{allPeople},
|
|
|
|
</if>
|
|
|
|
<if test="superior != null ">
|
|
|
|
#{superior},
|
|
|
|
</if>
|
|
|
|
<if test="allSuperior != null ">
|
|
|
|
#{allSuperior},
|
|
|
|
</if>
|
|
|
|
<if test="creator != null">
|
|
|
|
#{creator},
|
|
|
|
</if>
|
|
|
|
<if test="custom != null">
|
|
|
|
#{custom},
|
|
|
|
</if>
|
|
|
|
<if test="deleteType != null">
|
|
|
|
#{deleteType},
|
|
|
|
</if>
|
|
|
|
<if test="createTime != null">
|
|
|
|
#{createTime},
|
|
|
|
</if>
|
|
|
|
<if test="updateTime != null">
|
|
|
|
#{updateTime},
|
|
|
|
</if>
|
|
|
|
</trim>
|
|
|
|
</insert>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<update id="saveCardAccess">
|
|
|
|
<foreach collection="dataList" item="item" index="index" open="" close="" separator=";">
|
|
|
|
update jcl_org_cardaccess
|
|
|
|
<set>
|
|
|
|
<if test="item.status != null">
|
|
|
|
status = #{item.status},
|
|
|
|
</if>
|
|
|
|
<if test="item.allPeople != null">
|
|
|
|
all_people = #{item.allPeople},
|
|
|
|
</if>
|
|
|
|
<if test="item.superior != null">
|
|
|
|
superior = #{item.superior},
|
|
|
|
</if>
|
|
|
|
<if test="item.allSuperior != null">
|
|
|
|
all_superior = #{item.allSuperior},
|
|
|
|
</if>
|
|
|
|
<if test="item.custom != null">
|
|
|
|
custom = #{item.custom},
|
|
|
|
</if>
|
|
|
|
<if test="item.updateTime != null">
|
|
|
|
update_time = #{item.updateTime}
|
|
|
|
</if>
|
|
|
|
</set>
|
|
|
|
where id = #{item.id}
|
|
|
|
</foreach>
|
|
|
|
</update>
|
|
|
|
|
|
|
|
<update id="deleteByIds">
|
|
|
|
UPDATE jcl_org_cardaccess
|
|
|
|
SET delete_type = 1
|
|
|
|
WHERE delete_type = 0
|
|
|
|
AND id IN
|
|
|
|
<foreach collection="ids" open="(" item="id" separator="," close=")">
|
|
|
|
#{id}
|
|
|
|
</foreach>
|
|
|
|
</update>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<select id="selectById" resultMap="BaseResultMap">
|
|
|
|
select
|
|
|
|
<include refid="baseColumns"/>
|
|
|
|
from jcl_org_cardaccess t
|
|
|
|
WHERE delete_type = 0
|
|
|
|
AND id = #{id}
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<update id="updateTabName">
|
|
|
|
UPDATE jcl_org_cardaccess
|
|
|
|
SET type_name = #{name}
|
|
|
|
WHERE id = #{id}
|
|
|
|
</update>
|
|
|
|
</mapper>
|