| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182 |
- <?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.ydtech.modules.inv.dao.InvAccountIncoiceMapper">
- <resultMap type="com.ydtech.modules.inv.model.InvAccountIncoice" id="InvAccountIncoiceMap">
- <result property="invoiceId" column="invoice_id" jdbcType="INTEGER"/>
- <result property="biller" column="biller" jdbcType="VARCHAR"/>
- <result property="invoiceSubjects" column="invoice_subjects" jdbcType="VARCHAR"/>
- <result property="invoiceBy" column="invoice_by" jdbcType="VARCHAR"/>
- <result property="otherUnit" column="other_unit" jdbcType="VARCHAR"/>
- <result property="invoiceNum" column="invoice_num" jdbcType="VARCHAR"/>
- <result property="invoiceTime" column="invoice_time" jdbcType="TIMESTAMP"/>
- <result property="noHasTax" column="no_has_tax" jdbcType="VARCHAR"/>
- <result property="rate" column="rate" jdbcType="VARCHAR"/>
- <result property="tax" column="tax" jdbcType="VARCHAR"/>
- <result property="invoiceMoney" column="invoice_money" jdbcType="VARCHAR"/>
- <result property="invoiceType" column="invoice_type" jdbcType="VARCHAR"/>
- <result property="payoutMoney" column="payout_money" jdbcType="VARCHAR"/>
- <result property="notPayoutMoney" column="not_payout_money" jdbcType="VARCHAR"/>
- <result property="delFlag" column="del_flag" jdbcType="VARCHAR"/>
- <result property="revBankCardNum" column="rev_bank_card_num" jdbcType="VARCHAR"/>
- <result property="outBankCardNum" column="out_bank_card_num" jdbcType="VARCHAR"/>
- <result property="clearFlag" column="clear_flag" jdbcType="VARCHAR"/>
- <result property="outProfit" column="out_profit" javaType="com.alibaba.fastjson.JSONObject"
- typeHandler="com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler" jdbcType="VARCHAR"/>
- <result property="entProfit" column="ent_profit" javaType="com.alibaba.fastjson.JSONObject"
- typeHandler="com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler" jdbcType="VARCHAR"/>
- <result property="fundFen" column="fund_fen" jdbcType="VARCHAR"/>
- <result property="remark" column="remark" jdbcType="VARCHAR"/>
- </resultMap>
- <!-- 批量插入 -->
- <insert id="insertBatch" keyProperty="invoiceId" useGeneratedKeys="true">
- insert into zgdd.inv_account_incoice(billerinvoice_subjectsinvoice_byother_unitinvoice_numinvoice_timeno_has_taxratetaxinvoice_moneyinvoice_typepayout_timepayout_moneynot_payout_moneydel_flag)
- values
- <foreach collection="entities" item="entity" separator=",">
- (#{entity.biller}#{entity.invoiceSubjects}#{entity.invoiceBy}#{entity.otherUnit}#{entity.invoiceNum}#{entity.invoiceTime}#{entity.noHasTax}#{entity.rate}#{entity.tax}#{entity.invoiceMoney}#{entity.invoiceType}#{entity.payoutTime}#{entity.payoutMoney}#{entity.notPayoutMoney}#{entity.delFlag})
- </foreach>
- </insert>
- <!-- 批量插入或按主键更新 -->
- <insert id="insertOrUpdateBatch" keyProperty="invoiceId" useGeneratedKeys="true">
- insert into zgdd.inv_account_incoice(billerinvoice_subjectsinvoice_byother_unitinvoice_numinvoice_timeno_has_taxratetaxinvoice_moneyinvoice_typepayout_timepayout_moneynot_payout_moneydel_flag)
- values
- <foreach collection="entities" item="entity" separator=",">
- (#{entity.biller}#{entity.invoiceSubjects}#{entity.invoiceBy}#{entity.otherUnit}#{entity.invoiceNum}#{entity.invoiceTime}#{entity.noHasTax}#{entity.rate}#{entity.tax}#{entity.invoiceMoney}#{entity.invoiceType}#{entity.payoutTime}#{entity.payoutMoney}#{entity.notPayoutMoney}#{entity.delFlag})
- </foreach>
- on duplicate key update
- biller = values(biller) invoice_subjects = values(invoice_subjects) invoice_by = values(invoice_by) other_unit = values(other_unit) invoice_num = values(invoice_num) invoice_time = values(invoice_time) no_has_tax = values(no_has_tax) rate = values(rate) tax = values(tax) invoice_money = values(invoice_money) invoice_type = values(invoice_type) payout_time = values(payout_time) payout_money = values(payout_money) not_payout_money = values(not_payout_money) del_flag = values(del_flag) </insert>
- <select id="selectAccountIncoice" resultType="com.ydtech.modules.inv.model.InvAccountIncoiceResult">
- SELECT
- sum(round(invoice_money,2)) as invoice_money_sum,
- sum( round(tax, 2) ) as tax_sum,
- sum( round(no_has_tax, 2) ) as no_has_tax_sum,
- sum( round(payout_money, 2) ) as payoutMoneySum,
- sum( round(not_payout_money, 2) ) as notPayoutMoneySum,
- sum( round(invoice_num, 2) ) as invoiceNumSum
- FROM inv_account_incoice WHERE del_flag = '0'
- <if test="invoiceTimeStart != null">
- and invoice_time >= #{invoiceTimeStart}
- </if>
- <if test="invoiceTimeEnd != null">
- and invoice_time <= #{invoiceTimeEnd}
- </if>
- <if test="biller != null and biller != ''">
- and biller like concat('%',#{biller},'%')
- </if>
- <if test="invoiceBy != null and invoiceBy != '' ">
- and invoice_by like concat('%',#{invoiceBy},'%')
- </if>
- <if test="otherUnit != null and otherUnit != '' ">
- and other_unit like concat('%',#{otherUnit},'%')
- </if>
- <if test="invoiceType != null and invoiceType != '' ">
- and invoice_type = #{invoiceType}
- </if>
- <if test="clearFlag != null and clearFlag != '' ">
- and clear_flag = #{clearFlag}
- </if>
- </select>
- </mapper>
|