weaver-hrm-salary/src/com/engine/salary/mapper/report/salaryStatisticsPushDetailM...

319 lines
10 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.report.salaryStatisticsPushDetailMapper">
<resultMap id="BaseResultMap" type="com.engine.salary.report.entity.po.SalaryStatisticsPushDetailPO">
<result column="id" property="id" />
<result column="create_time" property="createTime" />
<result column="update_time" property="updateTime" />
<result column="creator" property="creator" />
<result column="delete_type" property="deleteType" />
<result column="tenant_key" property="tenantKey" />
<result column="msg_id" property="msgId" />
<result column="employee_id" property="employeeId" />
<result column="push_time" property="pushTime" />
<result column="push_status" property="pushStatus" />
<result column="reback_time" property="rebackTime" />
<result column="reback_status" property="rebackStatus" />
<result column="batch_id" property="batchId" />
<result column="view_status" property="viewStatus" />
</resultMap>
<!-- 表字段 -->
<sql id="baseColumns">
t.id
, t.create_time
, t.update_time
, t.creator
, t.delete_type
, t.tenant_key
, t.msg_id
, t.employee_id
, t.push_time
, t.push_status
, t.reback_time
, t.reback_status
, t.batch_id
, t.view_status
</sql>
<!-- 查询全部 -->
<select id="listAll" resultMap="BaseResultMap">
SELECT
<include refid="baseColumns" />
FROM hrsa_report_push_detail t
WHERE delete_type = 0
</select>
<!-- 根据主键获取单条记录 -->
<select id="getById" resultMap="BaseResultMap" parameterType="Long">
SELECT
<include refid="baseColumns" />
FROM hrsa_report_push_detail t
WHERE id = #{id} AND delete_type = 0
</select>
<!-- 条件查询 -->
<select id="listSome" resultMap="BaseResultMap" parameterType="com.engine.salary.report.entity.po.SalaryStatisticsPushDetailPO">
SELECT
<include refid="baseColumns" />
FROM hrsa_report_push_detail t
WHERE delete_type = 0
<if test="id != null">
AND id = #{id}
</if>
<if test="createTime != null">
AND create_time = #{createTime}
</if>
<if test="updateTime != null">
AND update_time = #{updateTime}
</if>
<if test="creator != null">
AND creator = #{creator}
</if>
<if test="deleteType != null">
AND delete_type = #{deleteType}
</if>
<if test="tenantKey != null">
AND tenant_key = #{tenantKey}
</if>
<if test="msgId != null">
AND msg_id = #{msgId}
</if>
<if test="employeeId != null">
AND employee_id = #{employeeId}
</if>
<if test="pushTime != null">
AND push_time = #{pushTime}
</if>
<if test="pushStatus != null">
AND push_status = #{pushStatus}
</if>
<if test="rebackTime != null">
AND reback_time = #{rebackTime}
</if>
<if test="rebackStatus != null">
AND reback_status = #{rebackStatus}
</if>
<if test="batchId != null">
AND batch_id = #{batchId}
</if>
<if test="viewStatus != null">
AND view_status = #{viewStatus}
</if>
<if test="ids != null and ids.size()>0">
AND id IN
<foreach collection="ids" open="(" item="id" separator="," close=")">
#{id}
</foreach>
</if>
ORDER BY id DESC
</select>
<select id="queryPushDetailPOByBatchId"
resultType="com.engine.salary.report.entity.po.SalaryStatisticsPushDetailPO">
SELECT
<include refid="baseColumns" />
FROM hrsa_report_push_detail t
WHERE delete_type = 0
<if test="batchIds != null and batchIds.size()>0">
AND batch_id IN
<foreach collection="batchIds" open="(" item="batchId" separator="," close=")">
#{batchId}
</foreach>
</if>
</select>
<select id="queryPushDetailPOByBatchIdAndEmpIds"
resultType="com.engine.salary.report.entity.po.SalaryStatisticsPushDetailPO">
SELECT
<include refid="baseColumns" />
FROM hrsa_report_push_detail t
WHERE delete_type = 0
AND batch_id = #{batchId}
<if test="empIds != null and empIds.size()>0">
AND employee_id IN
<foreach collection="empIds" open="(" item="empId" separator="," close=")">
#{empId}
</foreach>
</if>
</select>
<!-- 插入不为NULL的字段 -->
<insert id="insertIgnoreNull" parameterType="com.engine.salary.report.entity.po.SalaryStatisticsPushDetailPO">
INSERT INTO hrsa_report_push_detail
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">
id,
</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>
<if test="msgId != null">
msg_id,
</if>
<if test="employeeId != null">
employee_id,
</if>
<if test="pushTime != null">
push_time,
</if>
<if test="pushStatus != null">
push_status,
</if>
<if test="rebackTime != null">
reback_time,
</if>
<if test="rebackStatus != null">
reback_status,
</if>
<if test="batchId != null">
batch_id,
</if>
<if test="viewStatus != null">
view_status,
</if>
</trim>
<trim prefix="VALUES (" suffix=")" suffixOverrides=",">
<if test="id != null" >
#{id},
</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>
<if test="msgId != null" >
#{msgId},
</if>
<if test="employeeId != null" >
#{employeeId},
</if>
<if test="pushTime != null" >
#{pushTime},
</if>
<if test="pushStatus != null" >
#{pushStatus},
</if>
<if test="rebackTime != null" >
#{rebackTime},
</if>
<if test="rebackStatus != null" >
#{rebackStatus},
</if>
<if test="batchId != null" >
#{batchId},
</if>
<if test="viewStatus != null" >
#{viewStatus},
</if>
</trim>
</insert>
<!-- 更新,更新全部字段 -->
<update id="update" parameterType="com.engine.salary.report.entity.po.SalaryStatisticsPushDetailPO">
UPDATE hrsa_report_push_detail
<set>
create_time=#{createTime},
update_time=#{updateTime},
creator=#{creator},
delete_type=#{deleteType},
tenant_key=#{tenantKey},
msg_id=#{msgId},
employee_id=#{employeeId},
push_time=#{pushTime},
push_status=#{pushStatus},
reback_time=#{rebackTime},
reback_status=#{rebackStatus},
batch_id=#{batchId},
view_status=#{viewStatus},
</set>
WHERE id = #{id} AND delete_type = 0
</update>
<!-- 更新不为NULL的字段 -->
<update id="updateIgnoreNull" parameterType="com.engine.salary.report.entity.po.SalaryStatisticsPushDetailPO">
UPDATE hrsa_report_push_detail
<set>
<if test="createTime != null" >
create_time=#{createTime},
</if>
<if test="updateTime != null" >
update_time=#{updateTime},
</if>
<if test="creator != null" >
creator=#{creator},
</if>
<if test="deleteType != null" >
delete_type=#{deleteType},
</if>
<if test="tenantKey != null" >
tenant_key=#{tenantKey},
</if>
<if test="msgId != null" >
msg_id=#{msgId},
</if>
<if test="employeeId != null" >
employee_id=#{employeeId},
</if>
<if test="pushTime != null" >
push_time=#{pushTime},
</if>
<if test="pushStatus != null" >
push_status=#{pushStatus},
</if>
<if test="rebackTime != null" >
<if test="rebackTime == ''">
reback_time = null,
</if>
<if test="rebackTime != ''">
reback_time=#{rebackTime},
</if>
</if>
<if test="rebackStatus != null" >
reback_status=#{rebackStatus},
</if>
<if test="batchId != null" >
batch_id=#{batchId},
</if>
<if test="viewStatus != null" >
view_status=#{viewStatus},
</if>
</set>
WHERE id = #{id} AND delete_type = 0
</update>
<!-- 根据主键删除记录 -->
<delete id="delete" parameterType="com.engine.salary.report.entity.po.SalaryStatisticsPushDetailPO">
UPDATE hrsa_report_push_detail
SET delete_type=1
WHERE id = #{id} AND delete_type = 0
</delete>
</mapper>