XF--LRQYEJOKYDS\Administrator 4 anni fa
parent
commit
b12dbd4ce4

+ 99 - 4
Yijia-SaaS/yijia-station/src/main/java/com/yijia/station/controller/StationClassStructureController.java

@@ -1,6 +1,11 @@
 package com.yijia.station.controller;
 
+import java.util.Date;
 import java.util.List;
+
+import com.yijia.station.domain.PayOrder;
+import com.yijia.station.mapper.PayOrderMapper;
+import com.yijia.station.service.IPayOrderService;
 import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.GetMapping;
@@ -32,7 +37,8 @@ public class StationClassStructureController extends BaseController
 {
     @Autowired
     private IStationClassStructureService stationClassStructureService;
-
+    @Autowired
+    private IPayOrderService payOrderService;
     /**
      * 查询班结管理列表
      */
@@ -45,6 +51,21 @@ public class StationClassStructureController extends BaseController
         return getDataTable(list);
     }
 
+    @PreAuthorize("@ss.hasPermi('station:structure:listPersonnelStructure')")
+    @GetMapping("/listPersonnelStructure")
+    public TableDataInfo listPersonnelStructure(StationClassStructure stationClassStructure)
+    {
+        List<StationClassStructure> list = stationClassStructureService.listPersonnelStructure(stationClassStructure);
+        return getTable(list);
+    }
+
+    @PreAuthorize("@ss.hasPermi('station:structure:listOilStructure')")
+    @GetMapping("/listOilStructure")
+    public TableDataInfo listOilStructure(StationClassStructure stationClassStructure)
+    {
+        List<StationClassStructure> list = stationClassStructureService.listOilStructure(stationClassStructure);
+        return getTable(list);
+    }
     /**
      * 导出班结管理列表
      */
@@ -74,9 +95,83 @@ public class StationClassStructureController extends BaseController
     @PreAuthorize("@ss.hasPermi('station:structure:add')")
     @Log(title = "班结管理", businessType = BusinessType.INSERT)
     @PostMapping
