You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
weaver-hrm-organization/src/com/engine/organization/mapper/extend/ExtendGroupMapper.xml

164 lines
4.9 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.engine.organization.mapper.extend.ExtendGroupMapper">
<resultMap id="BaseResultMap" type="com.engine.organization.entity.extend.po.ExtendGroupPO">
<result column="id" property="id"/>
<result column="extend_type" property="extendType"/>
<result column="group_name" property="groupName"/>
<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.pid
, t.extend_type
, t.group_name
, t.creator
, t.delete_type
, t.create_time
, t.update_time
</sql>
<select id="listByType" resultMap="BaseResultMap">
SELECT
<include refid="baseColumns"/>
FROM
jcl_field_extendgroup t
WHERE t.delete_type = 0 and t.is_show = 1
<if test=" extendType != null and extendType != '' ">
and extend_type = #{extendType}
</if>
</select>
<select id="getGroupNameById" resultType="java.lang.String">
select group_name
from jcl_field_extendgroup
where id = #{id}
and delete_type = 0
</select>
<select id="listGroupByIds" resultMap="BaseResultMap">
select
<include refid="baseColumns"/>
from jcl_field_extendgroup t
WHERE t.delete_type = 0
AND id IN
<foreach collection="ids" open="(" item="id" separator="," close=")">
#{id}
</foreach>
</select>
<select id="listGroupByPid" resultMap="BaseResultMap">
select
<include refid="baseColumns"/>
from jcl_field_extendgroup t
WHERE t.delete_type = 0 and t.is_show = 1
and t.pid= #{pid}
</select>
<select id="getGroupById" resultMap="BaseResultMap">
select
<include refid="baseColumns"/>
from jcl_field_extendgroup t
WHERE t.delete_type = 0 and t.is_show = 1
and t.id= #{id}
</select>
<insert id="insertIgnoreNull" parameterType="com.engine.organization.entity.extend.po.ExtendGroupPO"
keyProperty="id"
keyColumn="id" useGeneratedKeys="true">
INSERT INTO jcl_field_extendgroup
<trim prefix="(" suffix=")" suffixOverrides=",">
<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>
<if test="extendType != null ">
extend_type,
</if>
<if test="groupName != null ">
group_name,
</if>
<if test="pid != null ">
pid,
</if>
<if test="isShow != null ">
is_show,
</if>
</trim>
<trim prefix="VALUES (" suffix=")" suffixOverrides=",">
<if test="creator != null">
#{creator},
</if>
<if test="deleteType != null">
#{deleteType},
</if>
<if test="createTime != null">
#{createTime},
</if>
<if test="updateTime != null">
#{updateTime},
</if>
<if test="extendType != null ">
#{extendType},
</if>
<if test="groupName != null ">
#{groupName},
</if>
<if test="pid != null ">
#{pid},
</if>
<if test="isShow != null ">
#{isShow},
</if>
</trim>
</insert>
<update id="update" >
update jcl_field_extendgroup
<set>
group_name=#{name},
</set>
WHERE id = #{id} AND delete_type = 0
</update>
<delete id="delete" >
update jcl_field_extendgroup
<set>
delete_type=1,
</set>
WHERE id = #{id} AND delete_type = 0
</delete>
<update id="updateNameAndOrder" >
update jcl_field_extendgroup
<set>
group_name=#{groupName},
show_order=#{showOrder}
</set>
WHERE id = #{id} AND delete_type = 0
</update>
<delete id="batchDelete">
UPDATE jcl_field_extendgroup
SET delete_type = 1
WHERE delete_type = 0
AND id IN
<foreach collection="ids" open="(" item="id" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>