ariesy 优化sql

release
yefei 2 years ago
parent 61957266e2
commit ee9bbaa6c5
  1. 16
      dxhy-base/src/main/java/com/dxhy/base/controller/BaseInvoiceController.java
  2. 4
      dxhy-base/src/main/resources/mapper/BaseFpcjmxMapper.xml

@ -203,13 +203,17 @@ public class BaseInvoiceController extends AbstractController {
pramsMap.put("payment", map.get("payment"));
pramsMap.put("paymentStatus", map.get("paymentStatus"));
if(StringUtils.isNotEmpty(map.get("paymentDateStart").toString())) {
String paymentDateStart = DateUtils.getMorning(DateUtils.strToDate(map.get("paymentDateStart").toString()));
pramsMap.put("paymentDateStart", paymentDateStart);
if(map.get("paymentDateStart") != null) {
if (StringUtils.isNotEmpty(map.get("paymentDateStart").toString())) {
String paymentDateStart = DateUtils.getMorning(DateUtils.strToDate(map.get("paymentDateStart").toString()));
pramsMap.put("paymentDateStart", paymentDateStart);
}
}
if(StringUtils.isNotEmpty(map.get("paymentEnd").toString())) {
String paymentDateEnd = DateUtils.getNight(DateUtils.strToDate(map.get("paymentEnd").toString()));
pramsMap.put("paymentDateEnd", paymentDateEnd);
if(map.get("paymentEnd") != null) {
if (StringUtils.isNotEmpty(map.get("paymentEnd").toString())) {
String paymentDateEnd = DateUtils.getNight(DateUtils.strToDate(map.get("paymentEnd").toString()));
pramsMap.put("paymentDateEnd", paymentDateEnd);
}
}
pramsMap.put("voucherNumber", map.get("voucherNumber"));

@ -55,7 +55,7 @@
from t_dx_record_invoice t
where t.gf_tax_no = #{gfsh}
and (invoice_type in('01','03','08','14','31','283','161','183','185') or (invoice_type ='32' and lq_tdyslxDm='08'))
and t.create_date = #{cjrq}
and DATE_FORMAT(t.create_date,'%Y-%m-%d') = #{cjrq}
<if test="ycpbz != null and ycpbz != '' and ycpbz != 'null' ">
and t.invoice_status !='0'
</if>
@ -71,7 +71,7 @@
from t_dx_record_invoice t
where t.gf_tax_no = #{gfsh}
and (invoice_type in('01','03','08','14','31','283','161','183','185') or (invoice_type ='32' and lq_tdyslxDm='08'))
and t.create_date between #{cjrq} and #{cjrq}
and to_char(t.create_date,'yyyy-mm-dd') between #{cjrq} and #{cjrq}
<if test="ycpbz != null and ycpbz != '' and ycpbz != 'null' ">
and t.invoice_status !='0'
</if>

Loading…
Cancel
Save