Переглянути джерело

班结报表,班结功能

MS-QJVSRANLTYEO\Administrator 4 роки тому
батько
коміт
ab69535e71
25 змінених файлів з 494 додано та 158 видалено
  1. 82 21
      Yijia-SaaS/yijia-station/src/main/java/com/yijia/station/controller/StationClassStructureController.java
  2. 13 14
      Yijia-SaaS/yijia-station/src/main/java/com/yijia/station/domain/PayOrder.java
  3. 62 25
      Yijia-SaaS/yijia-station/src/main/java/com/yijia/station/domain/StationClassStructure.java
  4. 45 49
      Yijia-SaaS/yijia-station/src/main/java/com/yijia/station/domain/StationClassesSummary.java
  5. 6 7
      Yijia-SaaS/yijia-station/src/main/java/com/yijia/station/domain/StationInfo.java
  6. 10 0
      Yijia-SaaS/yijia-station/src/main/java/com/yijia/station/mapper/StationClassStructureMapper.java
  7. 10 0
      Yijia-SaaS/yijia-station/src/main/java/com/yijia/station/service/IStationClassStructureService.java
  8. 10 0
      Yijia-SaaS/yijia-station/src/main/java/com/yijia/station/service/impl/StationClassStructureServiceImpl.java
  9. 46 1
      Yijia-SaaS/yijia-station/src/main/resources/mapper/station/PayOrderMapper.xml
  10. 28 4
      Yijia-SaaS/yijia-station/src/main/resources/mapper/station/StationClassStructureMapper.xml
  11. 1 1
      Yijia-SaaS/yijia-station/src/main/resources/mapper/station/StationClassesSummaryMapper.xml
  12. BIN
      Yijia-SaaS/yijia-station/target/classes/com/yijia/station/controller/StationClassStructureController.class
  13. BIN
      Yijia-SaaS/yijia-station/target/classes/com/yijia/station/domain/PayOrder.class
  14. BIN
      Yijia-SaaS/yijia-station/target/classes/com/yijia/station/domain/StationClassStructure.class
  15. BIN
      Yijia-SaaS/yijia-station/target/classes/com/yijia/station/domain/StationInfo.class
  16. BIN
      Yijia-SaaS/yijia-station/target/classes/com/yijia/station/mapper/StationClassStructureMapper.class
  17. BIN
      Yijia-SaaS/yijia-station/target/classes/com/yijia/station/service/IStationClassStructureService.class
  18. BIN
      Yijia-SaaS/yijia-station/target/classes/com/yijia/station/service/impl/StationClassStructureServiceImpl.class
  19. 29 14
      Yijia-SaaS/yijia-station/target/classes/mapper/station/PayOrderMapper.xml
  20. 148 22
      Yijia-SaaS/yijia-station/target/classes/mapper/station/StationClassStructureMapper.xml
  21. 1 0
      Yijia-SaaS/yijia-station/target/classes/mapper/station/StationDeviceManageMapper.xml
  22. 1 0
      Yijia-SaaS/yijia-station/target/classes/mapper/station/StationInfoMapper.xml
  23. 1 0
      Yijia-SaaS/yijia-station/target/classes/mapper/station/StationOilPriceAdjustMapper.xml
  24. 1 0
      Yijia-SaaS/yijia-station/target/classes/mapper/station/StationPersonnelMapper.xml
  25. BIN
      Yijia-SaaS/yijia-station/target/yijia-station-1.0.1.jar

+ 82 - 21
Yijia-SaaS/yijia-station/src/main/java/com/yijia/station/controller/StationClassStructureController.java

@@ -1,7 +1,10 @@
 package com.yijia.station.controller;
 
+import java.math.BigDecimal;
+import java.text.DateFormat;
 import java.text.ParseException;
 import java.text.SimpleDateFormat;
+import java.util.ArrayList;
 import java.util.Date;
 import java.util.List;
 
@@ -43,6 +46,7 @@ public class StationClassStructureController extends BaseController
     private IStationClassStructureService stationClassStructureService;
     @Autowired
     private IPayOrderService payOrderService;
+    @Autowired
     private IStationClassesSummaryService stationClassesSummaryService;
     /**
      * 查询班结管理列表
@@ -60,7 +64,10 @@ public class StationClassStructureController extends BaseController
     @GetMapping("/listPersonnelStructure")
     public TableDataInfo listPersonnelStructure(StationClassStructure stationClassStructure)
     {
-        List<StationClassStructure> list = stationClassStructureService.listPersonnelStructure(stationClassStructure);
+        List<StationClassStructure> list = new ArrayList<>();
+        if(stationClassStructure!=null &&stationClassStructure.getStationId()!=null ){
+          list = stationClassStructureService.listPersonnelStructure(stationClassStructure);
+        }
         return getTable(list);
     }
 
@@ -68,9 +75,29 @@ public class StationClassStructureController extends BaseController
     @GetMapping("/listOilStructure")
     public TableDataInfo listOilStructure(StationClassStructure stationClassStructure)
     {
-        List<StationClassStructure> list = stationClassStructureService.listOilStructure(stationClassStructure);
+        List<StationClassStructure> list = new ArrayList<>();
+        if(stationClassStructure!=null &&stationClassStructure.getStationId()!=null ){
+            list = stationClassStructureService.listOilStructure(stationClassStructure);
+        }
+        return getTable(list);
+    }
+    @PreAuthorize("@ss.hasPermi('station:structure:listPersonnelPayStructure')")
+    @GetMapping("/listPersonnelPayStructure")
+    public TableDataInfo listPersonnelPayStructure(StationClassStructure stationClassStructure)
+    {
+        List<StationClassStructure> list = new ArrayList<>();
+        if(stationClassStructure!=null &&stationClassStructure.getStationId()!=null ){
+            list = stationClassStructureService.listPersonnelPayStructure(stationClassStructure);
+        }
         return getTable(list);
     }
+    @PreAuthorize("@ss.hasPermi('station:structure:listClass')")
+    @GetMapping("/listClass")
+    public AjaxResult listClass(StationClassStructure stationClassStructure)
+    {
+
+        return AjaxResult.success(stationClassStructureService.listClass(stationClassStructure));
+    }
     /**
      * 导出班结管理列表
      */
@@ -117,8 +144,8 @@ public class StationClassStructureController extends BaseController
         Date date= new Date();
         StationClassStructure classesStructure =new StationClassStructure();
         classesStructure.setStationId(stationId);
-        SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMdd");
-        String no=sdf.parse(String.valueOf(date)).toString();
+        DateFormat dFormat = new SimpleDateFormat("yyyyMMdd");
+        String no=dFormat.format(date);
         classesStructure.setLikeClassStructureNo(no);
         //查询班结信息中本日班结次数
         StationClassStructure structure =stationClassStructureService.selectDistnctClassStructure(classesStructure);
@@ -139,13 +166,16 @@ public class StationClassStructureController extends BaseController
             //获取上次班结时间
             PayOrder order=new PayOrder();
             order.setStationId(stationId);
-            beginTime=sss.getClassStructureDate().toString();
-            order.setBeginTime(sss.getClassStructureDate().toString());
-            order.setEndTime(date.toString());
+            DateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+            beginTime= dateFormat.format(sss.getClassStructureDate());
+            order.setBeginTime(beginTime);
+            order.setEndTime( dateFormat.format(date));
+            SimpleDateFormat dfe = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
             List<PayOrder> list = payOrderService.selectPayOrderList(order);
             for(PayOrder payOrder:list){
                 StationClassStructure stationclass =new StationClassStructure();
                 stationclass.setStationId(payOrder.getStationId());
+                stationclass.setClassStartDate(dfe.parse(beginTime));
                 stationclass.setClassStructureMan(username);
                 stationclass.setClassStructureNo(no);
                 stationclass.setClassStructureDate(date);
@@ -182,15 +212,16 @@ public class StationClassStructureController extends BaseController
                 stationclass.setConsumerId(payOrder.getConsumerId());
                 stationclass.setConsumer(payOrder.getConsumer());
                 stationclass.setAmt(payOrder.getAmt());
-                stationclass.setOrderLiters(payOrder.getOrderLiters());
+                if(payOrder.getOrderLiters()!=null){
+                    stationclass.setOrderLiters(payOrder.getOrderLiters());
+                }
                 stationclass.setPayWay(payOrder.getPayWay());
                 stationclass.setPayType(payOrder.getPayType());
                 stationclass.setPayDate(payOrder.getPayDate());
                 stationclass.setOilPersonnel(payOrder.getOilPersonnel());
                 stationclass.setOrderType(payOrder.getOrderType());
-                //stationclass.setOilType();
-                //stationclass.getPrintNum();
-                //stationclass
+                stationclass.setOilType(payOrder.getOilType());
+                stationclass.setPrintNum(payOrder.getPrintCount());
                 i= stationClassStructureService.insertStationClassStructure(stationclass);
             }
         }