-    public AjaxResult add(@RequestBody StationClassStructure stationClassStructure)
-    {
-        return toAjax(stationClassStructureService.insertStationClassStructure(stationClassStructure));
+    public AjaxResult add(@RequestBody StationClassStructure stationClassStructure){
+        //获取当前班结油站
+        // Long stationId=stationClassStructure.getStationId();
+        Long stationId= Long.valueOf("1");
+        String stationName=stationClassStructure.getStationName();
+        String username = stationClassStructure.getClassStructureMan();
+        //根据油站查询出油站是否班结过,班结过就需要查询上次班结的时间
+        StationClassStructure classes =new StationClassStructure();
+        classes.setStationId(stationId);
+        //查询出上次班结,最后一条数据
+        StationClassStructure sss =stationClassStructureService.selectStationClassStructureMax(classes);
+        //当前时间
+        Date date= new Date();
+        int i=0;
+
+        if(sss!=null){
+            //获取上次班结时间
+            PayOrder order=new PayOrder();
+            order.setStationId(stationId);
+            order.setBeginTime(sss.getClassStructureDate().toString());
+            order.setEndTime(date.toString());
+            List<PayOrder> list = payOrderService.selectPayOrderList(order);
+            for(PayOrder payOrder:list){
+                StationClassStructure stationclass =new StationClassStructure();
+                stationclass.setStationId(payOrder.getStationId());
+                stationclass.setClassStructureMan(username);
+                stationclass.setClassStructureDate(date);
+                stationclass.setOrderNo(payOrder.getOrderNo());
+                stationclass.setOilGun(payOrder.getOilGun());
+                stationclass.setOilName(payOrder.getOilName());
+                stationclass.setConsumerId(payOrder.getConsumerId());
+                stationclass.setConsumer(payOrder.getConsumer());
+                stationclass.setAmt(payOrder.getAmt());
+                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
+                i= stationClassStructureService.insertStationClassStructure(stationclass);
+            }
+        }else{
+            //初次班结 班结时间默认为当前时间,班结人username
+            //根据班结时间查询订单
+
+            PayOrder order=new PayOrder();
+            order.setStationId(stationId);
+            order.setEndTime(date.toString());
+            List<PayOrder> list = payOrderService.selectPayOrderList(order);
+            for(PayOrder payOrder:list){
+                StationClassStructure stationclass =new StationClassStructure();
+                stationclass.setStationId(payOrder.getStationId());
+                stationclass.setClassStructureMan(username);
+                stationclass.setClassStructureDate(date);
+                stationclass.setOrderNo(payOrder.getOrderNo());
+                stationclass.setOilGun(payOrder.getOilGun());
+                stationclass.setOilName(payOrder.getOilName());
+                stationclass.setConsumerId(payOrder.getConsumerId());
+                stationclass.setConsumer(payOrder.getConsumer());
+                stationclass.setAmt(payOrder.getAmt());
+                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
+                i= stationClassStructureService.insertStationClassStructure(stationclass);
+            }
+        }
+        return toAjax(i);
+
     }
 
     /**

+ 157 - 72
Yijia-SaaS/yijia-station/src/main/java/com/yijia/station/domain/StationClassStructure.java

@@ -11,7 +11,7 @@ import com.yijia.common.core.domain.BaseEntity;
  * 班结管理对象 station_class_structure
  * 
  * @author yijia
- * @date 2020-12-14
+ * @date 2020-12-24
  */
 public class StationClassStructure extends BaseEntity
 {
@@ -20,45 +20,66 @@ public class StationClassStructure extends BaseEntity
     /** $column.columnComment */
     private Long id;
 
-    /** $column.columnComment */
-    @Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
+    /** 油站id */
+    @Excel(name = "油站id")
     private Long stationId;
 
+    /** 订单号 */
+    @Excel(name = "订单号")
+    private String orderNo;
+
+    /** 加油枪号 */
+    @Excel(name = "加油枪号")
+    private String oilGun;
+
+    /** 油品名称 */
+    @Excel(name = "油品名称")
+    private String oilName;
+
+    /** 用户(app_user_info  id消费者id) */
+    @Excel(name = "用户", readConverterExp = "a=pp_user_info,i=d消费者id")
+    private Long consumerId;
+
+    /** 消费者 */
+    @Excel(name = "消费者")
+    private String consumer;
+
+    /** 金额 */
+    @Excel(name = "金额")
+    private String amt;
+
     /** 油站名称 */
     @Excel(name = "油站名称")
     private String stationName;
 
-    /** 员工姓名 */
-    @Excel(name = "员工姓名")
-    private String person;
-
-    /** 负责枪号 */
-    @Excel(name = "负责枪号")
-    private String gunNo;
+    /** 加油升数· */
+    @Excel(name = "加油升数·")
+    private String orderLiters;
 
-    /** 销量 */
-    @Excel(name = "销量")
-    private String salesVolume;
+    /** 支付类型 sxf */
+    @Excel(name = "支付类型 sxf")
+    private String payType;
 
-    /** 销额 */
-    @Excel(name = "销额")
-    private String salesAmount;
+    /** 支付方式:02公众号 03小程序 */
+    @Excel(name = "支付方式:02公众号 03小程序")
+    private String payWay;
 
-    /** 优惠 */
-    @Excel(name = "优惠")
-    private String discount;
+    /** 支付时间 */
+    @JsonFormat(pattern = "yyyy-MM-dd")
+    @Excel(name = "支付时间", width = 30, dateFormat = "yyyy-MM-dd")
+    private Date payDate;
 
-    /** 优惠券 */
-    @Excel(name = "优惠券")
-    private String coupon;
+    /** 加油员人名 */
+    @Excel(name = "加油员人名")
+    private String oilPersonnel;
 
-    /** 实收 */
-    @Excel(name = "实收")
-    private String netReceipts;
+    /** 订单类型订单类型(1.柴油,2.汽油,积分:3.现金+积分4.现金,5.积分) */
+    @Excel(name = "订单类型订单类型", readConverterExp = "1=.柴油,2.汽油,积分:3.现金+积分4.现金,5.积分")
+    private String orderType;
 
-    /** 销售笔数 */
-    @Excel(name = "销售笔数")
-    private Long salesNum;
+    /** 油品类型(柴油,汽油) */
+    @Excel(name = "油品类型", readConverterExp = "柴=油,汽油")
+    private String oilType;
 
     /** 打印小票数(含重复) */
     @Excel(name = "打印小票数", readConverterExp = "含=重复")
@@ -77,6 +98,10 @@ public class StationClassStructure extends BaseEntity
     @Excel(name = "班结人")
     private String classStructureMan;
 
+    /** 油品 */
+    @Excel(name = "油品")
+    private String oils;
+
     public void setId(Long id) 
     {
         this.id = id;
@@ -95,86 +120,131 @@ public class StationClassStructure extends BaseEntity
     {
         return stationId;
     }
-    public void setStationName(String stationName) 
+    public void setOrderNo(String orderNo) 
     {
-        this.stationName = stationName;
+        this.orderNo = orderNo;
     }
 
-    public String getStationName() 
+    public String getOrderNo() 
     {
-        return stationName;
+        return orderNo;
+    }
+    public void setOilGun(String oilGun) 
+    {
+        this.oilGun = oilGun;
+    }
+
+    public String getOilGun() 
+    {
+        return oilGun;
+    }
+    public void setOilName(String oilName) 
+    {
+        this.oilName = oilName;
+    }
+
+    public String getOilName() 
+    {
+        return oilName;
     }
-    public void setPerson(String person) 
+    public void setConsumerId(Long consumerId) 
     {
-        this.person = person;
+        this.consumerId = consumerId;
     }
 
-    public String getPerson() 
+    public Long getConsumerId() 
     {
-        return person;
+        return consumerId;
     }
-    public void setGunNo(String gunNo) 
+    public void setConsumer(String consumer) 
     {
-        this.gunNo = gunNo;
+        this.consumer = consumer;
     }
 
-    public String getGunNo() 
+    public String getConsumer() 
     {
-        return gunNo;
+        return consumer;
     }
-    public void setSalesVolume(String salesVolume) 
+    public void setAmt(String amt) 
     {
-        this.salesVolume = salesVolume;
+        this.amt = amt;
     }
 
-    public String getSalesVolume() 
+    public String getAmt() 
     {
-        return salesVolume;
+        return amt;
     }
-    public void setSalesAmount(String salesAmount) 
+    public void setStationName(String stationName) 
+    {
+        this.stationName = stationName;
+    }
+
+    public String getStationName() 
+    {
+        return stationName;
+    }
+    public void setOrderLiters(String orderLiters) 
+    {
+        this.orderLiters = orderLiters;
+    }
+
+    public String getOrderLiters() 
     {
-        this.salesAmount = salesAmount;
+        return orderLiters;
+    }
+    public void setPayType(String payType) 
+    {
+        this.payType = payType;
+    }
+
+    public String getPayType() 
+    {
+        return payType;
+    }
+    public void setPayWay(String payWay) 
+    {
+        this.payWay = payWay;
     }
 
-    public String getSalesAmount() 
+    public String getPayWay() 
     {
-        return salesAmount;
+        return payWay;
     }
-    public void setDiscount(String discount) 
+    public void setPayDate(Date payDate) 
     {
-        this.discount = discount;
+        this.payDate = payDate;
     }
 
-    public String getDiscount() 
+    public Date getPayDate() 
     {
-        return discount;
+        return payDate;
     }
-    public void setCoupon(String coupon) 
+    public void setOilPersonnel(String oilPersonnel) 
     {
-        this.coupon = coupon;
+        this.oilPersonnel = oilPersonnel;
     }
 
-    public String getCoupon() 
+    public String getOilPersonnel() 
     {
-        return coupon;
+        return oilPersonnel;
     }
-    public void setNetReceipts(String netReceipts) 
+    public void setOrderType(String orderType) 
     {
-        this.netReceipts = netReceipts;
+        this.orderType = orderType;
     }
 
-    public String getNetReceipts() 
+    public String getOrderType() 
     {
-        return netReceipts;
+        return orderType;
     }
-    public void setSalesNum(Long salesNum) 
+    public void setOilType(String oilType) 
     {
-        this.salesNum = salesNum;
+        this.oilType = oilType;
     }
 
-    public Long getSalesNum() 
+    public String getOilType() 
     {
-        return salesNum;
+        return oilType;
     }
     public void setPrintNum(Long printNum) 
     {
@@ -212,25 +282,40 @@ public class StationClassStructure extends BaseEntity
     {
         return classStructureMan;
     }
+    public void setOils(String oils) 
+    {
+        this.oils = oils;
+    }
+
+    public String getOils() 
+    {
+        return oils;
+    }
 
     @Override
     public String toString() {
         return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
             .append("id", getId())
             .append("stationId", getStationId())
+            .append("orderNo", getOrderNo())
+            .append("oilGun", getOilGun())
+            .append("oilName", getOilName())
+            .append("consumerId", getConsumerId())
+            .append("consumer", getConsumer())
+            .append("amt", getAmt())
             .append("stationName", getStationName())
-            .append("person", getPerson())
-            .append("gunNo", getGunNo())
-            .append("salesVolume", getSalesVolume())
-            .append("salesAmount", getSalesAmount())
-            .append("discount", getDiscount())
-            .append("coupon", getCoupon())
-            .append("netReceipts", getNetReceipts())
-            .append("salesNum", getSalesNum())
+            .append("orderLiters", getOrderLiters())
+            .append("payType", getPayType())
+            .append("payWay", getPayWay())
+            .append("payDate", getPayDate())
+            .append("oilPersonnel", getOilPersonnel())
+            .append("orderType", getOrderType())
+            .append("oilType", getOilType())
             .append("printNum", getPrintNum())
             .append("classStructureNo", getClassStructureNo())
             .append("classStructureDate", getClassStructureDate())
             .append("classStructureMan", getClassStructureMan())
+            .append("oils", getOils())
             .toString();
     }
 }

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

@@ -58,4 +58,25 @@ public interface StationClassStructureMapper
      * @return 结果
      */
     public int deleteStationClassStructureByIds(Long[] ids);
+
+    /**
+     *
+     * @param stationClassStructure
+     * @return
+     */
+    public  List<StationClassStructure> listPersonnelStructure(StationClassStructure stationClassStructure);
+
+    /**
+     *
+     * @param classes
+     * @return
+     */
+    public StationClassStructure selectStationClassStructureMax(StationClassStructure classes);
+
+    /**
+     *
+     * @param stationClassStructure
+     * @return
+     */
+    public List<StationClassStructure> listOilStructure(StationClassStructure stationClassStructure);
 }

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

@@ -58,4 +58,25 @@ public interface IStationClassStructureService
      * @return 结果
      */
     public int deleteStationClassStructureById(Long id);
+
+    /**
+     * 根据人员班结汇总
+     * @param stationClassStructure
+     * @return
+     */
+    public List<StationClassStructure> listPersonnelStructure(StationClassStructure stationClassStructure);
+
+    /**
+     * 查询该油站信息
+     * @param classes
+     * @return
+     */
+    StationClassStructure selectStationClassStructureMax(StationClassStructure classes);
+
+    /**
+     * 按油品汇总班结数据
+     * @param stationClassStructure
+     * @return
+     */
+    List<StationClassStructure> listOilStructure(StationClassStructure stationClassStructure);
 }

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

@@ -90,4 +90,35 @@ public class StationClassStructureServiceImpl implements IStationClassStructureS
     {
         return stationClassStructureMapper.deleteStationClassStructureById(id);
     }
+
+    /**
+     * listPersonnelStructure
+     * @param stationClassStructure
+     * @return
+     */
+    @Override
+    public List<StationClassStructure> listPersonnelStructure(StationClassStructure stationClassStructure) {
+        return stationClassStructureMapper.listPersonnelStructure(stationClassStructure);
+    }
+
+    /**
+     * 查询该油站最大的班结id
+     * @param classes
+     * @return
+     */
+    @Override
+    public StationClassStructure selectStationClassStructureMax(StationClassStructure classes) {
+        return stationClassStructureMapper.selectStationClassStructureMax(classes);
+    }
+
+    /**
+     *
+     * @param stationClassStructure
+     * @return
+     */
+    @Override
+    public List<StationClassStructure> listOilStructure(StationClassStructure stationClassStructure) {
+        return stationClassStructureMapper.listOilStructure(stationClassStructure);
+    }
+
 }

