소스 검색

修改油站班结信息查看

MS-QJVSRANLTYEO\Administrator 4 년 전
부모
커밋
eafd6dfc7a

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

@@ -363,7 +363,7 @@ public class StationClassStructureController extends BaseController
                         cell.setCellValue(list.get(j).getZfbAmt()+"");
                         cell.setCellStyle(style);
                         cell = row.createCell(9);
-                        cell.setCellValue(listP.get(j).getXjAmt()+"");
+                        cell.setCellValue(list.get(j).getXjAmt()+"");
                         cell.setCellStyle(style);
                         cell = row.createCell(10);
                         cell.setCellValue(list.get(j).getMemberAmt()+"");

+ 26 - 4
Yijia-SaaS/yijia-station/src/main/java/com/yijia/station/domain/StationClassesSummary.java

@@ -28,13 +28,13 @@ public class StationClassesSummary extends BaseEntity
     private String classesNo;
 
     /** 班次开始时间 */
-    @JsonFormat(pattern = "yyyy-MM-dd hh:mm:ss")
-    @Excel(name = "班次开始时间", width = 30, dateFormat = "yyyy-MM-dd hh:mm:ss")
+    @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 hh:mm:ss")
-    @Excel(name = "班次结束时间", width = 30, dateFormat = "yyyy-MM-dd hh:mm:ss")
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    @Excel(name = "班次结束时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
     private Date endDate;
 
     /** 油站id */
@@ -85,6 +85,28 @@ public class StationClassesSummary extends BaseEntity
     @Excel(name = "班结人")
     private String classesMan;
 
+    /**
+     * 查询班次号,查询班结名称
+     */
+    private String likeClassesNo;
+    private String likeClassesMan;
+
+    public String getLikeClassesNo() {
+        return likeClassesNo;
+    }
+
+    public void setLikeClassesNo(String likeClassesNo) {
+        this.likeClassesNo = likeClassesNo;
+    }
+
+    public String getLikeClassesMan() {
+        return likeClassesMan;
+    }
+
+    public void setLikeClassesMan(String likeClassesMan) {
+        this.likeClassesMan = likeClassesMan;
+    }
+
     private List<String> stationIdList;
 
     public List<String> getStationIdList() {

+ 39 - 31
Yijia-SaaS/yijia-station/src/main/resources/mapper/station/StationClassStructureMapper.xml

@@ -174,33 +174,29 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 <!--    </where>-->
 <!--    GROUP BY oil_personnel-->
     <select id="listPersonnelPayStructure" parameterType="StationClassStructure" resultMap="StationClassStructureResult">
-        SELECT oil_personnel,GROUP_CONCAT(DISTINCT oil_gun) oil_gun,
+        SELECT   oil_personnel,GROUP_CONCAT(DISTINCT oil_gun) oil_gun,
         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,
-        (SELECT COUNT(b.order_no) from station_class_structure b
-            <where>
-                 and b.pay_type="xj"
-                <if test="classStructureNo != null and classStructureNo != ''"> and b.class_structure_no = #{classStructureNo}</if>
-            </where>
-         ) xj_num,
-        (SELECT COUNT(c.order_no) from station_class_structure c
-            <where>
-                and c.pay_type="zfb"
-                <if test="classStructureNo != null and classStructureNo != ''"> and c.class_structure_no = #{classStructureNo}</if>
-            </where>
-        ) zfb_num,
-        (SELECT COUNT(d.order_no) from station_class_structure d
-            <where>
-                and d.pay_type="wx"
-                <if test="classStructureNo != null and classStructureNo != ''"> and d.class_structure_no = #{classStructureNo}</if>
-            </where>
-        ) wx_num
-        from  station_class_structure a
+        sum(e.xj_num)	xj_num,sum(e.zfb_num)	zfb_num,sum(e.wx_num)	wx_num
+        from (
+        SELECT station_id,class_structure_no, order_type,oil_personnel,oil_gun,discount_amt,discount_coupon_amt,wx_amt,zfb_amt,xj_amt,member_amt,
+        (SELECT COUNT(b.order_no) from station_class_structure b where 1=1 and a.id = b.id and b.pay_type="xj" ) xj_num,
+        (SELECT COUNT(c.order_no) from station_class_structure c where 1=1 and a.id = c.id and c.pay_type="zfb" ) zfb_num,
+        (SELECT COUNT(d.order_no) from station_class_structure d where 1=1 and a.id = d.id and d.pay_type="wx" ) wx_num
+        from station_class_structure  a
         <where>
+            <if test="stationId != null and stationId != ''"> and a.station_id = #{stationId}</if>
             <if test="classStructureNo != null and classStructureNo != ''"> and a.class_structure_no = #{classStructureNo}</if>
+            <if test="orderType != null  and orderType != ''"> and a.order_type = #{orderType}</if>
         </where>
-        GROUP BY a.oil_personnel
+        ) e
+        <where>
+            <if test="stationId != null and stationId != ''"> and e.station_id = #{stationId}</if>
+            <if test="classStructureNo != null and classStructureNo != ''"> and e.class_structure_no = #{classStructureNo}</if>
+            <if test="orderType != null  and orderType != ''"> and e.order_type = #{orderType}</if>
+        </where>
+        GROUP BY e.oil_personnel
     </select>
 
     <select id="listClass" parameterType="StationClassStructure" resultMap="StationClassStructureResult">
@@ -232,22 +228,34 @@ 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>
+            <if test="classStructureNo != null and classStructureNo != ''"> and a.class_structure_no = #{classStructureNo}</if>
         </where>
         GROUP BY a.oil_name,a.station_id,a.class_start_date,a.class_structure_date,a.class_structure_man) c
     </select>
 
     <!--按员工/支付方式汇总数据-->
     <select id="listPersonnelPayStructureSum" parameterType="StationClassStructure" resultMap="StationClassStructureResult">
-        SELECT sum(wx_num) wx_num,sum(zfb_num) zfb_num,sum(xj_num) 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 (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
+      SELECT GROUP_CONCAT(DISTINCT oil_gun) oil_gun,
+        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,
+				sum(e.xj_num)	xj_num,sum(e.zfb_num)	zfb_num,sum(e.wx_num)	wx_num
+	from (SELECT  station_id,class_structure_no, order_type,oil_personnel,oil_gun,discount_amt,discount_coupon_amt,wx_amt,zfb_amt,xj_amt,member_amt,
+	(SELECT COUNT(b.order_no) from station_class_structure b where 1=1 and a.id = b.id and b.pay_type="xj" ) xj_num,
+	(SELECT COUNT(c.order_no) from station_class_structure c where 1=1 and a.id = c.id and c.pay_type="zfb" ) zfb_num,
+	(SELECT COUNT(d.order_no) from station_class_structure d where 1=1 and a.id = d.id and d.pay_type="wx" ) wx_num
+	from station_class_structure  a
         <where>
-            <if test="stationId != null and stationId != ''"> and station_id = #{stationId}</if>
-            <if test="classStructureNo != null and classStructureNo != ''"> and class_structure_no = #{classStructureNo}</if>
-            <if test="orderType != null  and orderType != ''"> and order_type = #{orderType}</if>
+            <if test="stationId != null "> and a.station_id = #{stationId}</if>
+            <if test="classStructureNo != null and classStructureNo != ''"> and a.class_structure_no = #{classStructureNo}</if>
+            <if test="orderType != null  and orderType != ''"> and a.order_type = #{orderType}</if>
         </where>
-        GROUP BY oil_personnel) a
+     ) e
+    <where>
+        <if test="stationId != null "> and e.station_id = #{stationId}</if>
+        <if test="classStructureNo != null and classStructureNo != ''"> and e.class_structure_no = #{classStructureNo}</if>
+        <if test="orderType != null  and orderType != ''"> and e.order_type = #{orderType}</if>
+    </where>
     </select>
 
     <select id="listPersonnelStructureSum" parameterType="StationClassStructure" resultMap="StationClassStructureResult">
@@ -451,10 +459,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     </delete>
 
     <delete id="deleteStationClassStructureByIds" parameterType="String">
-        delete from station_class_structure where id in 
+        delete from station_class_structure where id in
         <foreach item="id" collection="array" open="(" separator="," close=")">
             #{id}
         </foreach>
     </delete>
-    
+
 </mapper>

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

@@ -52,6 +52,18 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
                     #{item}
                 </foreach>
             </if>
+            <if test="likeClassesMan != null  and likeClassesMan != ''">
+                 and classes_man like concat('%', #{likeClassesMan}, '%')
+            </if>
+            <if test="likeClassesNo != null  and likeClassesNo != ''">
+                and classes_no like concat('%', #{likeClassesNo}, '%')
+            </if>
+            <if test="beginTime != null and beginTime != ''"><!-- 查询班结开始时间检索 -->
+                AND date_format(end_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(end_date,'%y-%m-%d %H:%i:%s') &lt;= date_format(#{endTime},'%y-%m-%d %H:%i:%s')
+            </if>
         </where>
         order by id desc
     </select>
@@ -80,6 +92,18 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
                     #{item}
                 </foreach>
             </if>
+            <if test="likeClassesMan != null  and likeClassesMan != ''">
+                and classes_man like concat('%', #{likeClassesMan}, '%')
+            </if>
+            <if test="likeClassesNo != null  and likeClassesNo != ''">
+                and classes_no like concat('%', #{likeClassesNo}, '%')
+            </if>
+            <if test="beginTime != null and beginTime != ''"><!-- 查询班结开始时间检索 -->
+                AND date_format(end_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(end_date,'%y-%m-%d %H:%i:%s') &lt;= date_format(#{endTime},'%y-%m-%d %H:%i:%s')
+            </if>
         </where>
         order by id desc
         limit 1;