658 lines
21 KiB
XML
658 lines
21 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.salary.mapper.salarybill.SalaryTemplateMapper">
|
|
|
|
<resultMap id="BaseResultMap" type="com.engine.salary.entity.salaryBill.po.SalaryTemplatePO">
|
|
<result column="id" property="id"/>
|
|
<result column="name" property="name"/>
|
|
<result column="salary_sob_id" property="salarySobId"/>
|
|
<result column="use_type" property="useType"/>
|
|
<result column="description" property="description"/>
|
|
<result column="email_status" property="emailStatus"/>
|
|
<result column="send_email_id" property="sendEmailId"/>
|
|
<result column="msg_status" property="msgStatus"/>
|
|
<result column="theme" property="theme"/>
|
|
<result column="background" property="background"/>
|
|
<result column="text_content" property="textContent"/>
|
|
<result column="text_content_position" property="textContentPosition"/>
|
|
<result column="salary_item_null_status" property="salaryItemNullStatus"/>
|
|
<result column="salary_item_zero_status" property="salaryItemZeroStatus"/>
|
|
<result column="salary_item_setting" property="salaryItemSetting"/>
|
|
<result column="create_time" property="createTime"/>
|
|
<result column="update_time" property="updateTime"/>
|
|
<result column="creator" property="creator"/>
|
|
<result column="delete_type" property="deleteType"/>
|
|
</resultMap>
|
|
|
|
<!-- 表字段 -->
|
|
<sql id="baseColumns">
|
|
t
|
|
.
|
|
id
|
|
, t.name
|
|
, t.salary_sob_id
|
|
, t.use_type
|
|
, t.description
|
|
, t.email_status
|
|
, t.send_email_id
|
|
, t.msg_status
|
|
, t.theme
|
|
, t.background
|
|
, t.text_content
|
|
, t.text_content_position
|
|
, t.salary_item_null_status
|
|
, t.salary_item_zero_status
|
|
, t.salary_item_setting
|
|
, t.create_time
|
|
, t.update_time
|
|
, t.creator
|
|
, t.delete_type
|
|
</sql>
|
|
<select id="getById" resultType="com.engine.salary.entity.salaryBill.po.SalaryTemplatePO">
|
|
SELECT id,
|
|
name,
|
|
salary_sob_id,
|
|
use_type,
|
|
description,
|
|
email_status,
|
|
send_email_id,
|
|
msg_status,
|
|
theme,
|
|
background,
|
|
text_content,
|
|
text_content_position,
|
|
salary_item_null_status,
|
|
salary_item_zero_status,
|
|
salary_item_setting,
|
|
create_time,
|
|
update_time,
|
|
creator,
|
|
delete_type,
|
|
tenant_key
|
|
FROM hrsa_salary_template
|
|
WHERE delete_type = 0
|
|
AND id = #{id}
|
|
</select>
|
|
|
|
<sql id="salaryTemplateColumn">
|
|
t1
|
|
.
|
|
id
|
|
,
|
|
t1.name,
|
|
t2.name AS salary_sob,
|
|
t1.use_type,
|
|
t1.description
|
|
</sql>
|
|
|
|
<sql id="paramSql">
|
|
<if test="param.ids != null and param.ids.size()>0">
|
|
AND t1.id IN
|
|
<foreach collection="param.ids" open="(" item="id" separator="," close=")">
|
|
#{id}
|
|
</foreach>
|
|
</if>
|
|
<!-- 模板名称 -->
|
|
<if test="param.name != null and param.name != ''">
|
|
AND t1.name like CONCAT('%',#{param.name},'%')
|
|
</if>
|
|
<!-- 薪资账套 -->
|
|
<if test="param.salarySobId != null">
|
|
AND t1.salary_sob_id = #{param.salarySobId}
|
|
</if>
|
|
</sql>
|
|
<sql id="paramSql" databaseId="oracle">
|
|
<if test="param.ids != null and param.ids.size()>0">
|
|
AND t1.id IN
|
|
<foreach collection="param.ids" open="(" item="id" separator="," close=")">
|
|
#{id}
|
|
</foreach>
|
|
</if>
|
|
|
|
<if test="param.name != null and param.name != ''">
|
|
AND t1.name like '%'||#{param.name}||'%'
|
|
</if>
|
|
|
|
<if test="param.salarySobId != null">
|
|
AND t1.salary_sob_id = #{param.salarySobId}
|
|
</if>
|
|
</sql>
|
|
<sql id="paramSql" databaseId="sqlserver">
|
|
<if test="param.ids != null and param.ids.size()>0">
|
|
AND t1.id IN
|
|
<foreach collection="param.ids" open="(" item="id" separator="," close=")">
|
|
#{id}
|
|
</foreach>
|
|
</if>
|
|
|
|
<if test="param.name != null and param.name != ''">
|
|
AND t1.name like '%'+#{param.name}+'%'
|
|
</if>
|
|
|
|
<if test="param.salarySobId != null">
|
|
AND t1.salary_sob_id = #{param.salarySobId}
|
|
</if>
|
|
</sql>
|
|
|
|
<select id="list" resultType="com.engine.salary.entity.salaryBill.dto.SalaryTemplateListDTO">
|
|
SELECT
|
|
<include refid="salaryTemplateColumn"/>
|
|
FROM
|
|
hrsa_salary_template t1
|
|
LEFT JOIN hrsa_salary_sob t2 ON t1.salary_sob_id = t2.id
|
|
WHERE
|
|
t1.delete_type = 0
|
|
AND t2.delete_type = 0
|
|
<include refid="paramSql"/>
|
|
ORDER BY t1.salary_sob_id,t1.id DESC
|
|
</select>
|
|
<select id="list" resultType="com.engine.salary.entity.salaryBill.dto.SalaryTemplateListDTO" databaseId="oracle">
|
|
SELECT
|
|
|
|
t1.id,
|
|
t1.name,
|
|
t2.name AS salary_sob,
|
|
t1.use_type,
|
|
t1.description
|
|
|
|
FROM
|
|
hrsa_salary_template t1
|
|
LEFT JOIN hrsa_salary_sob t2 ON t1.salary_sob_id = t2.id
|
|
WHERE
|
|
t1.delete_type = 0
|
|
AND t2.delete_type = 0
|
|
|
|
<if test="param.ids != null and param.ids.size()>0">
|
|
AND t1.id IN
|
|
<foreach collection="param.ids" open="(" item="id" separator="," close=")">
|
|
#{id}
|
|
</foreach>
|
|
</if>
|
|
|
|
<if test="param.name != null and param.name != ''">
|
|
AND t1.name like '%'||#{param.name}||'%'
|
|
</if>
|
|
|
|
<if test="param.salarySobId != null">
|
|
AND t1.salary_sob_id = #{param.salarySobId}
|
|
</if>
|
|
|
|
ORDER BY t1.salary_sob_id,t1.id DESC
|
|
</select>
|
|
<select id="list" resultType="com.engine.salary.entity.salaryBill.dto.SalaryTemplateListDTO" databaseId="sqlserver">
|
|
SELECT
|
|
|
|
t1.id,
|
|
t1.name,
|
|
t2.name AS salary_sob,
|
|
t1.use_type,
|
|
t1.description
|
|
|
|
FROM
|
|
hrsa_salary_template t1
|
|
LEFT JOIN hrsa_salary_sob t2 ON t1.salary_sob_id = t2.id
|
|
WHERE
|
|
t1.delete_type = 0
|
|
AND t2.delete_type = 0
|
|
|
|
<if test="param.ids != null and param.ids.size()>0">
|
|
AND t1.id IN
|
|
<foreach collection="param.ids" open="(" item="id" separator="," close=")">
|
|
#{id}
|
|
</foreach>
|
|
</if>
|
|
|
|
<if test="param.name != null and param.name != ''">
|
|
AND t1.name like '%'+#{param.name}+'%'
|
|
</if>
|
|
|
|
<if test="param.salarySobId != null">
|
|
AND t1.salary_sob_id = #{param.salarySobId}
|
|
</if>
|
|
|
|
ORDER BY t1.salary_sob_id,t1.id DESC
|
|
</select>
|
|
|
|
<update id="deleteByIds">
|
|
UPDATE hrsa_salary_template
|
|
SET delete_type = 1
|
|
WHERE delete_type = 0
|
|
AND id IN
|
|
<foreach collection="ids" open="(" item="id" separator="," close=")">
|
|
#{id}
|
|
</foreach>
|
|
</update>
|
|
|
|
|
|
<!-- 条件查询 -->
|
|
<select id="listSome" resultMap="BaseResultMap"
|
|
parameterType="com.engine.salary.entity.salaryBill.po.SalaryTemplatePO">
|
|
SELECT
|
|
<include refid="baseColumns"/>
|
|
FROM hrsa_salary_template t
|
|
WHERE delete_type = 0
|
|
<if test="id != null and id != ''">
|
|
AND id = #{id}
|
|
</if>
|
|
<if test="name != null and name != ''">
|
|
AND name = #{name}
|
|
</if>
|
|
<if test="salarySobId != null and salarySobId != ''">
|
|
AND salary_sob_id = #{salarySobId}
|
|
</if>
|
|
<if test="useType != null and useType != ''">
|
|
AND use_type = #{useType}
|
|
</if>
|
|
<if test="description != null and description != ''">
|
|
AND description = #{description}
|
|
</if>
|
|
<if test="emailStatus != null and emailStatus != ''">
|
|
AND email_status = #{emailStatus}
|
|
</if>
|
|
<if test="sendEmailId != null and sendEmailId != ''">
|
|
AND send_email_id = #{sendEmailId}
|
|
</if>
|
|
<if test="msgStatus != null and msgStatus != ''">
|
|
AND msg_status = #{msgStatus}
|
|
</if>
|
|
<if test="theme != null and theme != ''">
|
|
AND theme = #{theme}
|
|
</if>
|
|
<if test="background != null and background != ''">
|
|
AND background = #{background}
|
|
</if>
|
|
<if test="textContent != null and textContent != ''">
|
|
AND text_content = #{textContent}
|
|
</if>
|
|
<if test="textContentPosition != null and textContentPosition != ''">
|
|
AND text_content_position = #{textContentPosition}
|
|
</if>
|
|
<if test="salaryItemNullStatus != null and salaryItemNullStatus != ''">
|
|
AND salary_item_null_status = #{salaryItemNullStatus}
|
|
</if>
|
|
<if test="salaryItemZeroStatus != null and salaryItemZeroStatus != ''">
|
|
AND salary_item_zero_status = #{salaryItemZeroStatus}
|
|
</if>
|
|
|
|
<if test="salaryItemSetting != null and salaryItemSetting != ''">
|
|
AND salary_item_setting = #{salaryItemSetting}
|
|
</if>
|
|
<if test="createTime != null and createTime != ''">
|
|
AND create_time = #{createTime}
|
|
</if>
|
|
<if test="updateTime != null and updateTime != ''">
|
|
AND update_time = #{updateTime}
|
|
</if>
|
|
<if test="creator != null and creator != ''">
|
|
AND creator = #{creator}
|
|
</if>
|
|
<if test="deleteType != null and deleteType != ''">
|
|
AND delete_type = #{deleteType}
|
|
</if>
|
|
ORDER BY id DESC
|
|
</select>
|
|
|
|
<select id="listDefaultTemplates" resultMap="BaseResultMap">
|
|
SELECT
|
|
<include refid="baseColumns"/>
|
|
FROM
|
|
hrsa_salary_template t
|
|
WHERE
|
|
t.delete_type = 0 AND
|
|
t.use_type = 1 AND
|
|
t.salary_sob_id IN
|
|
<if test="ids != null and ids.size() > 0">
|
|
<foreach collection="ids" open="(" item="id" separator="," close=")">
|
|
#{id}
|
|
</foreach>
|
|
</if>
|
|
ORDER BY t.salary_sob_id,t.id DESC
|
|
</select>
|
|
|
|
<!-- 更新不为NULL的字段 -->
|
|
<update id="updateIgnoreNull" parameterType="com.engine.salary.entity.salaryBill.po.SalaryTemplatePO">
|
|
UPDATE hrsa_salary_template
|
|
<set>
|
|
<if test="name != null">
|
|
name=#{name},
|
|
</if>
|
|
<if test="salarySobId != null">
|
|
salary_sob_id=#{salarySobId},
|
|
</if>
|
|
<if test="useType != null">
|
|
use_type=#{useType},
|
|
</if>
|
|
<if test="description != null">
|
|
description=#{description},
|
|
</if>
|
|
<if test="emailStatus != null">
|
|
email_status=#{emailStatus},
|
|
</if>
|
|
<if test="sendEmailId != null">
|
|
send_email_id=#{sendEmailId},
|
|
</if>
|
|
<if test="msgStatus != null">
|
|
msg_status=#{msgStatus},
|
|
</if>
|
|
<if test="theme != null">
|
|
theme=#{theme},
|
|
</if>
|
|
<if test="background != null">
|
|
background=#{background},
|
|
</if>
|
|
<if test="textContent != null">
|
|
text_content=#{textContent},
|
|
</if>
|
|
<if test="textContentPosition != null">
|
|
text_content_position=#{textContentPosition},
|
|
</if>
|
|
<if test="salaryItemNullStatus != null">
|
|
salary_item_null_status=#{salaryItemNullStatus},
|
|
</if>
|
|
<if test="salaryItemSetting != null">
|
|
salary_item_setting=#{salaryItemSetting},
|
|
</if>
|
|
<if test="createTime != null">
|
|
create_time=#{createTime},
|
|
</if>
|
|
<if test="updateTime != null">
|
|
update_time=#{updateTime},
|
|
</if>
|
|
<if test="creator != null">
|
|
creator=#{creator}
|
|
</if>
|
|
</set>
|
|
WHERE id = #{id} AND delete_type = 0
|
|
</update>
|
|
|
|
|
|
<!-- 插入不为NULL的字段 -->
|
|
<insert id="insertIgnoreNull" parameterType="com.engine.salary.entity.salaryBill.po.SalaryTemplatePO"
|
|
keyProperty="id" keyColumn="id" useGeneratedKeys="true"
|
|
>
|
|
INSERT INTO hrsa_salary_template
|
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
|
|
|
<if test="id != null">
|
|
id,
|
|
</if>
|
|
<if test="name != null">
|
|
name,
|
|
</if>
|
|
<if test="salarySobId != null">
|
|
salary_sob_id,
|
|
</if>
|
|
<if test="useType != null">
|
|
use_type,
|
|
</if>
|
|
<if test="description != null">
|
|
description,
|
|
</if>
|
|
<if test="emailStatus != null">
|
|
email_status,
|
|
</if>
|
|
<if test="sendEmailId != null">
|
|
send_email_id,
|
|
</if>
|
|
<if test="msgStatus != null">
|
|
msg_status,
|
|
</if>
|
|
<if test="theme != null">
|
|
theme,
|
|
</if>
|
|
<if test="background != null">
|
|
background,
|
|
</if>
|
|
<if test="textContent != null">
|
|
text_content,
|
|
</if>
|
|
<if test="textContentPosition != null">
|
|
text_content_position,
|
|
</if>
|
|
<if test="salaryItemNullStatus != null">
|
|
salary_item_null_status,
|
|
</if>
|
|
<if test="salaryItemZeroStatus != null">
|
|
salary_item_zero_status,
|
|
</if>
|
|
<if test="salaryItemSetting != null">
|
|
salary_item_setting,
|
|
</if>
|
|
<if test="replenishName != null">
|
|
replenish_name,
|
|
</if>
|
|
<if test="replenishRule != null">
|
|
replenish_rule,
|
|
</if>
|
|
<if test="replenishSalaryItemSetting != null">
|
|
replenish_salary_item_setting,
|
|
</if>
|
|
<if test="createTime != null">
|
|
create_time,
|
|
</if>
|
|
<if test="updateTime != null">
|
|
update_time,
|
|
</if>
|
|
<if test="creator != null">
|
|
creator,
|
|
</if>
|
|
<if test="deleteType != null">
|
|
delete_type,
|
|
</if>
|
|
<if test="tenantKey != null">
|
|
tenant_key,
|
|
</if>
|
|
</trim>
|
|
<trim prefix="VALUES (" suffix=")" suffixOverrides=",">
|
|
<if test="id != null">
|
|
#{id},
|
|
</if>
|
|
<if test="name != null">
|
|
#{name},
|
|
</if>
|
|
<if test="salarySobId != null">
|
|
#{salarySobId},
|
|
</if>
|
|
<if test="useType != null">
|
|
#{useType},
|
|
</if>
|
|
<if test="description != null">
|
|
#{description},
|
|
</if>
|
|
<if test="emailStatus != null">
|
|
#{emailStatus},
|
|
</if>
|
|
<if test="sendEmailId != null">
|
|
#{sendEmailId},
|
|
</if>
|
|
<if test="msgStatus != null">
|
|
#{msgStatus},
|
|
</if>
|
|
<if test="theme != null">
|
|
#{theme},
|
|
</if>
|
|
<if test="background != null">
|
|
#{background},
|
|
</if>
|
|
<if test="textContent != null">
|
|
#{textContent},
|
|
</if>
|
|
<if test="textContentPosition != null">
|
|
#{textContentPosition},
|
|
</if>
|
|
<if test="salaryItemNullStatus != null">
|
|
#{salaryItemNullStatus},
|
|
</if>
|
|
<if test="salaryItemZeroStatus != null">
|
|
#{salaryItemZeroStatus},
|
|
</if>
|
|
<if test="salaryItemSetting != null">
|
|
#{salaryItemSetting},
|
|
</if>
|
|
<if test="createTime != null">
|
|
#{createTime},
|
|
</if>
|
|
<if test="updateTime != null">
|
|
#{updateTime},
|
|
</if>
|
|
<if test="creator != null">
|
|
#{creator},
|
|
</if>
|
|
<if test="deleteType != null">
|
|
#{deleteType},
|
|
</if>
|
|
<if test="tenantKey != null">
|
|
#{tenantKey},
|
|
</if>
|
|
</trim>
|
|
</insert>
|
|
|
|
<insert id="insertIgnoreNull" parameterType="com.engine.salary.entity.salaryBill.po.SalaryTemplatePO"
|
|
databaseId="oracle"
|
|
>
|
|
<selectKey keyProperty="id" resultType="long" order="AFTER">
|
|
select hrsa_salary_template_id.currval from dual
|
|
</selectKey>
|
|
INSERT INTO hrsa_salary_template
|
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
|
|
|
<if test="id != null">
|
|
id,
|
|
</if>
|
|
<if test="name != null">
|
|
name,
|
|
</if>
|
|
<if test="salarySobId != null">
|
|
salary_sob_id,
|
|
</if>
|
|
<if test="useType != null">
|
|
use_type,
|
|
</if>
|
|
<if test="description != null">
|
|
description,
|
|
</if>
|
|
<if test="emailStatus != null">
|
|
email_status,
|
|
</if>
|
|
<if test="sendEmailId != null">
|
|
send_email_id,
|
|
</if>
|
|
<if test="msgStatus != null">
|
|
msg_status,
|
|
</if>
|
|
<if test="theme != null">
|
|
theme,
|
|
</if>
|
|
<if test="background != null">
|
|
background,
|
|
</if>
|
|
<if test="textContent != null">
|
|
text_content,
|
|
</if>
|
|
<if test="textContentPosition != null">
|
|
text_content_position,
|
|
</if>
|
|
<if test="salaryItemNullStatus != null">
|
|
salary_item_null_status,
|
|
</if>
|
|
<if test="salaryItemZeroStatus != null">
|
|
salary_item_zero_status,
|
|
</if>
|
|
<if test="salaryItemSetting != null">
|
|
salary_item_setting,
|
|
</if>
|
|
<if test="createTime != null">
|
|
create_time,
|
|
</if>
|
|
<if test="updateTime != null">
|
|
update_time,
|
|
</if>
|
|
<if test="creator != null">
|
|
creator,
|
|
</if>
|
|
<if test="deleteType != null">
|
|
delete_type,
|
|
</if>
|
|
<if test="tenantKey != null">
|
|
tenant_key,
|
|
</if>
|
|
</trim>
|
|
<trim prefix="VALUES (" suffix=")" suffixOverrides=",">
|
|
<if test="id != null">
|
|
#{id},
|
|
</if>
|
|
<if test="name != null">
|
|
#{name},
|
|
</if>
|
|
<if test="salarySobId != null">
|
|
#{salarySobId},
|
|
</if>
|
|
<if test="useType != null">
|
|
#{useType},
|
|
</if>
|
|
<if test="description != null">
|
|
#{description},
|
|
</if>
|
|
<if test="emailStatus != null">
|
|
#{emailStatus},
|
|
</if>
|
|
<if test="sendEmailId != null">
|
|
#{sendEmailId},
|
|
</if>
|
|
<if test="msgStatus != null">
|
|
#{msgStatus},
|
|
</if>
|
|
<if test="theme != null">
|
|
#{theme},
|
|
</if>
|
|
<if test="background != null">
|
|
#{background},
|
|
</if>
|
|
<if test="textContent != null">
|
|
#{textContent},
|
|
</if>
|
|
<if test="textContentPosition != null">
|
|
#{textContentPosition},
|
|
</if>
|
|
<if test="salaryItemNullStatus != null">
|
|
#{salaryItemNullStatus},
|
|
</if>
|
|
<if test="salaryItemZeroStatus != null">
|
|
#{salaryItemZeroStatus},
|
|
</if>
|
|
<if test="salaryItemSetting != null">
|
|
#{salaryItemSetting},
|
|
</if>
|
|
<if test="createTime != null">
|
|
#{createTime},
|
|
</if>
|
|
<if test="updateTime != null">
|
|
#{updateTime},
|
|
</if>
|
|
<if test="creator != null">
|
|
#{creator},
|
|
</if>
|
|
<if test="deleteType != null">
|
|
#{deleteType},
|
|
</if>
|
|
<if test="tenantKey != null">
|
|
#{tenantKey},
|
|
</if>
|
|
</trim>
|
|
</insert>
|
|
|
|
|
|
<!-- 更新不为NULL的字段 -->
|
|
<update id="updateUsetypeBySalarySobId" parameterType="com.engine.salary.entity.salaryBill.po.SalaryTemplatePO">
|
|
UPDATE hrsa_salary_template
|
|
<set>
|
|
<if test="useType != null">
|
|
use_type=#{useType}
|
|
</if>
|
|
</set>
|
|
WHERE salary_sob_id=#{salarySobId} AND delete_type = 0
|
|
</update>
|
|
|
|
|
|
</mapper>
|