+ 92 - 42
Yijia-SaaS/yijia-station/src/main/resources/mapper/station/StationClassStructureMapper.xml

@@ -7,45 +7,77 @@ 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="oilGun"    column="oil_gun"    />
+        <result property="oilName"    column="oil_name"    />
+        <result property="consumerId"    column="consumer_id"    />
+        <result property="consumer"    column="consumer"    />
+        <result property="amt"    column="amt"    />
         <result property="stationName"    column="station_name"    />
-        <result property="person"    column="person"    />
-        <result property="gunNo"    column="gun_no"    />
-        <result property="salesVolume"    column="sales_volume"    />
-        <result property="salesAmount"    column="sales_amount"    />
-        <result property="discount"    column="discount"    />
-        <result property="coupon"    column="coupon"    />
-        <result property="netReceipts"    column="net_receipts"    />
-        <result property="salesNum"    column="sales_num"    />
+        <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="classStructureDate"    column="class_structure_date"    />
         <result property="classStructureMan"    column="class_structure_man"    />
+        <result property="oils"    column="oils"    />
     </resultMap>
 
     <sql id="selectStationClassStructureVo">
-        select id, station_id, station_name, person, gun_no, sales_volume, sales_amount, discount, coupon, net_receipts, sales_num, print_num, class_structure_no, class_structure_date, class_structure_man from station_class_structure
+        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
     </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="oilGun != null  and oilGun != ''"> and oil_gun = #{oilGun}</if>
