Bladeren bron

增加字段,查询设置倒序排列

MS-QJVSRANLTYEO\Administrator 4 jaren geleden
bovenliggende
commit
8bdd94432b

+ 46 - 4
Yijia-SaaS/yijia-station/src/main/java/com/yijia/station/domain/PayOrder.java

@@ -55,7 +55,7 @@ public class PayOrder extends BaseEntity
 
     /** 油品价格 */
     @Excel(name = "油品价格")
-    private String oilPirce;
+    private BigDecimal oilPirce;
 
     /** 油品类型(1.柴油 2 汽油) */
     @Excel(name = "油品类型", readConverterExp = "1=.柴油,2=,汽=油")
@@ -163,6 +163,18 @@ public class PayOrder extends BaseEntity
     @Excel(name = "订单类型", readConverterExp = "1=.柴油,2.汽油,积分:3.现金+积分4.现金,5.积分")
     private String orderType;
 
+    /** 车牌号 */
+    @Excel(name = "车牌号")
+    private String carNo;
+
+    /** 客户电话 */
+    @Excel(name = "客户电话")
+    private String customerPhone;
+
+    /** 客户等级 */
+    @Excel(name = "客户等级")
+    private String customerGrade;
+
     /** pos支付金额 */
     @Excel(name = "汽油金额")
     private BigDecimal qyAmt;
@@ -185,7 +197,7 @@ public class PayOrder extends BaseEntity
         this.cyAmt = cyAmt;
     }
 
-    public void setOrderId(Long orderId)
+    public void setOrderId(Long orderId) 
     {
         this.orderId = orderId;
     }
@@ -266,12 +278,12 @@ public class PayOrder extends BaseEntity
     {
         return oilName;
     }
-    public void setOilPirce(String oilPirce) 
+    public void setOilPirce(BigDecimal oilPirce) 
     {
         this.oilPirce = oilPirce;
     }
 
-    public String getOilPirce() 
+    public BigDecimal getOilPirce() 
     {
         return oilPirce;
     }
@@ -509,6 +521,33 @@ public class PayOrder extends BaseEntity
     {
         return orderType;
     }
+    public void setCarNo(String carNo) 
+    {
+        this.carNo = carNo;
+    }
+
+    public String getCarNo() 
+    {
+        return carNo;
+    }
+    public void setCustomerPhone(String customerPhone) 
+    {
+        this.customerPhone = customerPhone;
+    }
+
+    public String getCustomerPhone() 
+    {
+        return customerPhone;
+    }
+    public void setCustomerGrade(String customerGrade) 
+    {
+        this.customerGrade = customerGrade;
+    }
+
+    public String getCustomerGrade() 
+    {
+        return customerGrade;
+    }
 
     @Override
     public String toString() {
@@ -549,6 +588,9 @@ public class PayOrder extends BaseEntity
             .append("payDate", getPayDate())
             .append("createdDate", getCreatedDate())
             .append("orderType", getOrderType())
+            .append("carNo", getCarNo())
+            .append("customerPhone", getCustomerPhone())
+            .append("customerGrade", getCustomerGrade())
             .append("cyAmt", getCyAmt())
             .append("qyAmt", getQyAmt())
             .toString();

+ 43 - 1
Yijia-SaaS/yijia-station/src/main/java/com/yijia/station/domain/StationClassStructure.java

@@ -198,6 +198,18 @@ public class StationClassStructure extends BaseEntity
     @Excel(name = "会员支付金额")
     private BigDecimal memberAmt;
 
+    /** 车牌号 */
+    @Excel(name = "车牌号")
+    private String carNo;
+
+    /** 客户电话 */
+    @Excel(name = "客户电话")
+    private String customerPhone;
+
+    /** 客户等级 */
+    @Excel(name = "客户等级")
+    private String customerGrade;
+
     public void setId(Long id) 
     {
         this.id = id;
@@ -288,7 +300,7 @@ public class StationClassStructure extends BaseEntity
     {
         return consumer;
     }
-    public void setAmt(Long amt)
+    public void setAmt(Long amt) 
     {
         this.amt = amt;
     }
@@ -549,6 +561,33 @@ public class StationClassStructure extends BaseEntity
     {
         return memberAmt;
     }
+    public void setCarNo(String carNo) 
+    {
+        this.carNo = carNo;
+    }
+
+    public String getCarNo() 
+    {
+        return carNo;
+    }
+    public void setCustomerPhone(String customerPhone) 
+    {
+        this.customerPhone = customerPhone;
+    }
+
+    public String getCustomerPhone() 
+    {
+        return customerPhone;
+    }
+    public void setCustomerGrade(String customerGrade) 
+    {
+        this.customerGrade = customerGrade;
+    }
+
+    public String getCustomerGrade() 
+    {
+        return customerGrade;
+    }
 
     @Override
     public String toString() {
@@ -592,6 +631,9 @@ public class StationClassStructure extends BaseEntity
             .append("score", getScore())
             .append("memberNo", getMemberNo())
             .append("memberAmt", getMemberAmt())
+            .append("carNo", getCarNo())
+            .append("customerPhone", getCustomerPhone())
+            .append("customerGrade", getCustomerGrade())
             .toString();
     }
 }

+ 19 - 59
Yijia-SaaS/yijia-station/src/main/resources/mapper/station/PayOrderMapper.xml

@@ -41,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, 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 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">
@@ -60,7 +61,7 @@ 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>
@@ -83,72 +84,22 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <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}
     </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=",">
@@ -187,6 +138,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>
@@ -224,6 +178,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>
 
@@ -265,6 +222,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>

+ 18 - 2
Yijia-SaaS/yijia-station/src/main/resources/mapper/station/StationClassStructureMapper.xml

@@ -44,11 +44,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <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"    />
     </resultMap>
 
     <sql id="selectStationClassStructureVo">
-        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 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">
@@ -92,7 +95,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <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">
@@ -123,7 +130,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             </where>
 		)
     </select>
-    
+
     <select id="selectStationClassStructureById" parameterType="Long" resultMap="StationClassStructureResult">
         <include refid="selectStationClassStructureVo"/>
         where id = #{id}
@@ -187,6 +194,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <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="orderNo != null">#{orderNo},</if>
@@ -227,6 +237,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <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>
 
@@ -271,6 +284,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <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/src/main/resources/mapper/station/StationClassesSummaryMapper.xml

@@ -42,6 +42,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="dzkAmt != null "> and dzk_amt = #{dzkAmt}</if>
             <if test="classesMan != null  and classesMan != ''"> and classes_man = #{classesMan}</if>
         </where>
+        order by id desc
     </select>
     
     <select id="selectStationClassesSummaryById" parameterType="Long" resultMap="StationClassesSummaryResult">

+ 1 - 0
Yijia-SaaS/yijia-station/src/main/resources/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/src/main/resources/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/src/main/resources/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/src/main/resources/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">