204 lines
5.9 KiB
XML
204 lines
5.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.salary.mapper.siaccount.InsuranceAccountBatchMapper">
|
|
<resultMap id="BaseResultMap" type="com.engine.salary.entity.siaccount.po.InsuranceAccountBatchPO">
|
|
<result column="id" property="id"/>
|
|
<result column="bill_month" property="billMonth"/>
|
|
<result column="bill_status" property="billStatus"/>
|
|
<result column="social_num" property="socialNum"/>
|
|
<result column="fund_num" property="fundNum"/>
|
|
<result column="other_num" property="otherNum"/>
|
|
<result column="social_pay" property="socialPay"/>
|
|
<result column="fund_pay" property="fundPay"/>
|
|
<result column="other_pay" property="otherPay"/>
|
|
<result column="accountant" property="accountant"/>
|
|
<result column="remarks" property="remarks"/>
|
|
<result column="creator" property="creator"/>
|
|
<result column="delete_type" property="deleteType"/>
|
|
<result column="create_time" property="createTime"/>
|
|
<result column="update_time" property="updateTime"/>
|
|
<result column="tenant_key" property="tenantKey"/>
|
|
</resultMap>
|
|
|
|
<!-- 表字段 -->
|
|
<sql id="baseColumns">
|
|
t.id
|
|
, t.bill_month
|
|
, t.bill_status
|
|
, t.social_num
|
|
, t.fund_num
|
|
, t.other_num
|
|
, t.social_pay
|
|
, t.fund_pay
|
|
, t.other_pay
|
|
, t.accountant
|
|
, t.remarks
|
|
, t.creator
|
|
, t.delete_type
|
|
, t.create_time
|
|
, t.update_time
|
|
, t.tenant_key
|
|
</sql>
|
|
|
|
<insert id="insert" parameterType="com.engine.salary.entity.siaccount.po.InsuranceAccountBatchPO"
|
|
keyProperty="id" keyColumn="id" useGeneratedKeys="true"
|
|
>
|
|
INSERT INTO hrsa_bill_batch
|
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
|
bill_month,
|
|
bill_status,
|
|
social_num,
|
|
fund_num,
|
|
other_num,
|
|
social_pay,
|
|
fund_pay,
|
|
other_pay,
|
|
accountant,
|
|
remarks,
|
|
creator,
|
|
delete_type,
|
|
create_time,
|
|
update_time,
|
|
tenant_key,
|
|
</trim>
|
|
<trim prefix="VALUES (" suffix=")" suffixOverrides=",">
|
|
#{billMonth},
|
|
#{billStatus},
|
|
#{socialNum},
|
|
#{fundNum},
|
|
#{otherNum},
|
|
#{socialPay},
|
|
#{fundPay},
|
|
#{otherPay},
|
|
#{accountant},
|
|
#{remarks},
|
|
#{creator},
|
|
#{deleteType},
|
|
#{createTime},
|
|
#{updateTime},
|
|
#{tenantKey},
|
|
</trim>
|
|
</insert>
|
|
|
|
|
|
<insert id="insert" parameterType="com.engine.salary.entity.siaccount.po.InsuranceAccountBatchPO" databaseId="oracle"
|
|
>
|
|
<selectKey keyProperty="id" resultType="long" order="AFTER">
|
|
select nvl(max(id),0)+1 from hrsa_bill_batch
|
|
</selectKey>
|
|
INSERT INTO hrsa_bill_batch
|
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
|
bill_month,
|
|
bill_status,
|
|
social_num,
|
|
fund_num,
|
|
other_num,
|
|
social_pay,
|
|
fund_pay,
|
|
other_pay,
|
|
accountant,
|
|
remarks,
|
|
creator,
|
|
delete_type,
|
|
create_time,
|
|
update_time,
|
|
tenant_key,
|
|
</trim>
|
|
<trim prefix="VALUES (" suffix=")" suffixOverrides=",">
|
|
#{billMonth},
|
|
#{billStatus},
|
|
#{socialNum},
|
|
#{fundNum},
|
|
#{otherNum},
|
|
#{socialPay},
|
|
#{fundPay},
|
|
#{otherPay},
|
|
#{accountant},
|
|
#{remarks},
|
|
#{creator},
|
|
#{deleteType},
|
|
#{createTime},
|
|
#{updateTime},
|
|
#{tenantKey},
|
|
</trim>
|
|
</insert>
|
|
|
|
|
|
|
|
<sql id="paramSql">
|
|
<if test="param.startTime != null and param.startTime != '' and param.endTime != null and param.endTime != ''">
|
|
AND
|
|
t.bill_month between #{param.startTime} and #{param.endTime}
|
|
</if>
|
|
</sql>
|
|
|
|
|
|
<select id="list" resultMap="BaseResultMap">
|
|
SELECT
|
|
<include refid="baseColumns"/>
|
|
FROM
|
|
hrsa_bill_batch t
|
|
WHERE t.delete_type = 0
|
|
<include refid="paramSql"/>
|
|
ORDER BY t.bill_month DESC
|
|
</select>
|
|
|
|
<select id="listByTimeRange" resultMap="BaseResultMap">
|
|
SELECT
|
|
<include refid="baseColumns"/>
|
|
FROM
|
|
hrsa_bill_batch t
|
|
WHERE t.delete_type = 0
|
|
AND t.bill_month between #{minDate} and #{maxDate}
|
|
ORDER BY t.bill_month DESC
|
|
</select>
|
|
|
|
|
|
<select id="getByBillMonth" resultMap="BaseResultMap" >
|
|
SELECT
|
|
<include refid="baseColumns"/>
|
|
FROM
|
|
hrsa_bill_batch t
|
|
WHERE t.delete_type = 0
|
|
AND t.bill_month = #{billMonth}
|
|
</select>
|
|
|
|
|
|
<select id="getByBillStatus" resultMap="BaseResultMap">
|
|
SELECT
|
|
<include refid="baseColumns"/>
|
|
FROM
|
|
hrsa_bill_batch t
|
|
WHERE t.delete_type = 0
|
|
AND t.bill_month = #{billMonth}
|
|
AND t.bill_status = #{billStatus}
|
|
</select>
|
|
|
|
|
|
<delete id="deleteById">
|
|
UPDATE hrsa_bill_batch
|
|
SET delete_type = 1
|
|
WHERE delete_type = 0
|
|
AND id = #{id}
|
|
</delete>
|
|
|
|
|
|
<update id="updateById" parameterType="com.engine.salary.entity.siaccount.po.InsuranceAccountBatchPO">
|
|
UPDATE hrsa_bill_batch
|
|
<set>
|
|
accountant=#{accountant},
|
|
update_time=#{updateTime},
|
|
social_pay=#{socialPay},
|
|
social_num=#{socialNum},
|
|
fund_num=#{fundNum},
|
|
fund_pay=#{fundPay},
|
|
other_num=#{otherNum},
|
|
other_pay=#{otherPay},
|
|
bill_status=#{billStatus}
|
|
</set>
|
|
WHERE id = #{id} AND delete_type = 0
|
|
</update>
|
|
|
|
|
|
|
|
</mapper> |