+            <if test="oilName != null  and oilName != ''"> and oil_name like concat('%', #{oilName}, '%')</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="person != null  and person != ''"> and person = #{person}</if>
-            <if test="gunNo != null  and gunNo != ''"> and gun_no = #{gunNo}</if>
-            <if test="salesVolume != null  and salesVolume != ''"> and sales_volume = #{salesVolume}</if>
-            <if test="salesAmount != null  and salesAmount != ''"> and sales_amount = #{salesAmount}</if>
-            <if test="discount != null  and discount != ''"> and discount = #{discount}</if>
-            <if test="coupon != null  and coupon != ''"> and coupon = #{coupon}</if>
-            <if test="netReceipts != null  and netReceipts != ''"> and net_receipts = #{netReceipts}</if>
-            <if test="salesNum != null "> and sales_num = #{salesNum}</if>
+            <if test="orderLiters != null  and orderLiters != ''"> 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="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>
         </where>
     </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
+        from station_class_structure a JOIN station_personnel b on a.oil_personnel =b.personnel_name
+        and a.station_id = b.station_id
+        where a.station_id =1
+        GROUP BY a.oil_personnel,b.gun_no
+    </select>
+
+    <select id="listOilStructure" parameterType="StationClassStructure" resultMap="StationClassStructureResult">
+       	SELECT  a.oil_name,GROUP_CONCAT(DISTINCT oil_gun) 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
+        where a.station_id =1
+        GROUP BY a.oil_name
+    </select>
+    <select id="selectStationClassStructureMax" parameterType="StationClassStructure" resultMap="StationClassStructureResult">
+        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_structure where station_id= #{stationId})
+    </select>
     <select id="selectStationClassStructureById" parameterType="Long" resultMap="StationClassStructureResult">
         <include refid="selectStationClassStructureVo"/>
         where id = #{id}
@@ -55,35 +87,47 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         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="oilGun != null">oil_gun,</if>
+            <if test="oilName != null">oil_name,</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="person != null">person,</if>
-            <if test="gunNo != null">gun_no,</if>
-            <if test="salesVolume != null">sales_volume,</if>
-            <if test="salesAmount != null">sales_amount,</if>
-            <if test="discount != null">discount,</if>
-            <if test="coupon != null">coupon,</if>
-            <if test="netReceipts != null">net_receipts,</if>
-            <if test="salesNum != null">sales_num,</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="classStructureDate != null">class_structure_date,</if>
             <if test="classStructureMan != null">class_structure_man,</if>
+            <if test="oils != null">oils,</if>
          </trim>
         <trim prefix="values (" suffix=")" suffixOverrides=",">
             <if test="stationId != null">#{stationId},</if>
+            <if test="orderNo != null">#{orderNo},</if>
+            <if test="oilGun != null">#{oilGun},</if>
+            <if test="oilName != null">#{oilName},</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="person != null">#{person},</if>
-            <if test="gunNo != null">#{gunNo},</if>
-            <if test="salesVolume != null">#{salesVolume},</if>
-            <if test="salesAmount != null">#{salesAmount},</if>
-            <if test="discount != null">#{discount},</if>
-            <if test="coupon != null">#{coupon},</if>
-            <if test="netReceipts != null">#{netReceipts},</if>
-            <if test="salesNum != null">#{salesNum},</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="classStructureDate != null">#{classStructureDate},</if>
             <if test="classStructureMan != null">#{classStructureMan},</if>
+            <if test="oils != null">#{oils},</if>
          </trim>
     </insert>
 
@@ -91,19 +135,25 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         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="oilGun != null">oil_gun = #{oilGun},</if>
+            <if test="oilName != null">oil_name = #{oilName},</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="person != null">person = #{person},</if>
-            <if test="gunNo != null">gun_no = #{gunNo},</if>
-            <if test="salesVolume != null">sales_volume = #{salesVolume},</if>
-            <if test="salesAmount != null">sales_amount = #{salesAmount},</if>
-            <if test="discount != null">discount = #{discount},</if>
-            <if test="coupon != null">coupon = #{coupon},</if>
-            <if test="netReceipts != null">net_receipts = #{netReceipts},</if>
-            <if test="salesNum != null">sales_num = #{salesNum},</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="classStructureDate != null">class_structure_date = #{classStructureDate},</if>
             <if test="classStructureMan != null">class_structure_man = #{classStructureMan},</if>
+            <if test="oils != null">oils = #{oils},</if>
         </trim>
         where id = #{id}
     </update>