@@ -200,18 +231,48 @@ public class StationClassStructureController extends BaseController
         StationClassStructure stationclass = stationClassStructureService.selectSummyClassStructure(scs);
         StationClassesSummary stationClassesSummary =new StationClassesSummary();
         stationClassesSummary.setClassesNo(stationclass.getClassStructureNo());
-        stationClassesSummary.setStartDate(stationclass.getClassStartDate());
-        stationClassesSummary.setEndDate(stationclass.getClassStructureDate());
+        if(stationclass.getClassStartDate()!=null){
+            stationClassesSummary.setStartDate(stationclass.getClassStartDate());
+        }
+        if(stationclass.getClassStructureDate()!=null){
+            stationClassesSummary.setEndDate(stationclass.getClassStructureDate());
+        }
+
         stationClassesSummary.setStationName(stationclass.getStationName());
-        stationClassesSummary.setStationId(stationclass.getStationId());
-        stationClassesSummary.setOrderNum(Long.valueOf(stationclass.getNum()));
-        stationClassesSummary.setPrintNum(stationclass.getPrintNum());
-        stationClassesSummary.setSaleLiters(String.valueOf(stationclass.getOrderLiters()));
-        stationClassesSummary.setSaleAmt(stationclass.getAmt());
-        stationClassesSummary.setZfbAmt(Double.valueOf("0"));
-        stationClassesSummary.setDzkAmt(Double.valueOf(0));
+        if(stationclass.getStationId()!=null){
+            stationClassesSummary.setStationId(stationclass.getStationId());
+        }
+       if(stationclass.getNum()!=null){
+           stationClassesSummary.setOrderNum(Long.valueOf(stationclass.getNum()));
+       }
+        if(stationclass.getPrintNum()!=null){
+            stationClassesSummary.setPrintNum(stationclass.getPrintNum());
+        }
+        if(stationclass.getOrderLiters()!=null){
+            stationClassesSummary.setSaleLiters(stationclass.getOrderLiters());
+        }
+        if(stationclass.getAmt()!=null){
+            stationClassesSummary.setSaleAmt(stationclass.getAmt());
+        }
+        if(stationclass.getDzkAmt()!=null){
+            stationClassesSummary.setDzkAmt(stationclass.getDzkAmt());
+        }else{
+            stationClassesSummary.setDzkAmt(BigDecimal.valueOf(0));
+        }
+        if(stationclass.getZfbAmt()!=null){
+            stationClassesSummary.setZfbAmt(stationclass.getZfbAmt());
+        }else{
+            stationClassesSummary.setZfbAmt(BigDecimal.valueOf(0));
+        }
+
+        if(stationclass.getWxAmt()!=null){
+            stationClassesSummary.setWxAmt(stationclass.getWxAmt());
+        }else{
+            stationClassesSummary.setWxAmt(BigDecimal.valueOf(0));
+        }
         stationClassesSummary.setClassesMan(stationclass.getClassStructureMan());
-        i = stationClassesSummaryService.insertStationClassesSummary(stationClassesSummary);
+        i=stationClassesSummaryService.insertStationClassesSummary(stationClassesSummary);
+
         return toAjax(i);
 
     }

+ 13 - 14
Yijia-SaaS/yijia-station/src/main/java/com/yijia/station/domain/PayOrder.java

@@ -63,11 +63,11 @@ public class PayOrder extends BaseEntity
 
     /** 加油升数 */
     @Excel(name = "加油升数")
-    private Long orderLiters;
+    private BigDecimal orderLiters;
 
     /** 实收金额 */
     @Excel(name = "实收金额")
-    private Long amt;
+    private BigDecimal amt;
 
     /** 应收金额 */
     @Excel(name = "应收金额")
@@ -296,25 +296,24 @@ public class PayOrder extends BaseEntity
     {
         return oilType;
     }
-    public void setOrderLiters(Long orderLiters) 
-    {
-        this.orderLiters = orderLiters;
-    }
 
