weaver-hrm-organization/src/com/engine/organization/mapper/extend/ExtendGroupMapper.xml

187 lines
5.6 KiB
XML
Raw Normal View History

2022-05-18 18:06:01 +08:00
<?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">
2022-05-18 18:06:01 +08:00
<result column="id" property="id"/>
<result column="extend_type" property="extendType"/>
<result column="group_name" property="groupName"/>
<result column="show_order" property="showOrder"/>
2022-06-17 11:48:15 +08:00
<result column="is_system_default" property="isSystemDefault"/>
2022-05-18 18:06:01 +08:00
<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
2022-05-18 18:06:01 +08:00
, t.extend_type
, t.group_name
2022-06-17 11:48:15 +08:00
, t.is_system_default
2022-05-18 18:06:01 +08:00
, t.creator
2022-06-17 14:19:52 +08:00
, t.is_show
2022-06-17 10:39:52 +08:00
, t.show_order
2022-05-18 18:06:01 +08:00
, t.delete_type
, t.create_time
, t.update_time
</sql>
<select id="listByType" resultMap="BaseResultMap">
SELECT
<include refid="baseColumns"/>
FROM
jcl_field_extendgroup t
2022-06-17 14:19:52 +08:00
WHERE t.delete_type = 0
2022-05-18 18:06:01 +08:00
<if test=" extendType != null and extendType != '' ">
and extend_type = #{extendType}
</if>
2022-06-17 16:00:05 +08:00
order by show_order
2022-05-18 18:06:01 +08:00
</select>
<select id="getGroupNameById" resultType="java.lang.String">
select group_name
from jcl_field_extendgroup
where id = #{id}
and delete_type = 0
2022-06-17 16:00:05 +08:00
order by show_order
</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>
2022-06-17 16:00:05 +08:00
order by show_order
</select>
<select id="listGroupByPid" resultMap="BaseResultMap">
select
<include refid="baseColumns"/>
from jcl_field_extendgroup t
2022-06-17 16:00:05 +08:00
WHERE t.delete_type = 0
and t.pid= #{pid}
2022-06-17 16:00:05 +08:00
order by show_order
</select>
2022-06-15 18:03:01 +08:00
<select id="getGroupById" resultMap="BaseResultMap">
select
<include refid="baseColumns"/>
from jcl_field_extendgroup t
2022-06-17 16:00:05 +08:00
WHERE t.delete_type = 0
2022-06-15 18:03:01 +08:00
and t.id= #{id}
2022-06-17 16:00:05 +08:00
order by show_order
2022-06-15 18:03:01 +08:00
</select>
2022-05-18 18:06:01 +08:00
2022-06-15 17:17:34 +08:00
<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>
2022-06-17 10:39:52 +08:00
<if test="showOrder != null ">
show_order,
</if>
2022-06-17 11:48:15 +08:00
<if test="isSystemDefault != null ">
is_system_default,
</if>
2022-06-15 17:17:34 +08:00
</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>
2022-06-17 10:39:52 +08:00
<if test="showOrder != null ">
#{showOrder},
</if>
2022-06-17 11:48:15 +08:00
<if test="isSystemDefault != null ">
#{isSystemDefault},
</if>
2022-06-15 17:17:34 +08:00
</trim>
</insert>
2022-06-17 16:00:05 +08:00
<update id="update">
2022-06-15 17:17:34 +08:00
update jcl_field_extendgroup
<set>
group_name=#{name},
</set>
WHERE id = #{id} AND delete_type = 0
</update>
2022-05-18 18:06:01 +08:00
2022-06-17 16:00:05 +08:00
<delete id="delete">
2022-06-16 17:57:03 +08:00
update jcl_field_extendgroup
<set>
delete_type=1,
</set>
WHERE id = #{id} AND delete_type = 0
</delete>
2022-06-17 16:00:05 +08:00
<update id="updateNameAndOrder">
2022-06-16 17:57:03 +08:00
update jcl_field_extendgroup
<set>
group_name=#{groupName},
2022-06-17 14:19:52 +08:00
show_order=#{showOrder},
is_show = #{isShow}
2022-06-16 17:57:03 +08:00
</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>
2022-05-18 18:06:01 +08:00
</mapper>