Просмотр исходного кода

非油品修改,油站表改为部门表

jk-GitHub-coder 4 лет назад
Родитель
Сommit
f7de09faad

+ 1 - 1
YijiaRestful/src/main/java/com/platform/yijia/param/request/PayOrderRequest.java

@@ -17,7 +17,7 @@ public class PayOrderRequest {
     private String payWay;
     private String userType;
     private String oilPersonnel;
-    private String orderType;
+    private String orderType;    //订单类型(1油品,2.非油品)
     private Double oilPrice;    //油品价格
     private Double receivableAmt;   //应收金额
     private Double receivedAmt;    //到账金额

+ 49 - 59
YijiaRestful/src/main/java/com/platform/yijia/service/impl/PayOrderServiceImpl.java

@@ -56,7 +56,7 @@ public class PayOrderServiceImpl implements PayOrderService {
         payOrder.setCustomerGrade(payOrderRequest.getCustomerGrade());    //客户电话
         payOrder.setMemberNo(payOrderRequest.getMemberNo());     //会员卡号
         payOrder.setMemberAmt(payOrderRequest.getMemberAmt());    //会员支付金额
-        payOrder.setPrintCount(payOrderRequest.getPrintCount());    //小票数量
+        //payOrder.setPrintCount(payOrderRequest.getPrintCount());    //小票数量
         payOrder.setScore(payOrderRequest.getScore());      //积分
         payOrder.setStationId(payOrderRequest.getStationId());  //油站id
         payOrder.setStatus("0");         //创建订单 未支付状态 0
@@ -72,62 +72,41 @@ public class PayOrderServiceImpl implements PayOrderService {
         payOrder.setCreatedDate(new Date());                    //创建时间
         payOrder.setOrderType(payOrderRequest.getOrderType());  //订单类型
         payOrder.setOilGun(payOrderRequest.getOilGun());        //油枪号
-        //根据油站和油枪获取加油员和油品价格 油站名称
-        HashMap<String, Object> params = new HashMap<>();
-        params.put("oliGunNo", payOrderRequest.getOilGun());
-        params.put("stationId", payOrderRequest.getStationId());
-        String oilPersonnel = "";
-        //使用list原因:一个枪号对应多个加油员场景
-        List<Map> mapResultList = payOrderMapper.selectPersonelName(params);
-        //List<Map> mapResultList = payOrderMapper.selectOilGunNoAndOilPrice(params);
-        if(mapResultList != null && mapResultList.size() > 0){
-            for (Map per : mapResultList){
-                if(per.containsKey("personelName") && per.get("personelName").toString() !=null && per.get("personelName").toString() !=""){
-                    oilPersonnel += per.get("personelName").toString() +",";
+        //订单类型等于1时表示油品
+        if(payOrderRequest.getOrderType().equals("1")){
+            //根据油站和油枪获取加油员和油品价格 油站名称
+            HashMap<String, Object> params = new HashMap<>();
+            params.put("oliGunNo", payOrderRequest.getOilGun());
+            params.put("stationId", payOrderRequest.getStationId());
+            String oilPersonnel = "";
+            //使用list原因:一个枪号对应多个加油员场景
+            List<Map> mapResultList = payOrderMapper.selectPersonelName(params);
+            if(mapResultList != null && mapResultList.size() > 0){
+                for (Map per : mapResultList){
+                    if(per.containsKey("personelName") && per.get("personelName").toString() !=null && per.get("personelName").toString() !=""){
+                        oilPersonnel += per.get("personelName").toString() +",";
+                    }
+                }
+                if(oilPersonnel !=""){
+                    payOrder.setOilPersonnel(oilPersonnel.substring(0, oilPersonnel.length()-1));   //加油员
+                }
+                if(mapResultList.get(0).containsKey("stationName") && mapResultList.get(0).get("stationName").toString() !="" && mapResultList.get(0).get("stationName").toString() !=null ){
+                    payOrder.setStationName(mapResultList.get(0).get("stationName").toString());        //油站名称
                 }
             }
-            if(oilPersonnel !=""){
-                payOrder.setOilPersonnel(oilPersonnel.substring(0, oilPersonnel.length()-1));   //加油员
-            }
-            if(mapResultList.get(0).containsKey("stationName") && mapResultList.get(0).get("stationName").toString() !="" && mapResultList.get(0).get("stationName").toString() !=null ){
-                payOrder.setStationName(mapResultList.get(0).get("stationName").toString());        //油站名称
-            }
-        }
-
-        Double receivableAmt = payOrderRequest.getReceivableAmt();  //获取应收金额
-        payOrder.setReceivableAmt(receivableAmt);
-        Double oilPrice = payOrderRequest.getOilPrice();            //获取油价
-        payOrder.setOilPirce(String.valueOf(oilPrice));
 
-        Double oilLitersCheck= null;    //加油升数校验
-        if(receivableAmt != null && oilPrice != null){
-            //计算加油升数
-            oilLitersCheck = recKonOrderLiters(receivableAmt, oilPrice, 2);
-            payOrder.setOrderLiters(String.valueOf(oilLitersCheck));
+            Double receivableAmt = payOrderRequest.getReceivableAmt();  //获取应收金额
+            payOrder.setReceivableAmt(receivableAmt);
+            Double oilPrice = payOrderRequest.getOilPrice();            //获取油价
+            payOrder.setOilPirce(String.valueOf(oilPrice));
 
-            //获取该油站的某个油品的优惠方案用作校验前台传来数据 要校验字段:实收金额 优惠金额
-//            params.put("oilName", payOrderRequest.getOilName());
-//            List<Map> gradeList = customerGradeMapper.getCustomerGradeList(params);
-//            Double amtCheck =null;      //后台实收金额
-//            Double discountAmtCheck = null;     //后台优惠金额
-//            if(gradeList !=null && gradeList.size()== 1){
-//                //如果优惠方式是直降
-//                if(gradeList.get(0).get("discountWay").toString().equals("直降")){
-//                    if(gradeList.get(0).containsKey("gasoilDiscountLitre") && gradeList.get(0).get("gasoilDiscountLitre") !=null){
-//                        //优惠金额 = 每升优惠价格 x 油升数
-//                        BigDecimal b = new BigDecimal(Double.valueOf(gradeList.get(0).get("gasoilDiscountLitre").toString())).multiply(new BigDecimal(oilLitersCheck)).setScale(2, BigDecimal.ROUND_HALF_UP);
-//                        discountAmtCheck = b.doubleValue();
-//                        // 实收金额 = 应收金额 - 优惠金额
-//                        BigDecimal bigDecimal = new BigDecimal(receivableAmt).subtract(new BigDecimal(discountAmtCheck)).setScale(2, BigDecimal.ROUND_HALF_UP);
-//                        //保留俩位小数
-//                        amtCheck = bigDecimal.doubleValue();
-//
-//                    }
-//                }
-//            }
+            Double oilLitersCheck= null;    //加油升数校验
+            if(receivableAmt != null && oilPrice != null){
+                //计算加油升数
+                oilLitersCheck = recKonOrderLiters(receivableAmt, oilPrice, 2);
+                payOrder.setOrderLiters(String.valueOf(oilLitersCheck));
 
-            //实收金额 优惠金额
-            //if (amtCheck.equals(Double.valueOf(payOrderRequest.getAmt()))  && discountAmtCheck.equals(Double.valueOf(payOrderRequest.getDiscountAmt()))){
+                //实收金额 优惠金额
                 payOrder.setAmt(Double.valueOf(payOrderRequest.getAmt()));
                 payOrder.setDiscountAmt(payOrderRequest.getDiscountAmt());
                 String oilName = payOrderRequest.getOilName();
@@ -162,14 +141,25 @@ public class PayOrderServiceImpl implements PayOrderService {
                 List<PayOrder> payOrderList= payOrderMapper.selectByExample(example);
                 //返回订单号
                 ordNo= payOrderList.get(0).getOrderNo();
-                return ordNo;
-//            }else {
-//                return "0";
-//            }
-        }else {
-            return "1";
+            }else {
+                ordNo = "1";
+            }
+        }else if(payOrderRequest.getOrderType().equals("2")){       //订单类型等于2时表示非油品
+            String oilName = payOrderRequest.getOilName();
+            payOrder.setOilName(oilName);      //非油品名称
+            payOrder.setReceivableAmt(payOrderRequest.getReceivableAmt());  //非油品应收金额
+            payOrder.setAmt(Double.valueOf(payOrderRequest.getAmt()));  //非油品金额
+            //数据落地
+            payOrderMapper.insertSelective(payOrder);
+            //根据订单号查询出订单
+            PayOrderExample example=new PayOrderExample();
+            example.or().andOrderNoEqualTo(ordNo);
+            //根据订单号查询返回列表,最好是返回对象
+            List<PayOrder> payOrderList= payOrderMapper.selectByExample(example);
+            //返回订单号
+            ordNo= payOrderList.get(0).getOrderNo();
         }
-
+        return ordNo;
     }
 
     /*

+ 1 - 0
YijiaRestful/src/main/resources/mapper/PayOrderMapper.xml

@@ -764,6 +764,7 @@
         A.oil_gun               AS oilGun,
         A.order_liters 			AS orderLiters,
         A.amt 					AS amt,
+        A.order_type 			AS orderType,
         A.oil_pirce             AS oilPirce,
         A.receivable_amt        AS receivableAmt,
         A.discount_amt          AS discountAmt,

+ 87 - 122
YijiaRestful/src/main/resources/mapper/StationInfoMapper.xml

@@ -6,14 +6,12 @@
       WARNING - @mbg.generated
       This element is automatically generated by MyBatis Generator, do not modify.
     -->
-    <id column="station_id" jdbcType="INTEGER" property="stationId" />
-    <result column="station_name" jdbcType="VARCHAR" property="stationName" />
-    <result column="station_address" jdbcType="VARCHAR" property="stationAddress" />
+    <id column="dept_id" jdbcType="INTEGER" property="stationId" />
+    <result column="dept_name" jdbcType="VARCHAR" property="stationName" />
+    <result column="dept_address" jdbcType="VARCHAR" property="stationAddress" />
     <result column="oil_gun_num" jdbcType="INTEGER" property="oilGunNum" />
-    <result column="contacts" jdbcType="VARCHAR" property="contacts" />
+    <result column="leader" jdbcType="VARCHAR" property="contacts" />
     <result column="phone" jdbcType="VARCHAR" property="phone" />
-    <result column="station_group_id" jdbcType="INTEGER" property="stationGroupId" />
-    <result column="station_group_name" jdbcType="VARCHAR" property="stationGroupName" />
     <result column="station_longitude" jdbcType="VARCHAR" property="stationLongitude" />
     <result column="station_latitude" jdbcType="VARCHAR" property="stationLatitude" />
     <result column="station_pic" jdbcType="VARCHAR" property="stationPic" />
@@ -98,8 +96,8 @@
       WARNING - @mbg.generated
       This element is automatically generated by MyBatis Generator, do not modify.
     -->
-    station_id, station_name, station_address, oil_gun_num, contacts, phone, station_group_id,
-    station_group_name, station_longitude, station_latitude, mno
+    dept_id, dept_name, dept_address, oil_gun_num, leader, phone,
+    station_longitude, station_latitude, mno
   </sql>
   <sql id="Blob_Column_List">
     <!--
@@ -120,7 +118,7 @@
     <include refid="Base_Column_List" />
     ,
     <include refid="Blob_Column_List" />
-    from station_info
+    from sys_dept
     <if test="_parameter != null">
       <include refid="Example_Where_Clause" />
     </if>
@@ -140,7 +138,7 @@
     <include refid="Base_Column_List" />
     ,
     <include refid="Blob_Column_List" />
-    from station_info
+    from sys_dept
     <if test="_parameter != null">
       <include refid="Example_Where_Clause" />
     </if>
@@ -157,23 +155,23 @@
     <include refid="Base_Column_List" />
     ,
     <include refid="Blob_Column_List" />
-    from station_info
-    where station_id = #{stationId,jdbcType=INTEGER}
+    from sys_dept
+    where dept_id = #{stationId,jdbcType=INTEGER}
   </select>
   <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
     <!--
       WARNING - @mbg.generated
       This element is automatically generated by MyBatis Generator, do not modify.
     -->
-    delete from station_info
-    where station_id = #{stationId,jdbcType=INTEGER}
+    delete from sys_dept
+    where dept_id = #{stationId,jdbcType=INTEGER}
   </delete>
   <delete id="deleteByExample" parameterType="com.platform.yijia.pojo.StationInfoExample">
     <!--
       WARNING - @mbg.generated
       This element is automatically generated by MyBatis Generator, do not modify.
     -->
-    delete from station_info
+    delete from sys_dept
     <if test="_parameter != null">
       <include refid="Example_Where_Clause" />
     </if>
@@ -183,48 +181,41 @@
       WARNING - @mbg.generated
       This element is automatically generated by MyBatis Generator, do not modify.
     -->
-    insert into station_info (station_id, station_name, station_address,
-      oil_gun_num, contacts, phone,
-      station_group_id, station_group_name, station_longitude,
-      station_latitude, mno, station_pic
-      )
+    insert into sys_dept (dept_id, dept_name, dept_address,
+    oil_gun_num, leader, phone, station_longitude,
+    station_latitude, mno, station_pic
+    )
     values (#{stationId,jdbcType=INTEGER}, #{stationName,jdbcType=VARCHAR}, #{stationAddress,jdbcType=VARCHAR},
-      #{oilGunNum,jdbcType=INTEGER}, #{contacts,jdbcType=VARCHAR}, #{phone,jdbcType=VARCHAR},
-      #{stationGroupId,jdbcType=INTEGER}, #{stationGroupName,jdbcType=VARCHAR}, #{stationLongitude,jdbcType=VARCHAR},
-      #{stationLatitude,jdbcType=VARCHAR}, #{mno,jdbcType=INTEGER}, #{stationPic,jdbcType=LONGVARBINARY}
-      )
+    #{oilGunNum,jdbcType=INTEGER}, #{contacts,jdbcType=VARCHAR}, #{phone,jdbcType=VARCHAR},
+    #{stationLongitude,jdbcType=VARCHAR},
+    #{stationLatitude,jdbcType=VARCHAR}, #{mno,jdbcType=INTEGER}, #{stationPic,jdbcType=LONGVARBINARY}
+    )
   </insert>
   <insert id="insertSelective" parameterType="com.platform.yijia.pojo.StationInfo">
     <!--
       WARNING - @mbg.generated
       This element is automatically generated by MyBatis Generator, do not modify.
     -->
-    insert into station_info
+    insert into sys_dept
     <trim prefix="(" suffix=")" suffixOverrides=",">
       <if test="stationId != null">
-        station_id,
+        dept_id,
       </if>
       <if test="stationName != null">
-        station_name,
+        dept_name,
       </if>
       <if test="stationAddress != null">
-        station_address,
+        dept_address,
       </if>
       <if test="oilGunNum != null">
         oil_gun_num,
       </if>
-      <if test="contacts != null">
-        contacts,
+      <if test="leader != null">
+        leader,
       </if>
       <if test="phone != null">
         phone,
       </if>
-      <if test="stationGroupId != null">
-        station_group_id,
-      </if>
-      <if test="stationGroupName != null">
-        station_group_name,
-      </if>
       <if test="stationLongitude != null">
         station_longitude,
       </if>
@@ -257,12 +248,6 @@
       <if test="phone != null">
         #{phone,jdbcType=VARCHAR},
       </if>
-      <if test="stationGroupId != null">
-        #{stationGroupId,jdbcType=INTEGER},
-      </if>
-      <if test="stationGroupName != null">
-        #{stationGroupName,jdbcType=VARCHAR},
-      </if>
       <if test="stationLongitude != null">
         #{stationLongitude,jdbcType=VARCHAR},
       </if>
@@ -282,7 +267,7 @@
       WARNING - @mbg.generated
       This element is automatically generated by MyBatis Generator, do not modify.
     -->
-    select count(*) from station_info
+    select count(*) from sys_dept
     <if test="_parameter != null">
       <include refid="Example_Where_Clause" />
     </if>
@@ -292,32 +277,26 @@
       WARNING - @mbg.generated
       This element is automatically generated by MyBatis Generator, do not modify.
     -->
-    update station_info
+    update sys_dept
     <set>
       <if test="record.stationId != null">
-        station_id = #{record.stationId,jdbcType=INTEGER},
+        dept_id = #{record.stationId,jdbcType=INTEGER},
       </if>
       <if test="record.stationName != null">
-        station_name = #{record.stationName,jdbcType=VARCHAR},
+        dept_name = #{record.stationName,jdbcType=VARCHAR},
       </if>
       <if test="record.stationAddress != null">
-        station_address = #{record.stationAddress,jdbcType=VARCHAR},
+        dept_address = #{record.stationAddress,jdbcType=VARCHAR},
       </if>
       <if test="record.oilGunNum != null">
         oil_gun_num = #{record.oilGunNum,jdbcType=INTEGER},
       </if>
       <if test="record.contacts != null">
-        contacts = #{record.contacts,jdbcType=VARCHAR},
+        leader = #{record.contacts,jdbcType=VARCHAR},
       </if>
       <if test="record.phone != null">
         phone = #{record.phone,jdbcType=VARCHAR},
       </if>
-      <if test="record.stationGroupId != null">
-        station_group_id = #{record.stationGroupId,jdbcType=INTEGER},
-      </if>
-      <if test="record.stationGroupName != null">
-        station_group_name = #{record.stationGroupName,jdbcType=VARCHAR},
-      </if>
       <if test="record.stationLongitude != null">
         station_longitude = #{record.stationLongitude,jdbcType=VARCHAR},
       </if>
@@ -340,19 +319,17 @@
       WARNING - @mbg.generated
       This element is automatically generated by MyBatis Generator, do not modify.
     -->
-    update station_info
-    set station_id = #{record.stationId,jdbcType=INTEGER},
-      station_name = #{record.stationName,jdbcType=VARCHAR},
-      station_address = #{record.stationAddress,jdbcType=VARCHAR},
-      oil_gun_num = #{record.oilGunNum,jdbcType=INTEGER},
-      contacts = #{record.contacts,jdbcType=VARCHAR},
-      phone = #{record.phone,jdbcType=VARCHAR},
-      station_group_id = #{record.stationGroupId,jdbcType=INTEGER},
-      station_group_name = #{record.stationGroupName,jdbcType=VARCHAR},
-      station_longitude = #{record.stationLongitude,jdbcType=VARCHAR},
-      station_latitude = #{record.stationLatitude,jdbcType=VARCHAR},
-      mno = #{record.mno,jdbcType=INTEGER},
-      station_pic = #{record.stationPic,jdbcType=LONGVARBINARY}
+    update sys_dept
+    set dept_id = #{record.stationId,jdbcType=INTEGER},
+    dept_name = #{record.stationName,jdbcType=VARCHAR},
+    dept_address = #{record.stationAddress,jdbcType=VARCHAR},
+    oil_gun_num = #{record.oilGunNum,jdbcType=INTEGER},
+    leader = #{record.contacts,jdbcType=VARCHAR},
+    phone = #{record.phone,jdbcType=VARCHAR},
+    station_longitude = #{record.stationLongitude,jdbcType=VARCHAR},
+    station_latitude = #{record.stationLatitude,jdbcType=VARCHAR},
+    mno = #{record.mno,jdbcType=INTEGER},
+    station_pic = #{record.stationPic,jdbcType=LONGVARBINARY}
     <if test="_parameter != null">
       <include refid="Update_By_Example_Where_Clause" />
     </if>
@@ -362,18 +339,16 @@
       WARNING - @mbg.generated
       This element is automatically generated by MyBatis Generator, do not modify.
     -->
-    update station_info
-    set station_id = #{record.stationId,jdbcType=INTEGER},
-      station_name = #{record.stationName,jdbcType=VARCHAR},
-      station_address = #{record.stationAddress,jdbcType=VARCHAR},
-      oil_gun_num = #{record.oilGunNum,jdbcType=INTEGER},
-      contacts = #{record.contacts,jdbcType=VARCHAR},
-      phone = #{record.phone,jdbcType=VARCHAR},
-      station_group_id = #{record.stationGroupId,jdbcType=INTEGER},
-      station_group_name = #{record.stationGroupName,jdbcType=VARCHAR},
-      station_longitude = #{record.stationLongitude,jdbcType=VARCHAR},
-      station_latitude = #{record.stationLatitude,jdbcType=VARCHAR},
-      mno = #{record.mno,jdbcType=INTEGER}
+    update sys_dept
+    set dept_id = #{record.stationId,jdbcType=INTEGER},
+    dept_name = #{record.stationName,jdbcType=VARCHAR},
+    dept_address = #{record.stationAddress,jdbcType=VARCHAR},
+    oil_gun_num = #{record.oilGunNum,jdbcType=INTEGER},
+    leader = #{record.contacts,jdbcType=VARCHAR},
+    phone = #{record.phone,jdbcType=VARCHAR},
+    station_longitude = #{record.stationLongitude,jdbcType=VARCHAR},
+    station_latitude = #{record.stationLatitude,jdbcType=VARCHAR},
+    mno = #{record.mno,jdbcType=INTEGER}
     <if test="_parameter != null">
       <include refid="Update_By_Example_Where_Clause" />
     </if>
@@ -383,29 +358,23 @@
       WARNING - @mbg.generated
       This element is automatically generated by MyBatis Generator, do not modify.
     -->
-    update station_info
+    update sys_dept
     <set>
       <if test="stationName != null">
-        station_name = #{stationName,jdbcType=VARCHAR},
+        dept_name = #{stationName,jdbcType=VARCHAR},
       </if>
       <if test="stationAddress != null">
-        station_address = #{stationAddress,jdbcType=VARCHAR},
+        dept_address = #{stationAddress,jdbcType=VARCHAR},
       </if>
       <if test="oilGunNum != null">
         oil_gun_num = #{oilGunNum,jdbcType=INTEGER},
       </if>
       <if test="contacts != null">
-        contacts = #{contacts,jdbcType=VARCHAR},
+        leader = #{contacts,jdbcType=VARCHAR},
       </if>
       <if test="phone != null">
         phone = #{phone,jdbcType=VARCHAR},
       </if>
-      <if test="stationGroupId != null">
-        station_group_id = #{stationGroupId,jdbcType=INTEGER},
-      </if>
-      <if test="stationGroupName != null">
-        station_group_name = #{stationGroupName,jdbcType=VARCHAR},
-      </if>
       <if test="stationLongitude != null">
         station_longitude = #{stationLongitude,jdbcType=VARCHAR},
       </if>
@@ -419,52 +388,48 @@
         station_pic = #{stationPic,jdbcType=LONGVARBINARY},
       </if>
     </set>
-    where station_id = #{stationId,jdbcType=INTEGER}
+    where dept_id = #{stationId,jdbcType=INTEGER}
   </update>
   <update id="updateByPrimaryKeyWithBLOBs" parameterType="com.platform.yijia.pojo.StationInfo">
     <!--
       WARNING - @mbg.generated
       This element is automatically generated by MyBatis Generator, do not modify.
     -->
-    update station_info
-    set station_name = #{stationName,jdbcType=VARCHAR},
-      station_address = #{stationAddress,jdbcType=VARCHAR},
-      oil_gun_num = #{oilGunNum,jdbcType=INTEGER},
-      contacts = #{contacts,jdbcType=VARCHAR},
-      phone = #{phone,jdbcType=VARCHAR},
-      station_group_id = #{stationGroupId,jdbcType=INTEGER},
-      station_group_name = #{stationGroupName,jdbcType=VARCHAR},
-      station_longitude = #{stationLongitude,jdbcType=VARCHAR},
-      station_latitude = #{stationLatitude,jdbcType=VARCHAR},
-      mno = #{mno,jdbcType=INTEGER},
-      station_pic = #{stationPic,jdbcType=LONGVARBINARY}
-    where station_id = #{stationId,jdbcType=INTEGER}
+    update sys_dept
+    set dept_name = #{stationName,jdbcType=VARCHAR},
+    dept_address = #{stationAddress,jdbcType=VARCHAR},
+    oil_gun_num = #{oilGunNum,jdbcType=INTEGER},
+    leader = #{contacts,jdbcType=VARCHAR},
+    phone = #{phone,jdbcType=VARCHAR},
+    station_longitude = #{stationLongitude,jdbcType=VARCHAR},
+    station_latitude = #{stationLatitude,jdbcType=VARCHAR},
+    mno = #{mno,jdbcType=INTEGER},
+    station_pic = #{stationPic,jdbcType=LONGVARBINARY}
+    where dept_id = #{stationId,jdbcType=INTEGER}
   </update>
   <update id="updateByPrimaryKey" parameterType="com.platform.yijia.pojo.StationInfo">
     <!--
       WARNING - @mbg.generated
       This element is automatically generated by MyBatis Generator, do not modify.
     -->
-    update station_info
-    set station_name = #{stationName,jdbcType=VARCHAR},
-      station_address = #{stationAddress,jdbcType=VARCHAR},
-      oil_gun_num = #{oilGunNum,jdbcType=INTEGER},
-      contacts = #{contacts,jdbcType=VARCHAR},
-      phone = #{phone,jdbcType=VARCHAR},
-      station_group_id = #{stationGroupId,jdbcType=INTEGER},
-      station_group_name = #{stationGroupName,jdbcType=VARCHAR},
-      station_longitude = #{stationLongitude,jdbcType=VARCHAR},
-      station_latitude = #{stationLatitude,jdbcType=VARCHAR},
-      mno = #{mno,jdbcType=INTEGER}
-    where station_id = #{stationId,jdbcType=INTEGER}
+    update sys_dept
+    set dept_name = #{stationName,jdbcType=VARCHAR},
+    dept_address = #{stationAddress,jdbcType=VARCHAR},
+    oil_gun_num = #{oilGunNum,jdbcType=INTEGER},
+    leader = #{contacts,jdbcType=VARCHAR},
+    phone = #{phone,jdbcType=VARCHAR},
+    station_longitude = #{stationLongitude,jdbcType=VARCHAR},
+    station_latitude = #{stationLatitude,jdbcType=VARCHAR},
+    mno = #{mno,jdbcType=INTEGER}
+    where dept_id = #{stationId,jdbcType=INTEGER}
   </update>
 
   <!--查询油站的优惠方式-->
   <select id="getStationDiscountWay" parameterType="String" resultType="String">
     SELECT
-        discount_setting AS discountSetting
+    discount_setting AS discountSetting
     FROM
-        station_pay
+    station_pay
     <where>
       <if test="stationId !='' and stationId != null" >
         station_id = #{stationId}
@@ -475,14 +440,14 @@
   <!--查询油站小程序AppId和AppSecret-->
   <select id="getStationAppIdAndAppSecret" parameterType="Integer" resultType="Map">
     SELECT
-        mno             AS mno,
-        app_id          AS appId,
-        app_secret      AS appSecret
+    mno             AS mno,
+    app_id          AS appId,
+    app_secret      AS appSecret
     FROM
-        station_info
+    sys_dept
     <where>
       <if test="stationId !='' and stationId != null" >
-        station_id = #{stationId}
+        dept_id = #{stationId}
       </if>
     </where>
   </select>