|
|
|
<?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.sequence.SequenceMapper">
|
|
|
|
<resultMap id="BaseResultMap" type="com.engine.organization.entity.sequence.po.SequencePO">
|
|
|
|
<result column="id" property="id"/>
|
|
|
|
<result column="sequence_no" property="sequenceNo"/>
|
|
|
|
<result column="sequence_name" property="sequenceName"/>
|
|
|
|
<result column="description" property="description"/>
|
|
|
|
<result column="scheme_id" property="schemeId"/>
|
|
|
|
<result column="forbidden_tag" property="forbiddenTag"/>
|
|
|
|
<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.sequence_no
|
|
|
|
, t.sequence_name
|
|
|
|
, t.description
|
|
|
|
, t.scheme_id
|
|
|
|
, t.forbidden_tag
|
|
|
|
, t.creator
|
|
|
|
, t.delete_type
|
|
|
|
, t.create_time
|
|
|
|
, t.update_time
|
|
|
|
</sql>
|
|
|
|
<select id="getSequenceByID" parameterType="com.engine.organization.entity.sequence.po.SequencePO"
|
|
|
|
resultMap="BaseResultMap">
|
|
|
|
select
|
|
|
|
<include refid="baseColumns"/>
|
|
|
|
from jcl_org_sequence t where id = #{id} AND delete_type = 0
|
|
|
|
</select>
|
|
|
|
|
|
|
|
<select id="listByNo" parameterType="com.engine.organization.entity.sequence.po.SequencePO"
|
|
|
|
resultMap="BaseResultMap">
|
|
|
|
select
|
|
|
|
<include refid="baseColumns"/>
|
|
|
|
from jcl_org_sequence t where sequence_no = #{sequenceNo} AND delete_type = 0
|
|
|
|
</select>
|
|
|
|
<select id="getCountByTag" resultType="java.lang.Integer">
|
|
|
|
select count(1) from jcl_org_sequence where 1=1 AND delete_type = 0
|
|
|
|
<if test=" tag != -1 ">
|
|
|
|
and forbidden_tag = #{tag}
|
|
|
|
</if>
|
|
|
|
</select>
|
|
|
|
|
|
|
|
<select id="listSequencesByIds" resultType="java.util.Map">
|
|
|
|
select
|
|
|
|
id,
|
|
|
|
sequence_name as name
|
|
|
|
from jcl_org_sequence t
|
|
|
|
WHERE delete_type = 0
|
|
|
|
AND id IN
|
|
|
|
<foreach collection="ids" open="(" item="id" separator="," close=")">
|
|
|
|
#{id}
|
|
|
|
</foreach>
|
|
|
|
</select>
|
|
|
|
<select id="listUsedId" resultType="java.lang.String">
|
|
|
|
select sequence_id
|
|
|
|
from JCL_ORG_JOB
|
|
|
|
</select>
|
|
|
|
<select id="getSequencesByIds" resultMap="BaseResultMap">
|
|
|
|
select
|
|
|
|
<include refid="baseColumns"/>
|
|
|
|
from jcl_org_sequence t
|
|
|
|
WHERE delete_type = 0
|
|
|
|
AND id IN
|
|
|
|
<foreach collection="ids" open="(" item="id" separator="," close=")">
|
|
|
|
#{id}
|
|
|
|
</foreach>
|
|
|
|
</select>
|
|
|
|
<select id="getSequenceBySchemeId" resultType="com.engine.organization.entity.sequence.po.SequencePO">
|
|
|
|
select
|
|
|
|
<include refid="baseColumns"/>
|
|
|
|
from jcl_org_sequence t where scheme_id = #{schemeId}
|
|
|
|
</select>
|
|
|
|
|
|
|
|
<update id="updateSequence" parameterType="com.engine.organization.entity.sequence.po.SequencePO">
|
|
|
|
update jcl_org_sequence
|
|
|
|
<set>
|
|
|
|
creator=#{creator},
|
|
|
|
update_time=#{updateTime},
|
|
|
|
sequence_no=#{sequenceNo},
|
|
|
|
sequence_name=#{sequenceName},
|
|
|
|
description=#{description},
|
|
|
|
scheme_id=#{schemeId},
|
|
|
|
</set>
|
|
|
|
WHERE id = #{id} AND delete_type = 0
|
|
|
|
</update>
|
|
|
|
|
|
|
|
<insert id="insertIgnoreNull" parameterType="com.engine.organization.entity.sequence.po.SequencePO" keyProperty="id"
|
|
|
|
keyColumn="id" useGeneratedKeys="true">
|
|
|
|
INSERT INTO jcl_org_sequence
|
|
|
|
<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="sequenceNo != null ">
|
|
|
|
sequence_no,
|
|
|
|
</if>
|
|
|
|
<if test="sequenceName != null ">
|
|
|
|
sequence_name,
|
|
|
|
</if>
|
|
|
|
<if test="description != null ">
|
|
|
|
description,
|
|
|
|
</if>
|
|
|
|
<if test="schemeId != null ">
|
|
|
|
scheme_id,
|
|
|
|
</if>
|
|
|
|
forbidden_tag,
|
|
|
|
</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="sequenceNo != null ">
|
|
|
|
#{sequenceNo},
|
|
|
|
</if>
|
|
|
|
<if test="sequenceName != null ">
|
|
|
|
#{sequenceName},
|
|
|
|
</if>
|
|
|
|
<if test="description != null ">
|
|
|
|
#{description},
|
|
|
|
</if>
|
|
|
|
<if test="schemeId != null ">
|
|
|
|
#{schemeId},
|
|
|
|
</if>
|
|
|
|
0,
|
|
|
|
</trim>
|
|
|
|
</insert>
|
|
|
|
|
|
|
|
<update id="updateForbiddenTagById" parameterType="com.engine.organization.entity.sequence.po.SequencePO">
|
|
|
|
update jcl_org_sequence
|
|
|
|
<set>
|
|
|
|
forbidden_tag=#{forbiddenTag},
|
|
|
|
</set>
|
|
|
|
WHERE id = #{id} AND delete_type = 0
|
|
|
|
</update>
|
|
|
|
|
|
|
|
<update id="deleteByIds">
|
|
|
|
UPDATE jcl_org_sequence
|
|
|
|
SET delete_type = 1
|
|
|
|
WHERE delete_type = 0
|
|
|
|
AND id IN
|
|
|
|
<foreach collection="ids" open="(" item="id" separator="," close=")">
|
|
|
|
#{id}
|
|
|
|
</foreach>
|
|
|
|
</update>
|
|
|
|
|
|
|
|
</mapper>
|