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 SELECT sum(ssje) ssje, sum(exTaxAmount) exTaxAmount, sum(taxAmount) taxAmount , sum(orderAmount) orderAmount from ei_fpkj_request WHERE 1=1 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}%') AND ssgs=#{filter.ssgs} AND yh_sspq=#{filter.sspq} AND invoiceType=#{filter.invoiceType} AND fp_sfkp in ('1','2') AND fp_sfkp='0' AND invoiceLine=#{filter.invoiceLine} AND cwrq=#{filter.cwrq} AND cl_cljg=#{filter.status} AND sfry=#{filter.sfry} AND sfrq BETWEEN #{filter.start_tjsj} AND #{filter.end_tjsj} 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') AND isykfp=#{filter.isykfp} AND yhlx=#{filter.kpyw} AND dxh=#{filter.dxh} 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' 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}%') AND ssgs=#{filter.ssgs} AND yh_sspq=#{filter.sspq} AND invoiceType=#{filter.invoiceType} AND fp_sfkp=#{filter.fp_sfkp} AND invoiceLine=#{filter.invoiceLine} AND cwrq=#{filter.cwrq} AND cl_cljg=#{filter.status} AND sfry=#{filter.sfry} AND sfrq BETWEEN #{filter.start_tjsj} AND #{filter.end_tjsj} 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') 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' 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}%') AND ssgs=#{filter.ssgs} AND yh_sspq=#{filter.sspq} AND invoiceType=#{filter.invoiceType} AND fp_sfkp=#{filter.fp_sfkp} AND invoiceLine=#{filter.invoiceLine} AND cwrq=#{filter.cwrq} AND cl_cljg=#{filter.status} AND sfry=#{filter.sfry} AND sfrq BETWEEN #{filter.start_tjsj} AND #{filter.end_tjsj} 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') 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' 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}%') AND ssgs=#{filter.ssgs} AND yh_sspq=#{filter.sspq} AND invoiceType=#{filter.invoiceType} AND fp_sfkp=#{filter.fp_sfkp} AND invoiceLine=#{filter.invoiceLine} AND cwrq=#{filter.cwrq} AND cl_cljg=#{filter.status} AND sfry=#{filter.sfry} AND sfrq BETWEEN #{filter.start_tjsj} AND #{filter.end_tjsj} 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') 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' 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}%') AND ssgs=#{filter.ssgs} AND yh_sspq=#{filter.sspq} AND invoiceType=#{filter.invoiceType} AND fp_sfkp=#{filter.fp_sfkp} AND invoiceLine=#{filter.invoiceLine} AND cwrq=#{filter.cwrq} AND cl_cljg=#{filter.status} AND sfry=#{filter.sfry} AND sfrq BETWEEN #{filter.start_tjsj} AND #{filter.end_tjsj} 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')