You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

128 lines
5.8 KiB

<?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.dxhy.extend.dao.ExtTicketDao">
<resultMap id="InvoicePoolHjResultMap"
type="com.dxhy.extend.entity.ExtTicketInvoiceModel">
<result column="hjsl" property="id"/>
<result column="hjje" property="invoiceAmount"/>
<result column="hjse" property="taxAmount"/>
</resultMap>
<select id="queryTotal" parameterType="java.util.Map"
resultMap="InvoicePoolHjResultMap" databaseId="mysql">
select count(1) hjsl,sum(t.invoice_amount)hjje,sum(t.tax_amount)hjse
from t_dx_invoice_reimburse t
where 1=1
<if
test="kpksrq != null and kpksrq != '' and kpksrq != 'null' and kpjsrq != null and kpjsrq != '' and kpjsrq != 'null'">
and t.invoice_date between #{kpksrq} and #{kpjsrq}
</if>
<if
test="cjksyf != null and cjksyf != '' and cjksyf != 'null' and cjjsyf != null and cjjsyf != '' and cjjsyf != 'null'">
and t.create_date between #{cjksyf} and #{cjjsyf}
</if>
<if test="keyWord != null and keyWord != '' and keyWord != 'null' ">
and CONCAT(IFNULL(t.passenger,''),IFNULL(t.passenger_s_f_z_h,'')) like
CONCAT('%',#{keyWord},'%')
</if>
and t.gf_tax_no in
<foreach collection="gfsh" index="index" item="item" open="(" separator="," close=")">
#{item}
</foreach>
<if test="list != null and list != '' and list != 'null' ">
and t.invoice_type in
<foreach collection="list" index="index" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</if>
<if test="qszt != null and qszt != '' and qszt != 'null' and qszt != '99'">
and t.qs_status = #{qszt}
</if>
<if test="qsyf != null and qsyf != null and qsyf != '' and qsyf != ''">
and DATE_FORMAT(t.qs_date,'%Y-%m') = #{qsyf}
</if>
<if test="qsr != null and qsr != '' and qsr != 'null' ">
and t.qs_name like CONCAT(#{qsr},'%')
</if>
<if test="qsfs != null and qsfs != '' and qsfs != 'null' and qsfs != '99'">
and t.qs_type = #{qsfs}
</if>
<if test="isDeduction != null and isDeduction != ''">
and t.is_deduction = #{isDeduction}
</if>
<if test="company !=null and company !=''">
and t.company = #{company}
</if>
<if test="snVoucherNumber != null and snVoucherNumber != '' and snVoucherNumber != 'null' and snVoucherNumber != '99'">
and t.sn_voucher_number = #{snVoucherNumber}
</if>
<if test="postingTime != null and postingTime != '' and postingTime != 'null' and postingTime != '99'">
and t.posting_time = #{postingTime}
</if>
<if test="imageId != null and imageId != '' and imageId != 'null' and imageId != '99'">
and t.image_id = #{imageId}
</if>
<if test="accountPeriod != null and accountPeriod != '' and accountPeriod != 'null' and accountPeriod != '99'">
and t.account_period = #{accountPeriod}
</if>
</select>
<select id="queryTickets" parameterType="java.util.Map"
resultType="com.dxhy.extend.entity.ExtTicketInvoiceModel" databaseId="mysql">
select *
from t_dx_invoice_reimburse t
where 1=1
<if
test="kpksrq != null and kpksrq != '' and kpksrq != 'null' and kpjsrq != null and kpjsrq != '' and kpjsrq != 'null'">
and t.invoice_date between #{kpksrq} and #{kpjsrq}
</if>
<if
test="cjksyf != null and cjksyf != '' and cjksyf != 'null' and cjjsyf != null and cjjsyf != '' and cjjsyf != 'null'">
and t.create_date between #{cjksyf} and #{cjjsyf}
</if>
<if test="keyWord != null and keyWord != '' and keyWord != 'null' ">
and CONCAT(IFNULL(t.passenger,''),IFNULL(t.passenger_s_f_z_h,'')) like
CONCAT('%',#{keyWord},'%')
</if>
and t.gf_tax_no in
<foreach collection="gfsh" index="index" item="item" open="(" separator="," close=")">
#{item}
</foreach>
<if test="list != null and list != '' and list != 'null' ">
and t.invoice_type in
<foreach collection="list" index="index" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</if>
<if test="qszt != null and qszt != '' and qszt != 'null' and qszt != '99'">
and t.qs_status = #{qszt}
</if>
<if test="qsyf != null and qsyf != null and qsyf != '' and qsyf != ''">
and DATE_FORMAT(t.qs_date,'%Y-%m') = #{qsyf}
</if>
<if test="qsr != null and qsr != '' and qsr != 'null' ">
and t.qs_name like CONCAT(#{qsr},'%')
</if>
<if test="qsfs != null and qsfs != '' and qsfs != 'null' and qsfs != '99'">
and t.qs_type = #{qsfs}
</if>
<if test="isDeduction != null and isDeduction != ''">
and t.is_deduction = #{isDeduction}
</if>
<if test="company !=null and company !=''">
and t.company = #{company}
</if>
<if test="snVoucherNumber != null and snVoucherNumber != '' and snVoucherNumber != 'null' and snVoucherNumber != '99'">
and t.sn_voucher_number = #{snVoucherNumber}
</if>
<if test="postingTime != null and postingTime != '' and postingTime != 'null' and postingTime != '99'">
and t.posting_time = #{postingTime}
</if>
<if test="imageNumber != null and imageNumber != '' and imageNumber != 'null' and imageNumber != '99'">
and t.image_id = #{imageNumber}
</if>
</select>
</mapper>