-    public Long getOrderLiters() 
-    {
+    public BigDecimal getOrderLiters() {
         return orderLiters;
     }
-    public void setAmt(Long amt) 
-    {
-        this.amt = amt;
+
+    public void setOrderLiters(BigDecimal orderLiters) {
+        this.orderLiters = orderLiters;
     }
 
-    public Long getAmt() 
-    {
+    public BigDecimal getAmt() {
         return amt;
     }
-    public void setReceivableAmt(BigDecimal receivableAmt) 
+
+    public void setAmt(BigDecimal amt) {
+        this.amt = amt;
+    }
+
+    public void setReceivableAmt(BigDecimal receivableAmt)
     {
         this.receivableAmt = receivableAmt;
     }

+ 62 - 25
Yijia-SaaS/yijia-station/src/main/java/com/yijia/station/domain/StationClassStructure.java

@@ -59,11 +59,11 @@ public class StationClassStructure extends BaseEntity
 
     /** 金额 */
     @Excel(name = "金额")
-    private Long amt;
+    private BigDecimal amt;
 
     /** 加油升数 */
     @Excel(name = "加油升数")
-    private Long orderLiters;
+    private BigDecimal  orderLiters;
 
     /** 支付类型 sxf */
     @Excel(name = "支付类型 sxf")
@@ -74,8 +74,8 @@ public class StationClassStructure extends BaseEntity
     private String payWay;
 
     /** 支付时间 */
-    @JsonFormat(pattern = "yyyy-MM-dd")
-    @Excel(name = "支付时间", width = 30, dateFormat = "yyyy-MM-dd")
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    @Excel(name = "支付时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
     private Date payDate;
 
     /** 加油员人名 */
@@ -95,13 +95,13 @@ public class StationClassStructure extends BaseEntity
     private String classStructureNo;
 
     /** 班结开始时间 */
-    @JsonFormat(pattern = "yyyy-MM-dd")
-    @Excel(name = "班结开始时间", width = 30, dateFormat = "yyyy-MM-dd")
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    @Excel(name = "班结开始时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
     private Date classStartDate;
 
     /** 班结时间 */
-    @JsonFormat(pattern = "yyyy-MM-dd")
-    @Excel(name = "班结时间", width = 30, dateFormat = "yyyy-MM-dd")
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    @Excel(name = "班结时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
     private Date classStructureDate;
 
     /** 班结人 */
@@ -118,6 +118,22 @@ public class StationClassStructure extends BaseEntity
     @Excel(name = "返回参数")
     private Integer num;
 
+    public BigDecimal getAmt() {
+        return amt;
+    }
+
+    public void setAmt(BigDecimal amt) {
+        this.amt = amt;
+    }
+
+    public BigDecimal getOrderLiters() {
+        return orderLiters;
+    }
+
+    public void setOrderLiters(BigDecimal orderLiters) {
+        this.orderLiters = orderLiters;
+    }
+
     public Integer getNum() {
         return num;
     }
@@ -210,7 +226,44 @@ public class StationClassStructure extends BaseEntity
     @Excel(name = "客户等级")
     private String customerGrade;
 
-    public void setId(Long id) 
+
+    /**
+     * 出参
+     * @param id
+     */
+    @Excel(name = "微信数量")
+    private Integer wxNum;
+    @Excel(name = "支付宝支付数量")
+    private Integer zfbNum;
+
+    @Excel(name = "现金支付数量")
+    private Integer xjNum;
+
+    public Integer getWxNum() {
+        return wxNum;
+    }
+
+    public void setWxNum(Integer wxNum) {
+        this.wxNum = wxNum;
+    }
+
+    public Integer getZfbNum() {
+        return zfbNum;
+    }
+
+    public void setZfbNum(Integer zfbNum) {
+        this.zfbNum = zfbNum;
+    }
+
+    public Integer getXjNum() {
+        return xjNum;
+    }
+
+    public void setXjNum(Integer xjNum) {
+        this.xjNum = xjNum;
+    }
+
+    public void setId(Long id)
     {
         this.id = id;
     }
@@ -300,24 +353,8 @@ public class StationClassStructure extends BaseEntity
     {
         return consumer;
     }
-    public void setAmt(Long amt) 
-    {
-        this.amt = amt;
-    }
 
-    public Long getAmt() 
-    {
-        return amt;
-    }
-    public void setOrderLiters(Long orderLiters) 
-    {
-        this.orderLiters = orderLiters;
-    }
 
-    public Long getOrderLiters() 
-    {
-        return orderLiters;
-    }
     public void setPayType(String payType) 
     {
         this.payType = payType;

+ 45 - 49
Yijia-SaaS/yijia-station/src/main/java/com/yijia/station/domain/StationClassesSummary.java

@@ -9,10 +9,10 @@ import com.yijia.common.annotation.Excel;
 import com.yijia.common.core.domain.BaseEntity;
 
 /**
- * 【请填写功能名称】对象 station_classes_summary
+ * 班结汇总对象 station_classes_summary
  * 
  * @author yijia
- * @date 2020-12-28
+ * @date 2021-01-12
  */
 public class StationClassesSummary extends BaseEntity
 {
@@ -29,13 +29,13 @@ public class StationClassesSummary extends BaseEntity
     private String likeClassesNo;
 
     /** 班次开始时间 */
-    @JsonFormat(pattern = "yyyy-MM-dd")
-    @Excel(name = "班次开始时间", width = 30, dateFormat = "yyyy-MM-dd")
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    @Excel(name = "班次开始时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
     private Date startDate;
 
     /** 班次结束时间 */
-    @JsonFormat(pattern = "yyyy-MM-dd")
-    @Excel(name = "班次结束时间", width = 30, dateFormat = "yyyy-MM-dd")
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    @Excel(name = "班次结束时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
     private Date endDate;
 
     /** 油站id */
@@ -56,7 +56,7 @@ public class StationClassesSummary extends BaseEntity
 
     /** 销量L */
     @Excel(name = "销量L")
-    private String saleLiters;
+    private BigDecimal saleLiters;
 
     /** 销售额元 */
     @Excel(name = "销售额元")
@@ -78,47 +78,8 @@ public class StationClassesSummary extends BaseEntity
     @Excel(name = "班结人")
     private String classesMan;
 
-    public BigDecimal getSaleAmt() {
-        return saleAmt;
-    }
-
-    public void setSaleAmt(BigDecimal saleAmt) {
-        this.saleAmt = saleAmt;
-    }
-
-    public BigDecimal getWxAmt() {
-        return wxAmt;
-    }
-
-    public void setWxAmt(BigDecimal wxAmt) {
-        this.wxAmt = wxAmt;
-    }
-
-    public BigDecimal getZfbAmt() {
-        return zfbAmt;
-    }
-
-    public void setZfbAmt(BigDecimal zfbAmt) {
-        this.zfbAmt = zfbAmt;
-    }
-
-    public BigDecimal getDzkAmt() {
-        return dzkAmt;
-    }
-
-    public void setDzkAmt(BigDecimal dzkAmt) {
-        this.dzkAmt = dzkAmt;
-    }
-
-    public String getLikeClassesNo() {
-        return likeClassesNo;
-    }
-
-    public void setLikeClassesNo(String likeClassesNo) {
-        this.likeClassesNo = likeClassesNo;
-    }
 
-    public void setId(Long id)
+    public void setId(Long id) 
     {
         this.id = id;
     }
@@ -190,16 +151,51 @@ public class StationClassesSummary extends BaseEntity
     {
         return printNum;
     }
-    public void setSaleLiters(String saleLiters) 
+    public void setSaleLiters(BigDecimal saleLiters) 
     {
         this.saleLiters = saleLiters;
     }
 
-    public String getSaleLiters() 
+    public BigDecimal getSaleLiters() 
     {
         return saleLiters;
     }
+    public void setSaleAmt(BigDecimal saleAmt) 
+    {
+        this.saleAmt = saleAmt;
+    }
+
+    public BigDecimal getSaleAmt() 
+    {
+        return saleAmt;
+    }
+    public void setWxAmt(BigDecimal wxAmt) 
+    {
+        this.wxAmt = wxAmt;
+    }
 
+    public BigDecimal getWxAmt() 
+    {
+        return wxAmt;
+    }
+    public void setZfbAmt(BigDecimal zfbAmt) 
+    {
+        this.zfbAmt = zfbAmt;
+    }
+
+    public BigDecimal getZfbAmt() 
+    {
+        return zfbAmt;
+    }
+    public void setDzkAmt(BigDecimal dzkAmt) 
+    {
+        this.dzkAmt = dzkAmt;
+    }
+
+    public BigDecimal getDzkAmt() 
+    {
+        return dzkAmt;
+    }
     public void setClassesMan(String classesMan) 
     {
         this.classesMan = classesMan;

+ 6 - 7
Yijia-SaaS/yijia-station/src/main/java/com/yijia/station/domain/StationInfo.java

@@ -60,7 +60,7 @@ public class StationInfo extends BaseEntity
 
     /** 商户编码(随行付商户码) */
     @Excel(name = "商户编码", readConverterExp = "随=行付商户码")
-    private Long mno;
+    private String mno;
 
     public void setStationId(Long stationId) 
     {
@@ -161,16 +161,15 @@ public class StationInfo extends BaseEntity
     {
         return stationLatitude;
     }
-    public void setMno(Long mno) 
-    {
-        this.mno = mno;
-    }
 
-    public Long getMno() 
-    {
+    public String getMno() {
         return mno;
     }
 
+    public void setMno(String mno) {
+        this.mno = mno;
+    }
+
     @Override
     public String toString() {
         return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)

+ 10 - 0
Yijia-SaaS/yijia-station/src/main/java/com/yijia/station/mapper/StationClassStructureMapper.java

@@ -93,4 +93,14 @@ public interface StationClassStructureMapper
      * @return
      */
     StationClassStructure selectSummyClassStructure(StationClassStructure scs);
+
+    /**
+     * 按员工支付方式汇总班结数据
+     * @param stationClassStructure
+     * @return
+     */
+    List<StationClassStructure> listPersonnelPayStructure(StationClassStructure stationClassStructure);
+/*获取当前人班结信息
+ */
+    StationClassStructure listClass(StationClassStructure stationClassStructure);
 }

+ 10 - 0
Yijia-SaaS/yijia-station/src/main/java/com/yijia/station/service/IStationClassStructureService.java

@@ -93,4 +93,14 @@ public interface IStationClassStructureService
      * @return
      */
     StationClassStructure selectSummyClassStructure(StationClassStructure scs);
+
+    /**
+     * 根据员工/支付方式汇总班结数据
+     * @param stationClassStructure
+     * @return
+     */
+    List<StationClassStructure> listPersonnelPayStructure(StationClassStructure stationClassStructure);
+
+
+    public StationClassStructure listClass(StationClassStructure stationClassStructure);
 }

+ 10 - 0
Yijia-SaaS/yijia-station/src/main/java/com/yijia/station/service/impl/StationClassStructureServiceImpl.java

@@ -141,4 +141,14 @@ public class StationClassStructureServiceImpl implements IStationClassStructureS
         return stationClassStructureMapper.selectSummyClassStructure(scs);
     }
 
+    @Override
+    public List<StationClassStructure> listPersonnelPayStructure(StationClassStructure stationClassStructure) {
+        return stationClassStructureMapper.listPersonnelPayStructure(stationClassStructure);
+    }
+
+    @Override
+    public StationClassStructure listClass(StationClassStructure stationClassStructure) {
+        return stationClassStructureMapper.listClass(stationClassStructure);
+    }
+
 }

+ 46 - 1
Yijia-SaaS/yijia-station/src/main/resources/mapper/station/PayOrderMapper.xml

@@ -99,7 +99,52 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <include refid="selectPayOrderVo"/>
         where order_id = #{orderId}
     </select>
-        
+    <select id="selectDaySources" parameterType="Long" resultMap="PayOrderResult">
+        SELECT SUM(amt) as amt,sum(order_liters) as order_liters
+        from pay_order
+        <where>
+            <if test="createdDate != null "> and created_date like concat(#{createdDate}, '%') </if>
+            <if test="beginTime != null and beginTime != ''"><!-- 开始时间检索 -->
+                AND date_format(created_date,'%y-%m-%d %H:%i:%s') &gt;= date_format(#{beginTime},'%y-%m-%d %H:%i:%s')
+            </if>
+            <if test="endTime != null and endTime != ''"><!-- 结束时间检索 -->
+                AND date_format(created_date,'%y-%m-%d %H:%i:%s') &lt;= date_format(#{endTime},'%y-%m-%d %H:%i:%s')
+            </if>
+        </where>
+    </select>
+    <select id="selectOilTypeSources" parameterType="Long" resultMap="PayOrderResult">
+        SELECT SUM(amt) as amt,sum(order_liters) as order_liters, oil_type
+        from pay_order
+        <where>
+            <if test="createdDate != null "> and created_date = #{createdDate}</if>
+            <if test="beginTime != null and beginTime != ''"><!-- 开始时间检索 -->
+                AND date_format(created_date,'%y-%m-%d %H:%i:%s') &gt;= date_format(#{beginTime},'%y-%m-%d %H:%i:%s')
+            </if>
+            <if test="endTime != null and endTime != ''"><!-- 结束时间检索 -->
+                AND date_format(created_date,'%y-%m-%d %H:%i:%s') &lt;= date_format(#{endTime},'%y-%m-%d %H:%i:%s')
+            </if>
+        </where>
+        GROUP BY oil_type
+    </select>
+    <select id="selectOverViewData" parameterType="Long" resultMap="PayOrderResult">
+        SELECT SUM(wx_amt) as wx_amt,sum(zfb_amt) as zfb_amt, sum(pos_amt) as pos_amt, sum(xj_amt) as xj_amt,sum(didi_app_amt) as didi_app_amt,sum(ty_app_amt) as ty_app_amt,sum(other_amt) as other_amt,sum(member_amt) as member_amt
+        from pay_order
+        <where>
+            <if test="createdDate != null "> and created_date = #{createdDate}</if>
+            <if test="beginTime != null and beginTime != ''"><!-- 开始时间检索 -->
+                AND date_format(created_date,'%y-%m-%d %H:%i:%s') &gt;= date_format(#{beginTime},'%y-%m-%d %H:%i:%s')
+            </if>
+            <if test="endTime != null and endTime != ''"><!-- 结束时间检索 -->
+                AND date_format(created_date,'%y-%m-%d %H:%i:%s') &lt;= date_format(#{endTime},'%y-%m-%d %H:%i:%s')
+            </if>
+        </where>
+    </select>
+    <select id="selectDayReport" parameterType="Long" resultMap="PayOrderResult">
+        SELECT date_format( b.pay_date, '%Y-%m-%d' ) as pay_date,sum(b.amt) as amt,sum(b.qyamt) as qy_amt, sum(b.cyamt) as cy_amt,sum(b.order_liters) as order_liters ,count(b.order_no) order_no ,sum(b.member_amt) as menber_amt
+        from (SELECT a.*,(SELECT sum(amt) as qyamt from pay_order where order_no=a.order_no and oil_type=2) as qyamt , (SELECT sum(amt) as qyamt from pay_order where order_no=a.order_no and oil_type=1) as cyamt
+        from pay_order a) b
+        GROUP BY  date_format( pay_date, '%Y-%m-%d' )
+    </select>
     <insert id="insertPayOrder" parameterType="PayOrder" useGeneratedKeys="true" keyProperty="orderId">
         insert into pay_order
         <trim prefix="(" suffix=")" suffixOverrides=",">

+ 28 - 4
Yijia-SaaS/yijia-station/src/main/resources/mapper/station/StationClassStructureMapper.xml

@@ -48,6 +48,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <result property="customerPhone"    column="customer_phone"    />
         <result property="customerGrade"    column="customer_grade"    />
         <result property="num"    column="num"    />
+        <result property="wxNum"    column="wx_num"    />
+        <result property="zfbNum"    column="zfb_num"    />
+        <result property="xjNum"    column="xj_num"    />
     </resultMap>
 
     <sql id="selectStationClassStructureVo">
@@ -103,11 +106,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     </select>
 
     <select id="listPersonnelStructure" parameterType="StationClassStructure" resultMap="StationClassStructureResult">
-        SELECT a.oil_personnel,b.gun_no as oil_gun,ROUND(SUM(a.amt),2) as amt,ROUND(SUM(order_liters),2) as order_liters,COUNT(order_no) as order_no
+        SELECT a.oil_personnel,GROUP_CONCAT(DISTINCT b.gun_no) as oil_gun,ROUND(SUM(a.amt),2) as amt,ROUND(SUM(order_liters),2) as order_liters,COUNT(order_no) as order_no
         from station_class_structure a JOIN station_personnel b on a.oil_personnel =b.personnel_name
         and a.station_id = b.station_id
         <where>
             <if test="stationId != null "> and a.station_id = #{stationId}</if>
+            <if test="classStructureNo != null and classStructureNo != ''"> and class_structure_no = #{classStructureNo}</if>
         </where>
         GROUP BY a.oil_personnel,b.gun_no
     </select>
@@ -117,6 +121,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         from station_class_structure a
         <where>
             <if test="stationId != null "> and a.station_id = #{stationId}</if>
+            <if test="classStructureNo != null and classStructureNo != ''"> and class_structure_no = #{classStructureNo}</if>
         </where>
         GROUP BY a.oil_name
     </select>
@@ -124,7 +129,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         select id, station_id, order_no, oil_gun, oil_name, consumer_id, consumer, amt, station_name, order_liters, pay_type, pay_way, pay_date, oil_personnel, order_type, oil_type, print_num, class_structure_no, class_structure_date, class_structure_man, oils
          from station_class_structure
        	 where id = (
-            SELECT MAX(id) from station_class_structurew
+            SELECT MAX(id) from station_class_structure
             <where>
                 <if test="stationId != null "> and station_id = #{stationId}</if>
             </where>
@@ -136,11 +141,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         where id = #{id}
     </select>
     <select id="selectDistnctClassStructure" parameterType="StationClassStructure" resultMap="StationClassStructureResult">
-      select countselect count(DISTINCT class_structure_no) as num
+      select count(DISTINCT class_structure_no) as num
             from station_class_structure
         <where>
             <if test="stationId != null and stationId != ''"> and station_id = #{stationId}</if>
-            <if test="likeClassStructureNo != null  and likeClassStructureNo != ''"> class_structure_no like concat( #{likeClassStructureNo}, '%') </if>
+            <if test="likeClassStructureNo != null  and likeClassStructureNo != ''">  and class_structure_no like concat( #{likeClassStructureNo}, '%') </if>
         </where>
     </select>
     <!--根据班次号汇总班结数据-->
@@ -149,10 +154,29 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         sum(order_liters) as order_liters,sum(amt) as amt,class_structure_man
         from station_class_structure
         <where>
+            <if test="stationId != null and stationId != ''"> and station_id = #{stationId}</if>
             <if test="classStructureNo != null and classStructureNo != ''"> and class_structure_no = #{classStructureNo}</if>
         </where>
         GROUP BY class_structure_no,class_start_date,station_id,station_name,class_structure_date,class_structure_man
     </select>
+
+    <!--按员工/支付方式汇总数据-->
+    <select id="listPersonnelPayStructure" parameterType="StationClassStructure" resultMap="StationClassStructureResult">
+        SELECT oil_personnel,GROUP_CONCAT(DISTINCT oil_gun) oil_gun,count(wx_amt) wx_num,count(zfb_amt) zfb_num,count(xj_amt) xj_num,sum(discount_amt) discount_amt,SUM(discount_coupon_amt) discount_coupon_amt,SUM(wx_amt) wx_amt,SUM(zfb_amt) zfb_amt,SUM(xj_amt) xj_amt,sum(member_amt) member_amt
+        from  station_class_structure
+        <where>
+            <if test="stationId != null and stationId != ''"> and station_id = #{stationId}</if>
+            <if test="classStructureNo != null and classStructureNo != ''"> and class_structure_no = #{classStructureNo}</if>
+        </where>
+        GROUP BY oil_personnel
+    </select>
+
+    <select id="listClass" parameterType="StationClassStructure" resultMap="StationClassStructureResult">
+        SELECT *  from
+        station_class_structure
+        where id =(SELECT max(id) from station_class_structure
+            where class_structure_man =#{classStructureMan})
+    </select>
     <insert id="insertStationClassStructure" parameterType="StationClassStructure" useGeneratedKeys="true" keyProperty="id">
         insert into station_class_structure
         <trim prefix="(" suffix=")" suffixOverrides=",">

+ 1 - 1
Yijia-SaaS/yijia-station/src/main/resources/mapper/station/StationClassesSummaryMapper.xml

@@ -35,7 +35,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="stationName != null  and stationName != ''"> and station_name like concat('%', #{stationName}, '%')</if>
             <if test="orderNum != null "> and order_num = #{orderNum}</if>
             <if test="printNum != null "> and print_num = #{printNum}</if>
-            <if test="saleLiters != null  and saleLiters != ''"> and sale_liters = #{saleLiters}</if>
+            <if test="saleLiters != null "> and sale_liters = #{saleLiters}</if>
             <if test="saleAmt != null "> and sale_amt = #{saleAmt}</if>
             <if test="wxAmt != null "> and wx_amt = #{wxAmt}</if>
             <if test="zfbAmt != null "> and zfb_amt = #{zfbAmt}</if>

BIN
Yijia-SaaS/yijia-station/target/classes/com/yijia/station/controller/StationClassStructureController.class


BIN
Yijia-SaaS/yijia-station/target/classes/com/yijia/station/domain/PayOrder.class


BIN
Yijia-SaaS/yijia-station/target/classes/com/yijia/station/domain/StationClassStructure.class


BIN
Yijia-SaaS/yijia-station/target/classes/com/yijia/station/domain/StationInfo.class


BIN
Yijia-SaaS/yijia-station/target/classes/com/yijia/station/mapper/StationClassStructureMapper.class


BIN
Yijia-SaaS/yijia-station/target/classes/com/yijia/station/service/IStationClassStructureService.class


BIN
Yijia-SaaS/yijia-station/target/classes/com/yijia/station/service/impl/StationClassStructureServiceImpl.class


+ 29 - 14
Yijia-SaaS/yijia-station/target/classes/mapper/station/PayOrderMapper.xml

@@ -19,6 +19,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <result property="orderLiters"    column="order_liters"    />
         <result property="amt"    column="amt"    />
         <result property="receivableAmt"    column="receivable_amt"    />
+        <result property="receivedAmt"    column="received_amt"    />
         <result property="discountAmt"    column="discount_amt"    />
         <result property="discountCouponAmt"    column="discount_coupon_amt"    />
         <result property="discountCoupon"    column="discount_coupon"    />
@@ -31,6 +32,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <result property="otherAmt"    column="other_amt"    />
         <result property="dzkAmt"    column="dzk_amt"    />
         <result property="score"    column="score"    />
+        <result property="memberNo"    column="member_no"    />
         <result property="memberAmt"    column="member_amt"    />
         <result property="printCount"    column="print_count"    />
         <result property="payType"    column="pay_type"    />
@@ -39,12 +41,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <result property="payDate"    column="pay_date"    />
         <result property="createdDate"    column="created_date"    />
         <result property="orderType"    column="order_type"    />
-        <result property="cyAmt"    column="cy_amt"    />
-        <result property="qyAmt"    column="qy_amt"    />
+        <result property="carNo"    column="car_no"    />
+        <result property="customerPhone"    column="customer_phone"    />
+        <result property="customerGrade"    column="customer_grade"    />
     </resultMap>
 
     <sql id="selectPayOrderVo">
-        select order_id, order_no, station_id, station_name, status, consumer_id, consumer, oil_gun, oil_name, oil_pirce, oil_type, order_liters, amt, receivable_amt, discount_amt, discount_coupon_amt, discount_coupon, wx_amt, zfb_amt, pos_amt, xj_amt, didi_app_amt, ty_app_amt, other_amt, dzk_amt, score, member_amt, print_count, pay_type, pay_way, oil_personnel, pay_date, created_date, order_type from pay_order
+        select order_id, order_no, station_id, station_name, status, consumer_id, consumer, oil_gun, oil_name, oil_pirce, oil_type, order_liters, amt, receivable_amt, received_amt, discount_amt, discount_coupon_amt, discount_coupon, wx_amt, zfb_amt, pos_amt, xj_amt, didi_app_amt, ty_app_amt, other_amt, dzk_amt, score, member_no, member_amt, print_count, pay_type, pay_way, oil_personnel, pay_date, created_date, order_type, car_no, customer_phone, customer_grade from pay_order
     </sql>
 
     <select id="selectPayOrderList" parameterType="PayOrder" resultMap="PayOrderResult">
@@ -58,11 +61,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="consumer != null  and consumer != ''"> and consumer = #{consumer}</if>
             <if test="oilGun != null  and oilGun != ''"> and oil_gun = #{oilGun}</if>
             <if test="oilName != null  and oilName != ''"> and oil_name like concat('%', #{oilName}, '%')</if>
-            <if test="oilPirce != null  and oilPirce != ''"> and oil_pirce = #{oilPirce}</if>
+            <if test="oilPirce != null "> and oil_pirce = #{oilPirce}</if>
             <if test="oilType != null  and oilType != ''"> and oil_type = #{oilType}</if>
             <if test="orderLiters != null "> and order_liters = #{orderLiters}</if>
             <if test="amt != null "> and amt = #{amt}</if>
             <if test="receivableAmt != null "> and receivable_amt = #{receivableAmt}</if>
+            <if test="receivedAmt != null "> and received_amt = #{receivedAmt}</if>
             <if test="discountAmt != null "> and discount_amt = #{discountAmt}</if>
             <if test="discountCouponAmt != null "> and discount_coupon_amt = #{discountCouponAmt}</if>
             <if test="discountCoupon != null  and discountCoupon != ''"> and discount_coupon = #{discountCoupon}</if>
@@ -75,26 +79,22 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="otherAmt != null "> and other_amt = #{otherAmt}</if>
             <if test="dzkAmt != null "> and dzk_amt = #{dzkAmt}</if>
             <if test="score != null "> and score = #{score}</if>
+            <if test="memberNo != null  and memberNo != ''"> and member_no = #{memberNo}</if>
             <if test="memberAmt != null "> and member_amt = #{memberAmt}</if>
             <if test="printCount != null "> and print_count = #{printCount}</if>
             <if test="payType != null  and payType != ''"> and pay_type = #{payType}</if>
             <if test="payWay != null  and payWay != ''"> and pay_way = #{payWay}</if>
-            <if test="beginTime != null and beginTime != ''"><!-- 开始时间检索 -->
-                AND date_format(created_date,'%y-%m-%d %H:%i:%s') &gt;= date_format(#{beginTime},'%y-%m-%d %H:%i:%s')
-            </if>
-            <if test="endTime != null and endTime != ''"><!-- 结束时间检索 -->
-                AND date_format(created_date,'%y-%m-%d %H:%i:%s') &lt;= date_format(#{endTime},'%y-%m-%d %H:%i:%s')
-            </if>
-<!--            <if test="payDate != null "> and pay_date = #{payDate}</if>-->
             <if test="oilPersonnel != null  and oilPersonnel != ''"> and oil_personnel = #{oilPersonnel}</if>
             <if test="payDate != null "> and pay_date = #{payDate}</if>
             <if test="createdDate != null "> and created_date = #{createdDate}</if>
             <if test="orderType != null  and orderType != ''"> and order_type = #{orderType}</if>
-
+            <if test="carNo != null  and carNo != ''"> and car_no = #{carNo}</if>
+            <if test="customerPhone != null  and customerPhone != ''"> and customer_phone = #{customerPhone}</if>
+            <if test="customerGrade != null  and customerGrade != ''"> and customer_grade = #{customerGrade}</if>
         </where>
-        ORDER BY created_date DESC
+        order by order_id desc
     </select>
-
+    
     <select id="selectPayOrderById" parameterType="Long" resultMap="PayOrderResult">
         <include refid="selectPayOrderVo"/>
         where order_id = #{orderId}
@@ -161,6 +161,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="orderLiters != null">order_liters,</if>
             <if test="amt != null">amt,</if>
             <if test="receivableAmt != null">receivable_amt,</if>
+            <if test="receivedAmt != null">received_amt,</if>
             <if test="discountAmt != null">discount_amt,</if>
             <if test="discountCouponAmt != null">discount_coupon_amt,</if>
             <if test="discountCoupon != null">discount_coupon,</if>
@@ -173,6 +174,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="otherAmt != null">other_amt,</if>
             <if test="dzkAmt != null">dzk_amt,</if>
             <if test="score != null">score,</if>
+            <if test="memberNo != null">member_no,</if>
             <if test="memberAmt != null">member_amt,</if>
             <if test="printCount != null">print_count,</if>
             <if test="payType != null">pay_type,</if>
@@ -181,6 +183,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="payDate != null">pay_date,</if>
             <if test="createdDate != null">created_date,</if>
             <if test="orderType != null">order_type,</if>
+            <if test="carNo != null">car_no,</if>
+            <if test="customerPhone != null">customer_phone,</if>
+            <if test="customerGrade != null">customer_grade,</if>
          </trim>
         <trim prefix="values (" suffix=")" suffixOverrides=",">
             <if test="orderNo != null">#{orderNo},</if>
@@ -196,6 +201,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="orderLiters != null">#{orderLiters},</if>
             <if test="amt != null">#{amt},</if>
             <if test="receivableAmt != null">#{receivableAmt},</if>
+            <if test="receivedAmt != null">#{receivedAmt},</if>
             <if test="discountAmt != null">#{discountAmt},</if>
             <if test="discountCouponAmt != null">#{discountCouponAmt},</if>
             <if test="discountCoupon != null">#{discountCoupon},</if>
@@ -208,6 +214,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="otherAmt != null">#{otherAmt},</if>
             <if test="dzkAmt != null">#{dzkAmt},</if>
             <if test="score != null">#{score},</if>
+            <if test="memberNo != null">#{memberNo},</if>
             <if test="memberAmt != null">#{memberAmt},</if>
             <if test="printCount != null">#{printCount},</if>
             <if test="payType != null">#{payType},</if>
@@ -216,6 +223,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="payDate != null">#{payDate},</if>
             <if test="createdDate != null">#{createdDate},</if>
             <if test="orderType != null">#{orderType},</if>
+            <if test="carNo != null">#{carNo},</if>
+            <if test="customerPhone != null">#{customerPhone},</if>
+            <if test="customerGrade != null">#{customerGrade},</if>
          </trim>
     </insert>
 
@@ -235,6 +245,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="orderLiters != null">order_liters = #{orderLiters},</if>
             <if test="amt != null">amt = #{amt},</if>
             <if test="receivableAmt != null">receivable_amt = #{receivableAmt},</if>
+            <if test="receivedAmt != null">received_amt = #{receivedAmt},</if>
             <if test="discountAmt != null">discount_amt = #{discountAmt},</if>
             <if test="discountCouponAmt != null">discount_coupon_amt = #{discountCouponAmt},</if>
             <if test="discountCoupon != null">discount_coupon = #{discountCoupon},</if>
@@ -247,6 +258,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="otherAmt != null">other_amt = #{otherAmt},</if>
             <if test="dzkAmt != null">dzk_amt = #{dzkAmt},</if>
             <if test="score != null">score = #{score},</if>
+            <if test="memberNo != null">member_no = #{memberNo},</if>
             <if test="memberAmt != null">member_amt = #{memberAmt},</if>
             <if test="printCount != null">print_count = #{printCount},</if>
             <if test="payType != null">pay_type = #{payType},</if>
@@ -255,6 +267,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="payDate != null">pay_date = #{payDate},</if>
             <if test="createdDate != null">created_date = #{createdDate},</if>
             <if test="orderType != null">order_type = #{orderType},</if>
+            <if test="carNo != null">car_no = #{carNo},</if>
+            <if test="customerPhone != null">customer_phone = #{customerPhone},</if>
+            <if test="customerGrade != null">customer_grade = #{customerGrade},</if>
         </trim>
         where order_id = #{orderId}
     </update>

+ 148 - 22
Yijia-SaaS/yijia-station/target/classes/mapper/station/StationClassStructureMapper.xml

@@ -6,67 +6,112 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     
     <resultMap type="StationClassStructure" id="StationClassStructureResult">
         <result property="id"    column="id"    />
-        <result property="stationId"    column="station_id"    />
         <result property="orderNo"    column="order_no"    />
+        <result property="stationId"    column="station_id"    />
+        <result property="stationName"    column="station_name"    />
         <result property="oilGun"    column="oil_gun"    />
         <result property="oilName"    column="oil_name"    />
+        <result property="oilPirce"    column="oil_pirce"    />
+        <result property="oilType"    column="oil_type"    />
         <result property="consumerId"    column="consumer_id"    />
         <result property="consumer"    column="consumer"    />
         <result property="amt"    column="amt"    />
-        <result property="stationName"    column="station_name"    />
         <result property="orderLiters"    column="order_liters"    />
         <result property="payType"    column="pay_type"    />
         <result property="payWay"    column="pay_way"    />
         <result property="payDate"    column="pay_date"    />
         <result property="oilPersonnel"    column="oil_personnel"    />
         <result property="orderType"    column="order_type"    />
-        <result property="oilType"    column="oil_type"    />
         <result property="printNum"    column="print_num"    />
         <result property="classStructureNo"    column="class_structure_no"    />
         <result property="classStartDate"    column="class_start_date"    />
         <result property="classStructureDate"    column="class_structure_date"    />
         <result property="classStructureMan"    column="class_structure_man"    />
         <result property="oils"    column="oils"    />
+        <result property="receivableAmt"    column="receivable_amt"    />
+        <result property="receivedAmt"    column="received_amt"    />
+        <result property="discountAmt"    column="discount_amt"    />
+        <result property="discountCouponAmt"    column="discount_coupon_amt"    />
+        <result property="discountCoupon"    column="discount_coupon"    />
+        <result property="wxAmt"    column="wx_amt"    />
+        <result property="zfbAmt"    column="zfb_amt"    />
+        <result property="posAmt"    column="pos_amt"    />
+        <result property="xjAmt"    column="xj_amt"    />
+        <result property="didiAppAmt"    column="didi_app_amt"    />
+        <result property="tyAppAmt"    column="ty_app_amt"    />
+        <result property="otherAmt"    column="other_amt"    />
+        <result property="dzkAmt"    column="dzk_amt"    />
+        <result property="score"    column="score"    />
+        <result property="memberNo"    column="member_no"    />
+        <result property="memberAmt"    column="member_amt"    />
+        <result property="carNo"    column="car_no"    />
+        <result property="customerPhone"    column="customer_phone"    />
+        <result property="customerGrade"    column="customer_grade"    />
         <result property="num"    column="num"    />
+        <result property="wxNum"    column="wx_num"    />
+        <result property="zfbNum"    column="zfb_num"    />
+        <result property="xjNum"    column="xj_num"    />
     </resultMap>
 
     <sql id="selectStationClassStructureVo">
-        select id, station_id, order_no, oil_gun, oil_name, consumer_id, consumer, amt, station_name, order_liters, pay_type, pay_way, pay_date, oil_personnel, order_type, oil_type, print_num, class_structure_no, class_start_date, class_structure_date, class_structure_man, oils from station_class_structure
+        select id, order_no, station_id, station_name, oil_gun, oil_name, oil_pirce, oil_type, consumer_id, consumer, amt, order_liters, pay_type, pay_way, pay_date, oil_personnel, order_type, print_num, class_structure_no, class_start_date, class_structure_date, class_structure_man, oils, receivable_amt, received_amt, discount_amt, discount_coupon_amt, discount_coupon, wx_amt, zfb_amt, pos_amt, xj_amt, didi_app_amt, ty_app_amt, other_amt, dzk_amt, score, member_no, member_amt, car_no, customer_phone, customer_grade from station_class_structure
     </sql>
 
     <select id="selectStationClassStructureList" parameterType="StationClassStructure" resultMap="StationClassStructureResult">
         <include refid="selectStationClassStructureVo"/>
         <where>  
-            <if test="stationId != null "> and station_id = #{stationId}</if>
             <if test="orderNo != null  and orderNo != ''"> and order_no = #{orderNo}</if>
+            <if test="stationId != null "> and station_id = #{stationId}</if>
+            <if test="stationName != null  and stationName != ''"> and station_name like concat('%', #{stationName}, '%')</if>
             <if test="oilGun != null  and oilGun != ''"> and oil_gun = #{oilGun}</if>
             <if test="oilName != null  and oilName != ''"> and oil_name like concat('%', #{oilName}, '%')</if>
+            <if test="oilPirce != null "> and oil_pirce = #{oilPirce}</if>
+            <if test="oilType != null  and oilType != ''"> and oil_type = #{oilType}</if>
             <if test="consumerId != null "> and consumer_id = #{consumerId}</if>
             <if test="consumer != null  and consumer != ''"> and consumer = #{consumer}</if>
-            <if test="amt != null  and amt != ''"> and amt = #{amt}</if>
-            <if test="stationName != null  and stationName != ''"> and station_name like concat('%', #{stationName}, '%')</if>
-            <if test="orderLiters != null  and orderLiters != ''"> and order_liters = #{orderLiters}</if>
+            <if test="amt != null "> and amt = #{amt}</if>
+            <if test="orderLiters != null "> and order_liters = #{orderLiters}</if>
             <if test="payType != null  and payType != ''"> and pay_type = #{payType}</if>
             <if test="payWay != null  and payWay != ''"> and pay_way = #{payWay}</if>
             <if test="payDate != null "> and pay_date = #{payDate}</if>
             <if test="oilPersonnel != null  and oilPersonnel != ''"> and oil_personnel = #{oilPersonnel}</if>
             <if test="orderType != null  and orderType != ''"> and order_type = #{orderType}</if>
-            <if test="oilType != null  and oilType != ''"> and oil_type = #{oilType}</if>
             <if test="printNum != null "> and print_num = #{printNum}</if>
             <if test="classStructureNo != null  and classStructureNo != ''"> and class_structure_no = #{classStructureNo}</if>
             <if test="classStartDate != null "> and class_start_date = #{classStartDate}</if>
             <if test="classStructureDate != null "> and class_structure_date = #{classStructureDate}</if>
             <if test="classStructureMan != null  and classStructureMan != ''"> and class_structure_man = #{classStructureMan}</if>
             <if test="oils != null  and oils != ''"> and oils = #{oils}</if>
+            <if test="receivableAmt != null "> and receivable_amt = #{receivableAmt}</if>
+            <if test="receivedAmt != null "> and received_amt = #{receivedAmt}</if>
+            <if test="discountAmt != null "> and discount_amt = #{discountAmt}</if>
+            <if test="discountCouponAmt != null "> and discount_coupon_amt = #{discountCouponAmt}</if>
+            <if test="discountCoupon != null  and discountCoupon != ''"> and discount_coupon = #{discountCoupon}</if>
+            <if test="wxAmt != null "> and wx_amt = #{wxAmt}</if>
+            <if test="zfbAmt != null "> and zfb_amt = #{zfbAmt}</if>
+            <if test="posAmt != null "> and pos_amt = #{posAmt}</if>
+            <if test="xjAmt != null "> and xj_amt = #{xjAmt}</if>
+            <if test="didiAppAmt != null "> and didi_app_amt = #{didiAppAmt}</if>
+            <if test="tyAppAmt != null "> and ty_app_amt = #{tyAppAmt}</if>
+            <if test="otherAmt != null "> and other_amt = #{otherAmt}</if>
+            <if test="dzkAmt != null "> and dzk_amt = #{dzkAmt}</if>
+            <if test="score != null "> and score = #{score}</if>
+            <if test="memberNo != null  and memberNo != ''"> and member_no = #{memberNo}</if>
+            <if test="memberAmt != null "> and member_amt = #{memberAmt}</if>
+            <if test="carNo != null  and carNo != ''"> and car_no = #{carNo}</if>
+            <if test="customerPhone != null  and customerPhone != ''"> and customer_phone = #{customerPhone}</if>
+            <if test="customerGrade != null  and customerGrade != ''"> and customer_grade = #{customerGrade}</if>
         </where>
+        order by  id desc
     </select>
 
     <select id="listPersonnelStructure" parameterType="StationClassStructure" resultMap="StationClassStructureResult">
-        SELECT a.oil_personnel,b.gun_no as oil_gun,ROUND(SUM(a.amt),2) as amt,ROUND(SUM(order_liters),2) as order_liters,COUNT(order_no) as order_no
+        SELECT a.oil_personnel,GROUP_CONCAT(DISTINCT b.gun_no) as oil_gun,ROUND(SUM(a.amt),2) as amt,ROUND(SUM(order_liters),2) as order_liters,COUNT(order_no) as order_no
         from station_class_structure a JOIN station_personnel b on a.oil_personnel =b.personnel_name
         and a.station_id = b.station_id
         <where>
             <if test="stationId != null "> and a.station_id = #{stationId}</if>
+            <if test="classStructureNo != null and classStructureNo != ''"> and class_structure_no = #{classStructureNo}</if>
         </where>
         GROUP BY a.oil_personnel,b.gun_no
     </select>
@@ -76,6 +121,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         from station_class_structure a
         <where>
             <if test="stationId != null "> and a.station_id = #{stationId}</if>
+            <if test="classStructureNo != null and classStructureNo != ''"> and class_structure_no = #{classStructureNo}</if>
         </where>
         GROUP BY a.oil_name
     </select>
@@ -83,22 +129,23 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         select id, station_id, order_no, oil_gun, oil_name, consumer_id, consumer, amt, station_name, order_liters, pay_type, pay_way, pay_date, oil_personnel, order_type, oil_type, print_num, class_structure_no, class_structure_date, class_structure_man, oils
          from station_class_structure
        	 where id = (
-            SELECT MAX(id) from station_class_structurew
+            SELECT MAX(id) from station_class_structure
             <where>
                 <if test="stationId != null "> and station_id = #{stationId}</if>
             </where>
 		)
     </select>
+
     <select id="selectStationClassStructureById" parameterType="Long" resultMap="StationClassStructureResult">
         <include refid="selectStationClassStructureVo"/>
         where id = #{id}
     </select>
     <select id="selectDistnctClassStructure" parameterType="StationClassStructure" resultMap="StationClassStructureResult">
-      select countselect count(DISTINCT class_structure_no) as num
+      select count(DISTINCT class_structure_no) as num
             from station_class_structure
         <where>
             <if test="stationId != null and stationId != ''"> and station_id = #{stationId}</if>
-            <if test="likeClassStructureNo != null  and likeClassStructureNo != ''"> class_structure_no like concat( #{likeClassStructureNo}, '%') </if>
+            <if test="likeClassStructureNo != null  and likeClassStructureNo != ''">  and class_structure_no like concat( #{likeClassStructureNo}, '%') </if>
         </where>
     </select>
     <!--根据班次号汇总班结数据-->
@@ -107,84 +154,163 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         sum(order_liters) as order_liters,sum(amt) as amt,class_structure_man
         from station_class_structure
         <where>
+            <if test="stationId != null and stationId != ''"> and station_id = #{stationId}</if>
             <if test="classStructureNo != null and classStructureNo != ''"> and class_structure_no = #{classStructureNo}</if>
         </where>
         GROUP BY class_structure_no,class_start_date,station_id,station_name,class_structure_date,class_structure_man
     </select>
+
+    <!--按员工/支付方式汇总数据-->
+    <select id="listPersonnelPayStructure" parameterType="StationClassStructure" resultMap="StationClassStructureResult">
+        SELECT oil_personnel,GROUP_CONCAT(DISTINCT oil_gun) oil_gun,count(wx_amt) wx_num,count(zfb_amt) zfb_num,count(xj_amt) xj_num,sum(discount_amt) discount_amt,SUM(discount_coupon_amt) discount_coupon_amt,SUM(wx_amt) wx_amt,SUM(zfb_amt) zfb_amt,SUM(xj_amt) xj_amt,sum(member_amt) member_amt
+        from  station_class_structure
+        <where>
+            <if test="stationId != null and stationId != ''"> and station_id = #{stationId}</if>
+            <if test="classStructureNo != null and classStructureNo != ''"> and class_structure_no = #{classStructureNo}</if>
+        </where>
+        GROUP BY oil_personnel
+    </select>
+
+    <select id="listClass" parameterType="StationClassStructure" resultMap="StationClassStructureResult">
+        SELECT *  from
+        station_class_structure
+        where id =(SELECT max(id) from station_class_structure
+            where class_structure_man =#{classStructureMan})
+    </select>
     <insert id="insertStationClassStructure" parameterType="StationClassStructure" useGeneratedKeys="true" keyProperty="id">
         insert into station_class_structure
         <trim prefix="(" suffix=")" suffixOverrides=",">
-            <if test="stationId != null">station_id,</if>
             <if test="orderNo != null">order_no,</if>
+            <if test="stationId != null">station_id,</if>
+            <if test="stationName != null">station_name,</if>
             <if test="oilGun != null">oil_gun,</if>
             <if test="oilName != null">oil_name,</if>
+            <if test="oilPirce != null">oil_pirce,</if>
+            <if test="oilType != null">oil_type,</if>
             <if test="consumerId != null">consumer_id,</if>
             <if test="consumer != null">consumer,</if>
             <if test="amt != null">amt,</if>
-            <if test="stationName != null">station_name,</if>
             <if test="orderLiters != null">order_liters,</if>
             <if test="payType != null">pay_type,</if>
             <if test="payWay != null">pay_way,</if>
             <if test="payDate != null">pay_date,</if>
             <if test="oilPersonnel != null">oil_personnel,</if>
             <if test="orderType != null">order_type,</if>
-            <if test="oilType != null">oil_type,</if>
             <if test="printNum != null">print_num,</if>
             <if test="classStructureNo != null">class_structure_no,</if>
             <if test="classStartDate != null">class_start_date,</if>
             <if test="classStructureDate != null">class_structure_date,</if>
             <if test="classStructureMan != null">class_structure_man,</if>
             <if test="oils != null">oils,</if>
+            <if test="receivableAmt != null">receivable_amt,</if>
+            <if test="receivedAmt != null">received_amt,</if>
+            <if test="discountAmt != null">discount_amt,</if>
+            <if test="discountCouponAmt != null">discount_coupon_amt,</if>
+            <if test="discountCoupon != null">discount_coupon,</if>
+            <if test="wxAmt != null">wx_amt,</if>
+            <if test="zfbAmt != null">zfb_amt,</if>
+            <if test="posAmt != null">pos_amt,</if>
+            <if test="xjAmt != null">xj_amt,</if>
+            <if test="didiAppAmt != null">didi_app_amt,</if>
+            <if test="tyAppAmt != null">ty_app_amt,</if>
+            <if test="otherAmt != null">other_amt,</if>
+            <if test="dzkAmt != null">dzk_amt,</if>
+            <if test="score != null">score,</if>
+            <if test="memberNo != null">member_no,</if>
+            <if test="memberAmt != null">member_amt,</if>
+            <if test="carNo != null">car_no,</if>
+            <if test="customerPhone != null">customer_phone,</if>
+            <if test="customerGrade != null">customer_grade,</if>
          </trim>
         <trim prefix="values (" suffix=")" suffixOverrides=",">
-            <if test="stationId != null">#{stationId},</if>
             <if test="orderNo != null">#{orderNo},</if>
+            <if test="stationId != null">#{stationId},</if>
+            <if test="stationName != null">#{stationName},</if>
             <if test="oilGun != null">#{oilGun},</if>
             <if test="oilName != null">#{oilName},</if>
+            <if test="oilPirce != null">#{oilPirce},</if>
+            <if test="oilType != null">#{oilType},</if>
             <if test="consumerId != null">#{consumerId},</if>
             <if test="consumer != null">#{consumer},</if>
             <if test="amt != null">#{amt},</if>
-            <if test="stationName != null">#{stationName},</if>
             <if test="orderLiters != null">#{orderLiters},</if>
             <if test="payType != null">#{payType},</if>
             <if test="payWay != null">#{payWay},</if>
             <if test="payDate != null">#{payDate},</if>
             <if test="oilPersonnel != null">#{oilPersonnel},</if>
             <if test="orderType != null">#{orderType},</if>
-            <if test="oilType != null">#{oilType},</if>
             <if test="printNum != null">#{printNum},</if>
             <if test="classStructureNo != null">#{classStructureNo},</if>
             <if test="classStartDate != null">#{classStartDate},</if>
             <if test="classStructureDate != null">#{classStructureDate},</if>
             <if test="classStructureMan != null">#{classStructureMan},</if>
             <if test="oils != null">#{oils},</if>
+            <if test="receivableAmt != null">#{receivableAmt},</if>
+            <if test="receivedAmt != null">#{receivedAmt},</if>
+            <if test="discountAmt != null">#{discountAmt},</if>
+            <if test="discountCouponAmt != null">#{discountCouponAmt},</if>
+            <if test="discountCoupon != null">#{discountCoupon},</if>
+            <if test="wxAmt != null">#{wxAmt},</if>
+            <if test="zfbAmt != null">#{zfbAmt},</if>
+            <if test="posAmt != null">#{posAmt},</if>
+            <if test="xjAmt != null">#{xjAmt},</if>
+            <if test="didiAppAmt != null">#{didiAppAmt},</if>
+            <if test="tyAppAmt != null">#{tyAppAmt},</if>
+            <if test="otherAmt != null">#{otherAmt},</if>
+            <if test="dzkAmt != null">#{dzkAmt},</if>
+            <if test="score != null">#{score},</if>
+            <if test="memberNo != null">#{memberNo},</if>
+            <if test="memberAmt != null">#{memberAmt},</if>
+            <if test="carNo != null">#{carNo},</if>
+            <if test="customerPhone != null">#{customerPhone},</if>
+            <if test="customerGrade != null">#{customerGrade},</if>
          </trim>
     </insert>
 
     <update id="updateStationClassStructure" parameterType="StationClassStructure">
         update station_class_structure
         <trim prefix="SET" suffixOverrides=",">
-            <if test="stationId != null">station_id = #{stationId},</if>
             <if test="orderNo != null">order_no = #{orderNo},</if>
+            <if test="stationId != null">station_id = #{stationId},</if>
+            <if test="stationName != null">station_name = #{stationName},</if>
             <if test="oilGun != null">oil_gun = #{oilGun},</if>
             <if test="oilName != null">oil_name = #{oilName},</if>
+            <if test="oilPirce != null">oil_pirce = #{oilPirce},</if>
+            <if test="oilType != null">oil_type = #{oilType},</if>
             <if test="consumerId != null">consumer_id = #{consumerId},</if>
             <if test="consumer != null">consumer = #{consumer},</if>
             <if test="amt != null">amt = #{amt},</if>
-            <if test="stationName != null">station_name = #{stationName},</if>
             <if test="orderLiters != null">order_liters = #{orderLiters},</if>
             <if test="payType != null">pay_type = #{payType},</if>
             <if test="payWay != null">pay_way = #{payWay},</if>
             <if test="payDate != null">pay_date = #{payDate},</if>
             <if test="oilPersonnel != null">oil_personnel = #{oilPersonnel},</if>
             <if test="orderType != null">order_type = #{orderType},</if>
-            <if test="oilType != null">oil_type = #{oilType},</if>
             <if test="printNum != null">print_num = #{printNum},</if>
             <if test="classStructureNo != null">class_structure_no = #{classStructureNo},</if>
             <if test="classStartDate != null">class_start_date = #{classStartDate},</if>
             <if test="classStructureDate != null">class_structure_date = #{classStructureDate},</if>
             <if test="classStructureMan != null">class_structure_man = #{classStructureMan},</if>
             <if test="oils != null">oils = #{oils},</if>
+            <if test="receivableAmt != null">receivable_amt = #{receivableAmt},</if>
+            <if test="receivedAmt != null">received_amt = #{receivedAmt},</if>
+            <if test="discountAmt != null">discount_amt = #{discountAmt},</if>
+            <if test="discountCouponAmt != null">discount_coupon_amt = #{discountCouponAmt},</if>
+            <if test="discountCoupon != null">discount_coupon = #{discountCoupon},</if>
+            <if test="wxAmt != null">wx_amt = #{wxAmt},</if>
+            <if test="zfbAmt != null">zfb_amt = #{zfbAmt},</if>
+            <if test="posAmt != null">pos_amt = #{posAmt},</if>
+            <if test="xjAmt != null">xj_amt = #{xjAmt},</if>
+            <if test="didiAppAmt != null">didi_app_amt = #{didiAppAmt},</if>
+            <if test="tyAppAmt != null">ty_app_amt = #{tyAppAmt},</if>
+            <if test="otherAmt != null">other_amt = #{otherAmt},</if>
+            <if test="dzkAmt != null">dzk_amt = #{dzkAmt},</if>
+            <if test="score != null">score = #{score},</if>
+            <if test="memberNo != null">member_no = #{memberNo},</if>
+            <if test="memberAmt != null">member_amt = #{memberAmt},</if>
+            <if test="carNo != null">car_no = #{carNo},</if>
+            <if test="customerPhone != null">customer_phone = #{customerPhone},</if>
+            <if test="customerGrade != null">customer_grade = #{customerGrade},</if>
         </trim>
         where id = #{id}
     </update>

+ 1 - 0
Yijia-SaaS/yijia-station/target/classes/mapper/station/StationDeviceManageMapper.xml

@@ -34,6 +34,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="deviceStatus != null  and deviceStatus != ''"> and device_status = #{deviceStatus}</if>
             <if test="deviceFactory != null  and deviceFactory != ''"> and device_factory = #{deviceFactory}</if>
         </where>
+        order by device_id desc
     </select>
     
     <select id="selectStationDeviceManageById" parameterType="Long" resultMap="StationDeviceManageResult">

+ 1 - 0
Yijia-SaaS/yijia-station/target/classes/mapper/station/StationInfoMapper.xml

@@ -38,6 +38,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="stationLatitude != null  and stationLatitude != ''"> and station_latitude = #{stationLatitude}</if>
             <if test="mno != null "> and mno = #{mno}</if>
         </where>
+        order by station_id desc
     </select>
     
     <select id="selectStationInfoById" parameterType="Long" resultMap="StationInfoResult">

+ 1 - 0
Yijia-SaaS/yijia-station/target/classes/mapper/station/StationOilPriceAdjustMapper.xml

@@ -36,6 +36,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="status != null  and status != ''"> and status = #{status}</if>
             <if test="oilPriceId != null "> and oil_price_id = #{oilPriceId}</if>
         </where>
+        order by adjust_price_id desc
     </select>
     
     <select id="selectStationOilPriceAdjustById" parameterType="Long" resultMap="StationOilPriceAdjustResult">

+ 1 - 0
Yijia-SaaS/yijia-station/target/classes/mapper/station/StationPersonnelMapper.xml

@@ -28,6 +28,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="qrCode != null  and qrCode != ''"> and qr_code = #{qrCode}</if>
             <if test="personnelPhone != null  and personnelPhone != ''"> and personnel_phone = #{personnelPhone}</if>
         </where>
+        order by personnel_id desc
     </select>
     
     <select id="selectStationPersonnelById" parameterType="Long" resultMap="StationPersonnelResult">

BIN
Yijia-SaaS/yijia-station/target/yijia-station-1.0.1.jar