| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913 |
- <?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.tofly.feesapi.dzfp.mapper.EiFpkjRequestMapper">
- <sql id="querySql">
- SELECT sfid,
- lsbh,
- yhbh,
- buyerName,
- ssje,
- cwrq,
- sfrq,
- invoicetime,
- sfry,
- pushMode,
- case
- when pushMode = '-1' then '不推送'
- when pushMode = '0' then '邮箱'
- when pushMode = '1' then '手机'
- when pushMode = '2' then '邮箱、手机'
- else
- '不推送'
- end as pushModeMc,
- exTaxAmount,
- taxAmount,
- orderAmount,
- invoiceType,
- case
- when invoiceType = '1' then '蓝票'
- when invoiceType = '2' then '红票'
- else '开票类型值不对'
- end as invoiceTypeMc,
- invoiceLine,
- case
- when invoiceLine = 'p' then '普通电票'
- when invoiceLine = 'pc' then '数电普票'
- when invoiceLine = 'bs' then '数电专票'
- else
- '发票种类值不对'
- end as invoiceLineMc,
- jf_yxbz as jfYxbz,
- case
- when jf_yxbz = '0' then '未交付'
- when jf_yxbz = '1' then '已交付'
- else
- '未交付'
- end as jfYxbzMc,
- status,
- case
- when cl_cljg = '0' then '未开票'
- when cl_cljg = '1' then '开票完成'
- when cl_cljg = '3' then '开票中'
- when cl_cljg = '2' then '开票失败'
- else
- '未开票'
- end as statusMc,
- invoiceNum,
- invoicecode,
- zf_zfbz as zfZfbz,
- case
- when zf_zfbz = '0' then '正票'
- when zf_zfbz = '1' then '已冲红'
- when zf_zfbz = '2' then '冲红记录'
- else
- '正票'
- end as zfZfbzMc,
- fp_sfkp as fpSfkp,
- case
- when fp_sfkp = '0' then '不开票'
- when fp_sfkp = '1' then '开票'
- else
- '不开票'
- end as fpSfkpMc,
- fp_sf_hb as fpSfHb,
- case
- when fp_sf_hb = '0' then '否'
- when fp_sf_hb = '1' then '是'
- else
- '否'
- end as fp_sf_hbMc,
- fp_hb_lx as fpHbLx,
- case
- when fp_hb_lx = '0' then '否'
- when fp_hb_lx = '1' then '多笔欠费'
- when fp_hb_lx = '2' then '多笔用户'
- else
- '否'
- end as fpHbLxMc,
- statusmsg,
- failcause,
- cl_lock as clLock,
- cl_cljg as clCljg,
- cl_remessage as clRemessage,
- pdfurl
- FROM ei_fpkj_request
- WHERE 1 = 1
- <include refid="querySql_where"></include>
- </sql>
- <sql id="querySql_Sum">
- SELECT sum(ssje) ssje,
- sum(exTaxAmount) exTaxAmount,
- sum(taxAmount) taxAmount ,
- sum(orderAmount) orderAmount
- from ei_fpkj_request
- WHERE 1=1
- <include refid="querySql_where"></include>
- </sql>
- <sql id="querySql_where">
- <!--模糊查询 -->
- <if test="filter.searchText!=null">
- AND ( buyerName like '%${filter.searchText}%'
- OR buyerAddress like '%${filter.searchText}%'
- OR buyerTel like '%${filter.searchText}%'
- OR cwrq like '%${filter.searchText}%'
- OR yhbh like '%${filter.searchText}%'
- OR invoiceCode like '%${filter.searchText}%'
- OR sfid like '%${filter.searchText}%'
- OR invoiceNum like '%${filter.searchText}%'
- OR buyerPhone like '%${filter.searchText}%')
- </if>
- <!--所属公司-->
- <if test="filter.ssgs!=null">
- AND ssgs=#{filter.ssgs}
- </if>
- <!--所属片区-->
- <if test="filter.sspq!=null">
- AND yh_sspq=#{filter.sspq}
- </if>
- <!--开票类型invoiceType-->
- <if test="filter.invoiceType!=null">
- AND invoiceType=#{filter.invoiceType}
- </if>
- <!-- 是否开票fp_sfkp-->
- <if test="filter.fp_sfkp!=null">
- <if test="filter.fp_sfkp=='1'">
- AND fp_sfkp in ('1','2')
- </if>
- <if test="filter.fp_sfkp=='0'">
- AND fp_sfkp='0'
- </if>
- </if>
- <!-- 发票种类invoiceLine-->
- <if test="filter.invoiceLine!=null">
- AND invoiceLine=#{filter.invoiceLine}
- </if>
- <!-- 财务月份-->
- <if test="filter.cwrq!=null">
- AND cwrq=#{filter.cwrq}
- </if>
- <!-- 开票状态status-->
- <if test="filter.status!=null">
- AND cl_cljg=#{filter.status}
- </if>
- <!-- 收费人员-->
- <if test="filter.sfry!=null">
- AND sfry=#{filter.sfry}
- </if>
- <if test="filter.tjsj_type!=null and filter.tjsj_type==1">
- <!--收费日期-->
- <if test="filter.start_tjsj!=null and filter.end_tjsj!=null">
- AND sfrq BETWEEN #{filter.start_tjsj} AND #{filter.end_tjsj}
- </if>
- </if>
- <if test="filter.tjsj_type!=null and filter.tjsj_type==2">
- <!--开票日期-->
- <if test="filter.start_tjsj!=null and filter.end_tjsj!=null">
- AND invoicetime BETWEEN to_char(#{filter.start_tjsj},'yyyy-MM-dd HH:mm:ss') AND to_char(#{filter.end_tjsj},'yyyy-MM-dd HH:mm:ss')
- </if>
- </if>
- <if test="filter.isykfp!=null">
- AND isykfp=#{filter.isykfp}
- </if>
- <if test="filter.kpyw!=null">
- AND yhlx=#{filter.kpyw}
- </if>
- <if test="filter.dxh!=null">
- AND dxh=#{filter.dxh}
- </if>
- </sql>
- <sql id="querySql_sf">
- SELECT sfid ,a.lsbh,yhbh,buyerName,ssje,cwrq,sfrq,invoicetime,sfry,pushMode,
- case
- when pushMode='-1' then '不推送'
- when pushMode='0' then '邮箱'
- when pushMode='1' then '手机'
- when pushMode='2' then '邮箱、手机'
- else '不推送'
- end as pushModeMc,
- b.tax exTaxAmount,b.taxexcludedamount taxAmount,b.taxincludedamount orderAmount,invoiceType,
- case
- when invoiceType='1' then '蓝票'
- when invoiceType='2' then '红票'
- else '开票类型值不对'
- end as invoiceTypeMc
- ,invoiceLine,
- case
- when invoiceLine='p' then '普通电票'
- when invoiceLine='pc' then '数电普票'
- when invoiceLine='bs' then '数电专票'
- else '发票种类值不对'
- end as invoiceLineMc,
- jf_yxbz as jfYxbz,
- case
- when jf_yxbz='0' then '未交付'
- when jf_yxbz='1' then '已交付'
- else '未交付'
- end as jfYxbzMc,
- status,
- case
- when status='0' then '未开票'
- when status='2' then '开票完成'
- when status='20' then '开票中'
- when status='21' then '开票成功签章中'
- when status='22' then '开票失败'
- when status='24' then '开票成功签章失败'
- when status='3' then '发票已作废'
- when status='31' then '发票作废中'
- else '未开票'
- end as statusMc,
- invoiceNum,
- zf_zfbz as zfZfbz,
- case
- when zf_zfbz='0' then '正票'
- when zf_zfbz='1' then '已冲红'
- when zf_zfbz='2' then '冲红记录'
- else '正票'
- end as zfZfbzMc,
- fp_sfkp as fpSfkp,
- case
- when fp_sfkp='0' then '不开票'
- when fp_sfkp='1' then '开票'
- else '不开票'
- end as fpSfkpMc,
- fp_sf_hb as fpSfHb,
- case
- when fp_sf_hb='0' then '否'
- when fp_sf_hb='1' then '是'
- else '否' end as fp_sf_hbMc,
- fp_hb_lx as fpHbLx,
- case
- when fp_hb_lx='0' then '否'
- when fp_hb_lx='1' then '多笔欠费'
- when fp_hb_lx='2' then '多笔用户'
- else '否' end as fpHbLxMc,statusmsg,failcause,
- cl_lock as clLock,cl_cljg as clCljg,cl_remessage as clRemessage
- from ei_fpkj_request a,ei_fpkj_mx b where a.lsbh=b.lsbh and goodsCode='110030101'
- <!--模糊查询 -->
- <if test="filter.searchText!=null">
- AND ( buyerName like '%${filter.searchText}%'
- OR buyerAddress like '%${filter.searchText}%'
- OR buyerTel like '%${filter.searchText}%'
- OR cwrq like '%${filter.searchText}%'
- OR yhbh like '%${filter.searchText}%'
- OR invoiceCode like '%${filter.searchText}%'
- OR sfid like '%${filter.searchText}%'
- OR invoiceNum like '%${filter.searchText}%'
- OR buyerPhone like '%${filter.searchText}%')
- </if>
- <!--所属公司-->
- <if test="filter.ssgs!=null">
- AND ssgs=#{filter.ssgs}
- </if>
- <!--所属片区-->
- <if test="filter.sspq!=null">
- AND yh_sspq=#{filter.sspq}
- </if>
- <!--开票类型invoiceType-->
- <if test="filter.invoiceType!=null">
- AND invoiceType=#{filter.invoiceType}
- </if>
- <!-- 是否开票fp_sfkp-->
- <if test="filter.fp_sfkp!=null">
- AND fp_sfkp=#{filter.fp_sfkp}
- </if>
- <!-- 发票种类invoiceLine-->
- <if test="filter.invoiceLine!=null">
- AND invoiceLine=#{filter.invoiceLine}
- </if>
- <!-- 财务月份-->
- <if test="filter.cwrq!=null">
- AND cwrq=#{filter.cwrq}
- </if>
- <!-- 开票状态status-->
- <if test="filter.status!=null">
- AND cl_cljg=#{filter.status}
- </if>
- <!-- 收费人员-->
- <if test="filter.sfry!=null">
- AND sfry=#{filter.sfry}
- </if>
- <if test="filter.tjsj_type!=null and filter.tjsj_type==1">
- <!--收费日期-->
- <if test="filter.start_tjsj!=null and filter.end_tjsj!=null">
- AND sfrq BETWEEN #{filter.start_tjsj} AND
- #{filter.end_tjsj}
- </if>
- </if>
- <if test="filter.tjsj_type!=null and filter.tjsj_type==2">
- <!--开票日期-->
- <if test="filter.start_tjsj!=null and filter.end_tjsj!=null">
- AND invoicetime BETWEEN to_char(#{filter.start_tjsj},'yyyy-MM-dd HH:mm:ss') AND to_char(#{filter.end_tjsj},'yyyy-MM-dd HH:mm:ss')
- </if>
- </if>
- </sql>
- <sql id="querySql_fp">
- SELECT sfid ,a.lsbh,yhbh,buyerName,ssje,cwrq,sfrq,invoicetime,sfry,pushMode ,
- case
- when pushMode='-1' then '不推送'
- when pushMode='0' then '邮箱'
- when pushMode='1' then '手机'
- when pushMode='2' then '邮箱、手机'
- else '不推送'
- end as pushModeMc,
- b.tax exTaxAmount,b.taxexcludedamount taxAmount,b.taxincludedamount orderAmount,invoiceType,
- case
- when invoiceType='1' then '蓝票'
- when invoiceType='2' then '红票'
- else '开票类型值不对'
- end as invoiceTypeMc
- ,invoiceLine,
- case
- when invoiceLine='p' then '普通电票'
- when invoiceLine='pc' then '数电普票'
- when invoiceLine='bs' then '数电专票'
- else '发票种类值不对'
- end as invoiceLineMc,
- jf_yxbz as jfYxbz,
- case
- when jf_yxbz='0' then '未交付'
- when jf_yxbz='1' then '已交付'
- else '未交付'
- end as jfYxbzMc,
- status,
- case
- when status='0' then '未开票'
- when status='2' then '开票完成'
- when status='20' then '开票中'
- when status='21' then '开票成功签章中'
- when status='22' then '开票失败'
- when status='24' then '开票成功签章失败'
- when status='3' then '发票已作废'
- when status='31' then '发票作废中'
- else '未开票'
- end as statusMc,
- invoiceNum,
- zf_zfbz as zfZfbz,
- case
- when zf_zfbz='0' then '正票'
- when zf_zfbz='1' then '已冲红'
- when zf_zfbz='2' then '冲红记录'
- else '正票'
- end as zfZfbzMc,
- fp_sfkp as fpSfkp,
- case
- when fp_sfkp='0' then '不开票'
- when fp_sfkp='1' then '开票'
- else '不开票'
- end as fpSfkpMc,
- fp_sf_hb as fpSfHb,
- case
- when fp_sf_hb='0' then '否'
- when fp_sf_hb='1' then '是'
- else '否' end as fp_sf_hbMc,
- fp_hb_lx as fpHbLx,
- case
- when fp_hb_lx='0' then '否'
- when fp_hb_lx='1' then '多笔欠费'
- when fp_hb_lx='2' then '多笔用户'
- else '否' end as fpHbLxMc,statusmsg,failcause,
- cl_lock as clLock,cl_cljg as clCljg,cl_remessage as clRemessage
- from ei_fpkj_request a,ei_fpkj_mx b where a.lsbh=b.lsbh and goodsCode='110030101'
- <!--模糊查询 -->
- <if test="filter.searchText!=null">
- AND ( buyerName like '%${filter.searchText}%'
- OR buyerAddress like '%${filter.searchText}%'
- OR buyerTel like '%${filter.searchText}%'
- OR cwrq like '%${filter.searchText}%'
- OR yhbh like '%${filter.searchText}%'
- OR invoiceCode like '%${filter.searchText}%'
- OR sfid like '%${filter.searchText}%'
- OR invoiceNum like '%${filter.searchText}%'
- OR buyerPhone like '%${filter.searchText}%')
- </if>
- <!--所属公司-->
- <if test="filter.ssgs!=null">
- AND ssgs=#{filter.ssgs}
- </if>
- <!--所属片区-->
- <if test="filter.sspq!=null">
- AND yh_sspq=#{filter.sspq}
- </if>
- <!--开票类型invoiceType-->
- <if test="filter.invoiceType!=null">
- AND invoiceType=#{filter.invoiceType}
- </if>
- <!-- 是否开票fp_sfkp-->
- <if test="filter.fp_sfkp!=null">
- AND fp_sfkp=#{filter.fp_sfkp}
- </if>
- <!-- 发票种类invoiceLine-->
- <if test="filter.invoiceLine!=null">
- AND invoiceLine=#{filter.invoiceLine}
- </if>
- <!-- 财务月份-->
- <if test="filter.cwrq!=null">
- AND cwrq=#{filter.cwrq}
- </if>
- <!-- 开票状态status-->
- <if test="filter.status!=null">
- AND cl_cljg=#{filter.status}
- </if>
- <!-- 收费人员-->
- <if test="filter.sfry!=null">
- AND sfry=#{filter.sfry}
- </if>
- <if test="filter.tjsj_type!=null and filter.tjsj_type==1">
- <!--收费日期-->
- <if test="filter.start_tjsj!=null and filter.end_tjsj!=null">
- AND sfrq BETWEEN #{filter.start_tjsj} AND
- #{filter.end_tjsj}
- </if>
- </if>
- <if test="filter.tjsj_type!=null and filter.tjsj_type==2">
- <!--开票日期-->
- <if test="filter.start_tjsj!=null and filter.end_tjsj!=null">
- AND invoicetime BETWEEN to_char(#{filter.start_tjsj},'yyyy-MM-dd HH:mm:ss') AND to_char(#{filter.end_tjsj},'yyyy-MM-dd HH:mm:ss')
- </if>
- </if>
- </sql>
- <sql id="querySql_znj">
- SELECT sfid ,a.lsbh,yhbh,buyerName,ssje,cwrq,sfrq,invoicetime,sfry,pushMode ,
- case
- when pushMode='-1' then '不推送'
- when pushMode='0' then '邮箱'
- when pushMode='1' then '手机'
- when pushMode='2' then '邮箱、手机'
- else '不推送'
- end as pushModeMc,
- b.tax exTaxAmount,b.taxexcludedamount taxAmount,b.taxincludedamount orderAmount,invoiceType,
- case
- when invoiceType='1' then '蓝票'
- when invoiceType='2' then '红票'
- else '开票类型值不对'
- end as invoiceTypeMc
- ,invoiceLine,
- case
- when invoiceLine='p' then '普通电票'
- when invoiceLine='pc' then '数电普票'
- when invoiceLine='bs' then '数电专票'
- else '发票种类值不对'
- end as invoiceLineMc,
- jf_yxbz as jfYxbz,
- case
- when jf_yxbz='0' then '未交付'
- when jf_yxbz='1' then '已交付'
- else '未交付'
- end as jfYxbzMc,
- status,
- case
- when status='0' then '未开票'
- when status='2' then '开票完成'
- when status='20' then '开票中'
- when status='21' then '开票成功签章中'
- when status='22' then '开票失败'
- when status='24' then '开票成功签章失败'
- when status='3' then '发票已作废'
- when status='31' then '发票作废中'
- else '未开票'
- end as statusMc,
- invoiceNum,
- zf_zfbz as zfZfbz,
- case
- when zf_zfbz='0' then '正票'
- when zf_zfbz='1' then '已冲红'
- when zf_zfbz='2' then '冲红记录'
- else '正票'
- end as zfZfbzMc,
- fp_sfkp as fpSfkp,
- case
- when fp_sfkp='0' then '不开票'
- when fp_sfkp='1' then '开票'
- else '不开票'
- end as fpSfkpMc,
- fp_sf_hb as fpSfHb,
- case
- when fp_sf_hb='0' then '否'
- when fp_sf_hb='1' then '是'
- else '否' end as fp_sf_hbMc,
- fp_hb_lx as fpHbLx,
- case
- when fp_hb_lx='0' then '否'
- when fp_hb_lx='1' then '多笔欠费'
- when fp_hb_lx='2' then '多笔用户'
- else '否' end as fpHbLxMc,statusmsg,failcause,
- cl_lock as clLock,cl_cljg as clCljg,cl_remessage as clRemessage
- from ei_fpkj_request a,ei_fpkj_mx b where a.lsbh=b.lsbh and goodsCode='110030101'
- <!--模糊查询 -->
- <if test="filter.searchText!=null">
- AND ( buyerName like '%${filter.searchText}%'
- OR buyerAddress like '%${filter.searchText}%'
- OR buyerTel like '%${filter.searchText}%'
- OR cwrq like '%${filter.searchText}%'
- OR yhbh like '%${filter.searchText}%'
- OR invoiceCode like '%${filter.searchText}%'
- OR sfid like '%${filter.searchText}%'
- OR invoiceNum like '%${filter.searchText}%'
- OR buyerPhone like '%${filter.searchText}%')
- </if>
- <!--所属公司-->
- <if test="filter.ssgs!=null">
- AND ssgs=#{filter.ssgs}
- </if>
- <!--所属片区-->
- <if test="filter.sspq!=null">
- AND yh_sspq=#{filter.sspq}
- </if>
- <!--开票类型invoiceType-->
- <if test="filter.invoiceType!=null">
- AND invoiceType=#{filter.invoiceType}
- </if>
- <!-- 是否开票fp_sfkp-->
- <if test="filter.fp_sfkp!=null">
- AND fp_sfkp=#{filter.fp_sfkp}
- </if>
- <!-- 发票种类invoiceLine-->
- <if test="filter.invoiceLine!=null">
- AND invoiceLine=#{filter.invoiceLine}
- </if>
- <!-- 财务月份-->
- <if test="filter.cwrq!=null">
- AND cwrq=#{filter.cwrq}
- </if>
- <!-- 开票状态status-->
- <if test="filter.status!=null">
- AND cl_cljg=#{filter.status}
- </if>
- <!-- 收费人员-->
- <if test="filter.sfry!=null">
- AND sfry=#{filter.sfry}
- </if>
- <if test="filter.tjsj_type!=null and filter.tjsj_type==1">
- <!--收费日期-->
- <if test="filter.start_tjsj!=null and filter.end_tjsj!=null">
- AND sfrq BETWEEN #{filter.start_tjsj} AND
- #{filter.end_tjsj}
- </if>
- </if>
- <if test="filter.tjsj_type!=null and filter.tjsj_type==2">
- <!--开票日期-->
- <if test="filter.start_tjsj!=null and filter.end_tjsj!=null">
- AND invoicetime BETWEEN to_char(#{filter.start_tjsj},'yyyy-MM-dd HH:mm:ss') AND to_char(#{filter.end_tjsj},'yyyy-MM-dd HH:mm:ss')
- </if>
- </if>
- </sql>
- <!-- 污水费-->
- <sql id="querySql_wsf">
- SELECT sfid ,a.lsbh,yhbh,buyerName,ssje,cwrq,sfrq,invoicetime,sfry,pushMode ,
- case
- when pushMode='-1' then '不推送'
- when pushMode='0' then '邮箱'
- when pushMode='1' then '手机'
- when pushMode='2' then '邮箱、手机'
- else '不推送'
- end as pushModeMc,
- b.tax exTaxAmount,b.taxexcludedamount taxAmount,b.taxincludedamount orderAmount,invoiceType,
- case
- when invoiceType='1' then '蓝票'
- when invoiceType='2' then '红票'
- else '开票类型值不对'
- end as invoiceTypeMc
- ,invoiceLine,
- case
- when invoiceLine='p' then '普通电票'
- when invoiceLine='pc' then '数电普票'
- when invoiceLine='bs' then '数电专票'
- else '发票种类值不对'
- end as invoiceLineMc,
- jf_yxbz as jfYxbz,
- case
- when jf_yxbz='0' then '未交付'
- when jf_yxbz='1' then '已交付'
- else '未交付'
- end as jfYxbzMc,
- status,
- case
- when status='0' then '未开票'
- when status='2' then '开票完成'
- when status='20' then '开票中'
- when status='21' then '开票成功签章中'
- when status='22' then '开票失败'
- when status='24' then '开票成功签章失败'
- when status='3' then '发票已作废'
- when status='31' then '发票作废中'
- else '未开票'
- end as statusMc,
- invoiceNum,
- zf_zfbz as zfZfbz,
- case
- when zf_zfbz='0' then '正票'
- when zf_zfbz='1' then '已冲红'
- when zf_zfbz='2' then '冲红记录'
- else '正票'
- end as zfZfbzMc,
- fp_sfkp as fpSfkp,
- case
- when fp_sfkp='0' then '不开票'
- when fp_sfkp='1' then '开票'
- else '不开票'
- end as fpSfkpMc,
- fp_sf_hb as fpSfHb,
- case
- when fp_sf_hb='0' then '否'
- when fp_sf_hb='1' then '是'
- else '否' end as fp_sf_hbMc,
- fp_hb_lx as fpHbLx,
- case
- when fp_hb_lx='0' then '否'
- when fp_hb_lx='1' then '多笔欠费'
- when fp_hb_lx='2' then '多笔用户'
- else '否' end as fpHbLxMc,statusmsg,failcause,
- cl_lock as clLock,cl_cljg as clCljg,cl_remessage as clRemessage
- from ei_fpkj_request a,ei_fpkj_mx b where a.lsbh=b.lsbh and goodsCode='611'
- <!--模糊查询 -->
- <if test="filter.searchText!=null">
- AND ( buyerName like '%${filter.searchText}%'
- OR buyerAddress like '%${filter.searchText}%'
- OR buyerTel like '%${filter.searchText}%'
- OR cwrq like '%${filter.searchText}%'
- OR yhbh like '%${filter.searchText}%'
- OR invoiceCode like '%${filter.searchText}%'
- OR sfid like '%${filter.searchText}%'
- OR invoiceNum like '%${filter.searchText}%'
- OR buyerPhone like '%${filter.searchText}%')
- </if>
- <!--所属公司-->
- <if test="filter.ssgs!=null">
- AND ssgs=#{filter.ssgs}
- </if>
- <!--所属片区-->
- <if test="filter.sspq!=null">
- AND yh_sspq=#{filter.sspq}
- </if>
- <!--开票类型invoiceType-->
- <if test="filter.invoiceType!=null">
- AND invoiceType=#{filter.invoiceType}
- </if>
- <!-- 是否开票fp_sfkp-->
- <if test="filter.fp_sfkp!=null">
- AND fp_sfkp=#{filter.fp_sfkp}
- </if>
- <!-- 发票种类invoiceLine-->
- <if test="filter.invoiceLine!=null">
- AND invoiceLine=#{filter.invoiceLine}
- </if>
- <!-- 财务月份-->
- <if test="filter.cwrq!=null">
- AND cwrq=#{filter.cwrq}
- </if>
- <!-- 开票状态status-->
- <if test="filter.status!=null">
- AND cl_cljg=#{filter.status}
- </if>
- <!-- 收费人员-->
- <if test="filter.sfry!=null">
- AND sfry=#{filter.sfry}
- </if>
- <if test="filter.tjsj_type!=null and filter.tjsj_type==1">
- <!--收费日期-->
- <if test="filter.start_tjsj!=null and filter.end_tjsj!=null">
- AND sfrq BETWEEN #{filter.start_tjsj} AND
- #{filter.end_tjsj}
- </if>
- </if>
- <if test="filter.tjsj_type!=null and filter.tjsj_type==2">
- <!--开票日期-->
- <if test="filter.start_tjsj!=null and filter.end_tjsj!=null">
- AND invoicetime BETWEEN to_char(#{filter.start_tjsj},'yyyy-MM-dd HH:mm:ss') AND to_char(#{filter.end_tjsj},'yyyy-MM-dd HH:mm:ss')
- </if>
- </if>
- </sql>
- <!--自定义用户开票明细分页查询 -->
- <select id="getPage" resultType="com.tofly.feesapi.dzfp.entity.vo.EiFpkjRequest_select">
- <include refid="querySql"/>
- </select>
- <select id="getListSum" resultType="com.tofly.feesapi.dzfp.entity.vo.EiFpkjRequest_sum">
- <include refid="querySql_Sum"/>
- </select>
- <select id="getList" resultType="com.tofly.feesapi.dzfp.entity.vo.EiFpkjRequest_Excel">
- <include refid="querySql"/>
- <if test="filter.orders!=null and filter.orders.size()>0">
- ORDER BY
- <foreach collection="filter.orders" item="o" separator=",">
- <if test="o.column=='sfrq'">
- cast(sfrq as numeric)
- </if>
- <if test="o.column!='sfrq'">
- ${o.column}
- </if>
- <if test="!o.asc">DESC</if>
- </foreach>
- </if>
- </select>
- <resultMap id="eiFpkjRequestMap" type="com.tofly.feesapi.dzfp.entity.EiFpkjRequest">
- <id property="lsbh" column="LSBH"/>
- <result property="clCljg" column="CL_CLJG"/>
- <result property="clClsj" column="CL_CLSJ"/>
- <result property="clRecode" column="CL_RECODE"/>
- <result property="clRemessage" column="CL_REMESSAGE"/>
- <result property="zfZfbz" column="ZF_ZFBZ"/>
- <result property="jfPdf" column="JF_PDF"/>
- <result property="jfPdffilename" column="JF_PDFFILENAME"/>
- <result property="jfYxbz" column="JF_YXBZ"/>
- <result property="cxJfbz" column="CX_JFBZ"/>
- <result property="fpCkbz" column="FP_CKBZ"/>
- <result property="fpSfkp" column="FP_SFKP"/>
- <result property="bzGcbh" column="BZ_GCBH"/>
- <result property="fpSfHb" column="FP_SF_HB"/>
- <result property="fpHbLx" column="FP_HB_LX"/>
- <!-- <result property="Qfid" column="QFID"/>-->
- <result property="sflsbh" column="SFLSBH"/>
- <result property="ssgs" column="SSGS"/>
- <result property="yhbh" column="YHBH"/>
- <result property="cbkh" column="CBKH"/>
- <result property="cwrq" column="CWRQ"/>
- <result property="ssje" column="SSJE"/>
- <result property="sflx" column="SFLX"/>
- <result property="sfry" column="SFRY"/>
- <result property="sfrq" column="SFRQ"/>
- <result property="buyername" column="BUYERNAME"/>
- <result property="buyertaxnum" column="BUYERTAXNUM"/>
- <result property="buyertel" column="BUYERTEL"/>
- <result property="buyeraddress" column="BUYERADDRESS"/>
- <result property="buyeraccount" column="BUYERACCOUNT"/>
- <result property="buyerbank" column="BUYERBANK"/>
- <result property="salertaxnum" column="SALERTAXNUM"/>
- <result property="salertel" column="SALERTEL"/>
- <result property="saleraddress" column="SALERADDRESS"/>
- <result property="saleraccount" column="SALERACCOUNT"/>
- <result property="salerbank" column="SALERBANK"/>
- <result property="orderno" column="ORDERNO"/>
- <result property="invoicedate" column="INVOICEDATE"/>
- <result property="invoicecode" column="INVOICECODE"/>
- <result property="invoicenum" column="INVOICENUM"/>
- <result property="redreason" column="REDREASON"/>
- <result property="billinfono" column="BILLINFONO"/>
- <result property="departmentid" column="DEPARTMENTID"/>
- <result property="clerkid" column="CLERKID"/>
- <result property="remark" column="REMARK"/>
- <result property="extaxamount" column="EXTAXAMOUNT"/>
- <result property="taxamount" column="TAXAMOUNT"/>
- <result property="orderamount" column="ORDERAMOUNT"/>
- <result property="checker" column="CHECKER"/>
- <result property="payee" column="PAYEE"/>
- <result property="clerk" column="CLERK"/>
- <result property="listflag" column="LISTFLAG"/>
- <result property="listname" column="LISTNAME"/>
- <result property="pushmode" column="PUSHMODE"/>
- <result property="buyerphone" column="BUYERPHONE"/>
- <result property="email" column="EMAIL"/>
- <result property="invoicetype" column="INVOICETYPE"/>
- <result property="invoiceline" column="INVOICELINE"/>
- <result property="specificfactor" column="SPECIFICFACTOR"/>
- <result property="proxyinvoiceflag" column="PROXYINVOICEFLAG"/>
- <result property="invoiceserialnum" column="INVOICESERIALNUM"/>
- <result property="invoicetime" column="INVOICETIME"/>
- <result property="status" column="STATUS"/>
- <result property="statusmsg" column="STATUSMSG"/>
- <result property="failcause" column="FAILCAUSE"/>
- <result property="pdfurl" column="PDFURL"/>
- <result property="clLock" column="CL_LOCK"/>
- </resultMap>
- <!-- 水费发票查询-->
- <select id="getSfPage" resultType="com.tofly.feesapi.dzfp.entity.vo.EiFpkjRequest_select">
- <include refid="querySql_sf"></include>
- </select>
- <!-- 发票查询-->
- <select id="getFpPage" resultType="com.tofly.feesapi.dzfp.entity.vo.EiFpkjRequest_select">
- <include refid="querySql_fp"/>
- </select>
- <select id="getZnjPage" resultType="com.tofly.feesapi.dzfp.entity.vo.EiFpkjRequest_select">
- <include refid="querySql_znj"/>
- </select>
- <select id="getWsfPage" resultType="com.tofly.feesapi.dzfp.entity.vo.EiFpkjRequest_select">
- <include refid="querySql_wsf"/>
- </select>
- <select id="getFprkptjList" resultType="com.tofly.feesapi.dzfp.entity.vo.EiFpkjRequestSelectTj">
- SELECT
- yhbh,
- buyerName,
- cwrq,
- sfry,
- sfrq,
- invoicetime,
- exTaxAmount,
- invoiceNum,
- invoiceLineMc,
- nvl(sum(sf),0)sf,
- nvl(sum(wsf),0)wsf,
- nvl(sum(szyf),0)szyf,
- nvl(sum(wyj),0)wyj,
- nvl(sum(ljf),0)ljf
- from ( select a.yhbh,
- a.buyerName,
- a.cwrq,
- a.sfry,
- a.sfrq,
- a.invoicetime,
- a.exTaxAmount,
- a.invoiceNum,
- (case
- when invoiceLine = 'p' then '普通电票'
- when invoiceLine = 'pc' then '数电普票'
- when invoiceLine = 'bs' then '数电专票'
- else '发票种类值不对'
- end) as invoiceLineMc,
- (case
- when goodscode = '110030101' and (instr(goodsname, '自来水') > 0 or instr(goodsname, '水费') > 0)
- then taxincludedamount
- else 0
- end) as sf,
- (case
- when goodscode = '110030101' and instr(goodsname, '污水处理费') > 0 then taxincludedamount
- else 0
- end) as wsf,
- (case
- when goodscode = '611' and (instr(goodsname, '水资源税') > 0 or instr(goodsname, '水资源费') > 0)
- then taxincludedamount
- else 0
- end) as szyf,
- (case
- when goodscode = '611' and instr(goodsname, '违约金') > 0 then taxincludedamount
- else 0
- end) as wyj,
- (case
- when goodscode = '110030101' and instr(goodsname, '垃圾费') > 0 then taxincludedamount
- else 0
- end) as ljf
- from ei_fpkj_request a
- left join ei_fpkj_mx b on a.lsbh = b.lsbh
- where cl_cljg='1'
- <if test="filter.kprqStart!=null and filter.kprqEnd!=null">
- and a.invoicetime between to_char(#{filter.kprqStart},'yyyy-MM-dd HH:mm:ss') and
- to_char(#{filter.kprqEnd},'yyyy-MM-dd HH:mm:ss')
- </if>
- <if test="filter.sfry!=null">
- and a.sfry = #{filter.sfry}
- </if>
- <if test="filter.searchText!=null">
- AND ( buyerName like '%${filter.searchText}%'
- OR yhbh like '%${filter.searchText}%'
- OR invoiceNum like '%${filter.searchText}%')
- </if>
- <if test="filter.ssgs!=null">
- AND ssgs=#{filter.ssgs}
- </if>
- <if test="filter.sspq!=null">
- AND yh_sspq=#{filter.sspq}
- </if>
- <if test="filter.invoiceType!=null">
- AND invoiceType=#{filter.invoiceType}
- </if>
- <if test="filter.invoiceLine!=null">
- AND invoiceLine=#{filter.invoiceLine}
- </if>
- <if test="filter.cwrq!=null">
- AND cwrq=#{filter.cwrq}
- </if>
- <if test="filter.isykfp!=null">
- AND isykfp=#{filter.isykfp}
- </if>
- <if test="filter.kpyw!=null">
- AND yhlx=#{filter.kpyw}
- </if>
- <if test="filter.dxh!=null">
- AND dxh=#{filter.dxh}
- </if>
- )a
- group by a.yhbh,
- a.buyerName,
- a.cwrq,
- a.sfry,
- a.sfrq,
- a.invoicetime,
- a.exTaxAmount,
- a.invoiceNum,
- a.invoiceLineMc
- </select>
- </mapper>
|