unis_sip/ruoyi-sip/src/main/resources/mapper/finance/OmsFinanceChargeMapper.xml

413 lines
18 KiB
XML
Raw Normal View History

<?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.ruoyi.sip.mapper.OmsFinanceChargeMapper">
<resultMap type="OmsFinanceCharge" id="OmsFinanceChargeResult">
<id property="id" column="id" />
<result property="orderCode" column="order_code" />
<result property="bizChargeDate" column="biz_charge_date" />
<result property="financeChargeDate" column="finance_charge_date" />
<result property="incomeWithTaxTotal" column="income_with_tax_total" />
<result property="incomeWithoutTaxTotal" column="income_without_tax_total" />
<result property="costSoftwareWithoutTax" column="cost_software_without_tax" />
<result property="costSoftwareWithTax" column="cost_software_with_tax" />
<result property="costHardwareWithoutTax" column="cost_hardware_without_tax" />
<result property="costHardwareWithTax" column="cost_hardware_with_tax" />
<result property="costSoftwareMaintWithoutTax" column="cost_software_maint_without_tax" />
<result property="costSoftwareMaintWithTax" column="cost_software_maint_with_tax" />
<result property="costHardwareMaintWithoutTax" column="cost_hardware_maint_without_tax" />
<result property="costHardwareMaintWithTax" column="cost_hardware_maint_with_tax" />
<result property="costProvinceServiceWithTax" column="cost_province_service_with_tax" />
<result property="costProvinceServiceWithoutTax" column="cost_province_service_without_tax" />
<result property="costOtherWithTax" column="cost_other_with_tax" />
<result property="costOtherWithoutTax" column="cost_other_without_tax" />
<result property="remark" column="remark" />
<result property="createTime" column="create_time" />
<result property="updateTime" column="update_time" />
<result property="chargeStatus" column="charge_status" />
</resultMap>
<sql id="selectOmsFinanceChargeVo">
select id, order_code, biz_charge_date, finance_charge_date,
income_with_tax_total, income_without_tax_total,
cost_software_without_tax, cost_software_with_tax,
cost_hardware_without_tax, cost_hardware_with_tax,
cost_software_maint_without_tax, cost_software_maint_with_tax,
cost_hardware_maint_without_tax, cost_hardware_maint_with_tax,
cost_province_service_with_tax, cost_province_service_without_tax,
cost_other_with_tax, cost_other_without_tax,
remark, create_time, update_time,update_by, charge_status
from oms_finance_charge
</sql>
<select id="selectOmsFinanceChargeById" parameterType="Long" resultMap="OmsFinanceChargeResult">
<include refid="selectOmsFinanceChargeVo"/>
where id = #{id}
</select>
<select id="selectOmsFinanceChargeList" parameterType="OmsFinanceCharge" resultMap="OmsFinanceChargeResult">
<include refid="selectOmsFinanceChargeVo"/>
<where>
<if test="orderCode != null and orderCode != ''">
and order_code = #{orderCode}
</if>
<if test="bizChargeDate != null">
and biz_charge_date = #{bizChargeDate}
</if>
<if test="financeChargeDate != null">
and finance_charge_date = #{financeChargeDate}
</if>
<if test="incomeWithTaxTotal != null">
and income_with_tax_total = #{incomeWithTaxTotal}
</if>
<if test="incomeWithoutTaxTotal != null">
and income_without_tax_total = #{incomeWithoutTaxTotal}
</if>
<if test="costSoftwareWithoutTax != null">
and cost_software_without_tax = #{costSoftwareWithoutTax}
</if>
<if test="costSoftwareWithTax != null">
and cost_software_with_tax = #{costSoftwareWithTax}
</if>
<if test="costHardwareWithoutTax != null">
and cost_hardware_without_tax = #{costHardwareWithoutTax}
</if>
<if test="costHardwareWithTax != null">
and cost_hardware_with_tax = #{costHardwareWithTax}
</if>
<if test="costSoftwareMaintWithoutTax != null">
and cost_software_maint_without_tax = #{costSoftwareMaintWithoutTax}
</if>
<if test="costSoftwareMaintWithTax != null">
and cost_software_maint_with_tax = #{costSoftwareMaintWithTax}
</if>
<if test="costHardwareMaintWithoutTax != null">
and cost_hardware_maint_without_tax = #{costHardwareMaintWithoutTax}
</if>
<if test="costHardwareMaintWithTax != null">
and cost_hardware_maint_with_tax = #{costHardwareMaintWithTax}
</if>
<if test="costProvinceServiceWithTax != null">
and cost_province_service_with_tax = #{costProvinceServiceWithTax}
</if>
<if test="costProvinceServiceWithoutTax != null">
and cost_province_service_without_tax = #{costProvinceServiceWithoutTax}
</if>
<if test="costOtherWithTax != null">
and cost_other_with_tax = #{costOtherWithTax}
</if>
<if test="costOtherWithoutTax != null">
and cost_other_without_tax = #{costOtherWithoutTax}
</if>
<if test="remark != null and remark != ''">
and remark like concat('%', #{remark}, '%')
</if>
<if test="chargeStatus != null and chargeStatus != ''">
and charge_status = #{chargeStatus}
</if>
</where>
</select>
<insert id="insertOmsFinanceCharge" parameterType="OmsFinanceCharge" useGeneratedKeys="true" keyProperty="id">
insert into oms_finance_charge
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="orderCode != null and orderCode != ''">
order_code,
</if>
<if test="bizChargeDate != null">
biz_charge_date,
</if>
<if test="financeChargeDate != null">
finance_charge_date,
</if>
<if test="incomeWithTaxTotal != null">
income_with_tax_total,
</if>
<if test="incomeWithoutTaxTotal != null">
income_without_tax_total,
</if>
<if test="costSoftwareWithoutTax != null">
cost_software_without_tax,
</if>
<if test="costSoftwareWithTax != null">
cost_software_with_tax,
</if>
<if test="costHardwareWithoutTax != null">
cost_hardware_without_tax,
</if>
<if test="costHardwareWithTax != null">
cost_hardware_with_tax,
</if>
<if test="costSoftwareMaintWithoutTax != null">
cost_software_maint_without_tax,
</if>
<if test="costSoftwareMaintWithTax != null">
cost_software_maint_with_tax,
</if>
<if test="costHardwareMaintWithoutTax != null">
cost_hardware_maint_without_tax,
</if>
<if test="costHardwareMaintWithTax != null">
cost_hardware_maint_with_tax,
</if>
<if test="costProvinceServiceWithTax != null">
cost_province_service_with_tax,
</if>
<if test="costProvinceServiceWithoutTax != null">
cost_province_service_without_tax,
</if>
<if test="costOtherWithTax != null">
cost_other_with_tax,
</if>
<if test="costOtherWithoutTax != null">
cost_other_without_tax,
</if>
<if test="remark != null and remark != ''">
remark,
</if>
<if test="chargeStatus != null and chargeStatus != ''">
charge_status,
</if>
create_time,
update_time
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="orderCode != null and orderCode != ''">
#{orderCode},
</if>
<if test="bizChargeDate != null">
#{bizChargeDate},
</if>
<if test="financeChargeDate != null">
#{financeChargeDate},
</if>
<if test="incomeWithTaxTotal != null">
#{incomeWithTaxTotal},
</if>
<if test="incomeWithoutTaxTotal != null">
#{incomeWithoutTaxTotal},
</if>
<if test="costSoftwareWithoutTax != null">
#{costSoftwareWithoutTax},
</if>
<if test="costSoftwareWithTax != null">
#{costSoftwareWithTax},
</if>
<if test="costHardwareWithoutTax != null">
#{costHardwareWithoutTax},
</if>
<if test="costHardwareWithTax != null">
#{costHardwareWithTax},
</if>
<if test="costSoftwareMaintWithoutTax != null">
#{costSoftwareMaintWithoutTax},
</if>
<if test="costSoftwareMaintWithTax != null">
#{costSoftwareMaintWithTax},
</if>
<if test="costHardwareMaintWithoutTax != null">
#{costHardwareMaintWithoutTax},
</if>
<if test="costHardwareMaintWithTax != null">
#{costHardwareMaintWithTax},
</if>
<if test="costProvinceServiceWithTax != null">
#{costProvinceServiceWithTax},
</if>
<if test="costProvinceServiceWithoutTax != null">
#{costProvinceServiceWithoutTax},
</if>
<if test="costOtherWithTax != null">
#{costOtherWithTax},
</if>
<if test="costOtherWithoutTax != null">
#{costOtherWithoutTax},
</if>
<if test="remark != null and remark != ''">
#{remark},
</if>
<if test="chargeStatus != null and chargeStatus != ''">
#{chargeStatus},
</if>
now(),
now()
</trim>
on duplicate key update charge_status=values(charge_status)
</insert>
<update id="updateOmsFinanceCharge" parameterType="OmsFinanceCharge">
update oms_finance_charge
<trim prefix="SET" suffixOverrides=",">
<if test="orderCode != null and orderCode != ''">
order_code = #{orderCode},
</if>
<if test="bizChargeDate != null">
biz_charge_date = #{bizChargeDate},
</if>
<if test="financeChargeDate != null">
finance_charge_date = #{financeChargeDate},
</if>
<if test="incomeWithTaxTotal != null">
income_with_tax_total = #{incomeWithTaxTotal},
</if>
<if test="incomeWithoutTaxTotal != null">
income_without_tax_total = #{incomeWithoutTaxTotal},
</if>
<if test="costSoftwareWithoutTax != null">
cost_software_without_tax = #{costSoftwareWithoutTax},
</if>
<if test="costSoftwareWithTax != null">
cost_software_with_tax = #{costSoftwareWithTax},
</if>
<if test="costHardwareWithoutTax != null">
cost_hardware_without_tax = #{costHardwareWithoutTax},
</if>
<if test="costHardwareWithTax != null">
cost_hardware_with_tax = #{costHardwareWithTax},
</if>
<if test="costSoftwareMaintWithoutTax != null">
cost_software_maint_without_tax = #{costSoftwareMaintWithoutTax},
</if>
<if test="costSoftwareMaintWithTax != null">
cost_software_maint_with_tax = #{costSoftwareMaintWithTax},
</if>
<if test="costHardwareMaintWithoutTax != null">
cost_hardware_maint_without_tax = #{costHardwareMaintWithoutTax},
</if>
<if test="costHardwareMaintWithTax != null">
cost_hardware_maint_with_tax = #{costHardwareMaintWithTax},
</if>
<if test="costProvinceServiceWithTax != null">
cost_province_service_with_tax = #{costProvinceServiceWithTax},
</if>
<if test="costProvinceServiceWithoutTax != null">
cost_province_service_without_tax = #{costProvinceServiceWithoutTax},
</if>
<if test="costOtherWithTax != null">
cost_other_with_tax = #{costOtherWithTax},
</if>
<if test="costOtherWithoutTax != null">
cost_other_without_tax = #{costOtherWithoutTax},
</if>
<if test="remark != null and remark != ''">
remark = #{remark},
</if>
<if test="chargeStatus != null and chargeStatus != ''">
charge_status = #{chargeStatus},
</if>
<if test="updateBy != null and updateBy != ''">
update_by = #{updateBy},
</if>
update_time = now()
</trim>
where id = #{id}
</update>
<update id="updateOmsFinanceChargeByOrderCode">
update oms_finance_charge
<trim prefix="SET" suffixOverrides=",">
<if test="bizChargeDate != null">
biz_charge_date = #{bizChargeDate},
</if>
<if test="financeChargeDate != null">
finance_charge_date = #{financeChargeDate},
</if>
<if test="incomeWithTaxTotal != null">
income_with_tax_total = #{incomeWithTaxTotal},
</if>
<if test="incomeWithoutTaxTotal != null">
income_without_tax_total = #{incomeWithoutTaxTotal},
</if>
<if test="costSoftwareWithoutTax != null">
cost_software_without_tax = #{costSoftwareWithoutTax},
</if>
<if test="costSoftwareWithTax != null">
cost_software_with_tax = #{costSoftwareWithTax},
</if>
<if test="costHardwareWithoutTax != null">
cost_hardware_without_tax = #{costHardwareWithoutTax},
</if>
<if test="costHardwareWithTax != null">
cost_hardware_with_tax = #{costHardwareWithTax},
</if>
<if test="costSoftwareMaintWithoutTax != null">
cost_software_maint_without_tax = #{costSoftwareMaintWithoutTax},
</if>
<if test="costSoftwareMaintWithTax != null">
cost_software_maint_with_tax = #{costSoftwareMaintWithTax},
</if>
<if test="costHardwareMaintWithoutTax != null">
cost_hardware_maint_without_tax = #{costHardwareMaintWithoutTax},
</if>
<if test="costHardwareMaintWithTax != null">
cost_hardware_maint_with_tax = #{costHardwareMaintWithTax},
</if>
<if test="costProvinceServiceWithTax != null">
cost_province_service_with_tax = #{costProvinceServiceWithTax},
</if>
<if test="costProvinceServiceWithoutTax != null">
cost_province_service_without_tax = #{costProvinceServiceWithoutTax},
</if>
<if test="costOtherWithTax != null">
cost_other_with_tax = #{costOtherWithTax},
</if>
<if test="costOtherWithoutTax != null">
cost_other_without_tax = #{costOtherWithoutTax},
</if>
<if test="remark != null and remark != ''">
remark = #{remark},
</if>
<if test="chargeStatus != null and chargeStatus != ''">
charge_status = #{chargeStatus},
</if>
<if test="updateBy != null and updateBy != ''">
update_by = #{updateBy},
</if>
update_time = now()
</trim>
where order_code = #{orderCode}
</update>
<update id="returnApplyBiz">
update oms_finance_charge
set charge_status=#{chargeStatus},
biz_charge_date=null,
update_time=now()
where order_code = #{orderCode}
</update>
<update id="revoke">
update oms_finance_charge set
finance_charge_date = #{financeChargeDate},
income_with_tax_total = #{incomeWithTaxTotal},
income_without_tax_total = #{incomeWithoutTaxTotal},
cost_software_without_tax = #{costSoftwareWithoutTax},
cost_software_with_tax = #{costSoftwareWithTax},
cost_hardware_without_tax = #{costHardwareWithoutTax},
cost_hardware_with_tax = #{costHardwareWithTax},
cost_software_maint_without_tax = #{costSoftwareMaintWithoutTax},
cost_software_maint_with_tax = #{costSoftwareMaintWithTax},
cost_hardware_maint_without_tax = #{costHardwareMaintWithoutTax},
cost_hardware_maint_with_tax = #{costHardwareMaintWithTax},
cost_province_service_with_tax = #{costProvinceServiceWithTax},
cost_province_service_without_tax = #{costProvinceServiceWithoutTax},
cost_other_with_tax = #{costOtherWithTax},
cost_other_without_tax = #{costOtherWithoutTax},
remark = #{remark},
charge_status = #{chargeStatus},
update_by = #{updateBy},
update_time = now()
where id = #{id}
</update>
<delete id="deleteOmsFinanceChargeById" parameterType="Long">
delete from oms_finance_charge where id = #{id}
</delete>
<delete id="deleteOmsFinanceChargeByIds" parameterType="String">
delete from oms_finance_charge where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>