| 
					
				 | 
			
			
				@@ -3,7 +3,7 @@ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 <mapper namespace="com.yijia.station.mapper.PayOrderMapper"> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-     
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     <resultMap type="PayOrder" id="PayOrderResult"> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         <result property="orderId"    column="order_id"    /> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         <result property="orderNo"    column="order_no"    /> 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -38,6 +38,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         <result property="payType"    column="pay_type"    /> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         <result property="payWay"    column="pay_way"    /> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         <result property="oilPersonnel"    column="oil_personnel"    /> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        <result property="oilPersonnelId"    column="oil_personnel_id"    /> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         <result property="payDate"    column="pay_date"    /> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         <result property="createdDate"    column="created_date"    /> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         <result property="orderType"    column="order_type"    /> 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -49,22 +50,33 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         <result property="xjNum"    column="xj_num"  /> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         <result property="qyAmt"    column="qy_amt"  /> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         <result property="cyAmt"    column="cy_amt"  /> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        <result property="sellAmt"    column="sell_amt"  /> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        <result property="sellDiscountAmt"    column="sell_discount_amt"  /> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        <result property="mobilePhone"    column="mobile_phone"  /> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        <result property="sellOilPrice"    column="sell_oil_price"  /> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        <result property="driverOilPrice"    column="driver_oil_price"  /> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        <result property="countNum"    column="count_num"  /> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        <result property="driverDiscountAmt"    column="driver_discount_amt"  /> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     </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, car_no, customer_phone, customer_grade from pay_order 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        select order_id, order_no, station_id,d.dept_name as station_name, p.status,consumer_id, consumer, oil_gun, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+         oil_name, oil_pirce, oil_type, order_liters, amt, receivable_amt, received_amt, discount_amt,sell_oil_price,driver_oil_price,oil_personnel_id, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+          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,sell_amt,sell_discount_amt,driver_discount_amt 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            from pay_order p join sys_dept d on p.station_id =d.dept_id 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     </sql> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     <select id="selectPayOrderList" parameterType="PayOrder" resultMap="PayOrderResult"> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         <include refid="selectPayOrderVo"/> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        <where>   
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            <if test="orderNo != null  and orderNo != ''"> and order_no = #{orderNo}</if> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        <where> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            <if test="orderNo != null  and orderNo != ''"> and order_no like concat('%', #{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="status != null  and status != ''"> and status = #{status}</if> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            <if test="status != null  and status != ''"> and p.status = #{status}</if> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             <if test="consumerId != null "> and consumer_id = #{consumerId}</if> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            <if test="consumer != null  and consumer != ''"> and consumer = #{consumer}</if> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            <if test="consumer != null  and consumer != ''"> and consumer like concat('%', #{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 oil_pirce = #{oilPirce}</if> 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -91,6 +103,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             <if test="payType != null  and payType != ''"> and pay_type = #{payType}</if> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             <if test="payWay != null  and payWay != ''"> and pay_way = #{payWay}</if> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             <if test="oilPersonnel != null  and oilPersonnel != ''"> and oil_personnel = #{oilPersonnel}</if> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            <if test="oilPersonnelId != null  and oilPersonnelId != ''"> and oil_personnel_id = #{oilPersonnelId}</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> 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -119,12 +132,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     <!--查询导出数据--> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     <select id="selectPayOrderExport" parameterType="PayOrder" resultMap="PayOrderResult"> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        select order_no,oil_name,oil_pirce,order_liters, amt,consumer,oil_personnel,oil_gun,pay_type,pay_way 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        select order_no,oil_name,oil_pirce,order_liters, amt,consumer,oil_personnel,oil_gun,pay_type,pay_way,sell_oil_price,driver_oil_price 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         from pay_order 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         <where> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             <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="status != null  and status != ''"> and status = #{status}</if> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             <if test="consumerId != null "> and consumer_id = #{consumerId}</if> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             <if test="consumer != null  and consumer != ''"> and consumer = #{consumer}</if> 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -158,8 +170,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             <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> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            <if test="customerPhone != null  and customerPhone != ''"> and customer_phone like concat('%',#{customerPhone}, '%') </if> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            <if test="customerGrade != null  and customerGrade != ''"> and customer_grade like concat('%',#{customerGrade}, '%') </if> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             <if test="stationIdList != null "> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 and station_id in 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 <foreach item="item" index="index" collection="stationIdList" 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -167,15 +179,209 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                     #{item} 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 </foreach> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             </if> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            <if test="beginTime != null and beginTime != ''"><!-- 开始时间检索 --> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                AND date_format(created_date,'%y-%m-%d %H:%i:%s') >= 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') <= date_format(#{endTime},'%y-%m-%d %H:%i:%s') 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            </if> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        </where> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        order by order_id desc 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    </select> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    <!--用戶信息关联订单查询--> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    <select id="selectUserPayOrderList" parameterType="PayOrder" resultMap="PayOrderResult"> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        SELECT order_id,dept_name as station_name,oil_name,order_no,p.oil_pirce,order_liters,receivable_amt,amt,sell_amt,sell_discount_amt,amt,discount_amt,pay_date,mobile_phone as customer_phone,sell_oil_price,driver_oil_price,driver_discount_amt 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        from pay_order p 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        left join sys_dept d on d.dept_id =p.station_id 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        join app_user_info a on a.user_id=p.consumer_id 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        <where> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            <if test="orderNo != null  and orderNo != ''"> and p.order_no = #{orderNo}</if> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            <if test="stationId != null "> and p.station_id = #{stationId}</if> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            <if test="status != null  and status != ''"> and p.status = #{status}</if> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            <if test="consumerId != null "> and consumer_id = #{consumerId}</if> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            <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 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> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            <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="oilPersonnelId != null  and oilPersonnelId != ''"> and oil_personnel_id = #{oilPersonnelId}</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="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 mobile_phone like concat('%',#{customerPhone}, '%') </if> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            <if test="customerGrade != null  and customerGrade != ''"> and customer_grade like concat('%',#{customerGrade}, '%') </if> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            <if test="stationIdList != null "> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                and p.station_id in 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                <foreach item="item" index="index" collection="stationIdList" 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                         open="(" separator="," close=")"> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    #{item} 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                </foreach> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            </if> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            <if test="beginTime != null and beginTime != ''"><!-- 开始时间检索 --> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                AND date_format(p.created_date,'%y-%m-%d %H:%i:%s') >= date_format(#{beginTime},'%y-%m-%d %H:%i:%s') 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            </if> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            <if test="endTime != null and endTime != ''"><!-- 结束时间检索 --> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                AND date_format(p.created_date,'%y-%m-%d %H:%i:%s') <= date_format(#{endTime},'%y-%m-%d %H:%i:%s') 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            </if> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        </where> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        order by order_id desc 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    </select> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    <!--查询LNG导出数据--> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    <select id="selectLNGPayOrderExport" parameterType="PayOrder" resultMap="PayOrderResult"> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        SELECT order_id,dept_name as station_name,oil_name,order_no,p.oil_pirce,order_liters,receivable_amt,amt,sell_amt,sell_discount_amt,amt,discount_amt,pay_date,mobile_phone,sell_oil_price,driver_oil_price,driver_discount_amt 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        from pay_order p 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        left join sys_dept d on d.dept_id =p.station_id 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        join app_user_info a on a.user_id=p.consumer_id 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        <where> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            <if test="orderNo != null  and orderNo != ''"> and p.order_no = #{orderNo}</if> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            <if test="stationId != null "> and p.station_id = #{stationId}</if> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            <if test="status != null  and status != ''"> and p.status = #{status}</if> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            <if test="consumerId != null "> and consumer_id = #{consumerId}</if> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            <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 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> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            <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="oilPersonnelId != null  and oilPersonnelId != ''"> and oil_personnel_id = #{oilPersonnelId}</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="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 mobile_phone like concat('%',#{customerPhone}, '%') </if> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            <if test="customerGrade != null  and customerGrade != ''"> and customer_grade like concat('%',#{customerGrade}, '%') </if> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            <if test="stationIdList != null "> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                and p.station_id in 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                <foreach item="item" index="index" collection="stationIdList" 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                         open="(" separator="," close=")"> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    #{item} 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                </foreach> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            </if> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            <if test="beginTime != null and beginTime != ''"><!-- 开始时间检索 --> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                AND date_format(p.created_date,'%y-%m-%d %H:%i:%s') >= date_format(#{beginTime},'%y-%m-%d %H:%i:%s') 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            </if> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            <if test="endTime != null and endTime != ''"><!-- 结束时间检索 --> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                AND date_format(p.created_date,'%y-%m-%d %H:%i:%s') <= date_format(#{endTime},'%y-%m-%d %H:%i:%s') 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            </if> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        </where> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        order by order_id desc 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    </select> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    <select id="LNGDeptList" parameterType="PayOrder" resultMap="PayOrderResult"> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        SELECT dept_name as station_name,order_id,order_no,oil_name,p.oil_pirce,sell_oil_price,order_liters,receivable_amt,sell_amt,pay_date,driver_discount_amt, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        concat(LEFT (mobile_phone, 3), '****', RIGHT (mobile_phone, 4))  mobile_phone 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        from pay_order p 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        left join sys_dept d on d.dept_id =p.station_id 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        join app_user_info a on a.user_id=p.consumer_id 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        <where> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            <if test="orderNo != null  and orderNo != ''"> and p.order_no = #{orderNo}</if> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            <if test="stationId != null "> and p.station_id = #{stationId}</if> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            <if test="status != null  and status != ''"> and p.status = #{status}</if> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            <if test="consumerId != null "> and p.consumer_id = #{consumerId}</if> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            <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 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> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            <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="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="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 like concat('%',#{customerPhone}, '%') </if> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            <if test="customerGrade != null  and customerGrade != ''"> and customer_grade like concat('%',#{customerGrade}, '%') </if> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            <if test="stationIdList != null "> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                and p.station_id in 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                <foreach item="item" index="index" collection="stationIdList" 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                         open="(" separator="," close=")"> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    #{item} 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                </foreach> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            </if> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            <if test="beginTime != null and beginTime != ''"><!-- 开始时间检索 --> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                AND date_format(p.created_date,'%y-%m-%d %H:%i:%s') >= date_format(#{beginTime},'%y-%m-%d %H:%i:%s') 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            </if> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            <if test="endTime != null and endTime != ''"><!-- 结束时间检索 --> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                AND date_format(p.created_date,'%y-%m-%d %H:%i:%s') <= date_format(#{endTime},'%y-%m-%d %H:%i:%s') 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            </if> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         </where> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         order by order_id desc 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     </select> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     <select id="selectPayOrderById" parameterType="Long" resultMap="PayOrderResult"> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        <include refid="selectPayOrderVo"/> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+       select order_id, order_no, p.station_id, p.station_name, p.status,consumer_id, consumer, oil_gun, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        oil_name, oil_pirce, oil_type, order_liters, amt, receivable_amt, received_amt, discount_amt,sell_oil_price,driver_oil_price, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        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,oil_personnel_id, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        pay_date, created_date, order_type, car_no,customer_grade,sell_amt,sell_discount_amt,d.mobile_phone as customer_phone 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        from pay_order p join app_user_info d on p.consumer_id =d.user_id 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         where order_id = #{orderId} 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     </select> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    <select id="selectDaySources" parameterType="Long" resultMap="PayOrderResult"> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        SELECT SUM(amt) as amt,sum(order_liters) as order_liters 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    <select id="selectDaySources" parameterType="PayOrder" resultMap="PayOrderResult"> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        SELECT SUM(amt) as amt,sum(order_liters) as order_liters,sum(sell_amt) as sell_amt,count(1) count_num 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         from pay_order 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         <where> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             <if test="stationId != null "> and station_id = #{stationId}</if> 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -198,7 +404,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         </where> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     </select> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     <select id="selectOilTypeSources" parameterType="Long" resultMap="PayOrderResult"> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        SELECT SUM(amt) as amt,sum(order_liters) as order_liters, oil_type 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        SELECT SUM(amt) as amt,sum(order_liters) as order_liters,sum(sell_amt) sell_amt, oil_type,count(1) count_num 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         from pay_order 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         <where> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             <if test="stationId != null "> and station_id = #{stationId}</if> 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -248,8 +454,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         GROUP BY oil_name 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     </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 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        SELECT SUM(wx_amt) as wx_amt,sum(zfb_amt) as zfb_amt, sum(dzk_amt) as dzk_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="stationId != null "> and station_id = #{stationId}</if> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             <if test="status != null "> and status = #{status}</if> 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -272,23 +478,45 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     </select> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     <!--日报数据--> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     <select id="selectDayReport" parameterType="Long" resultMap="PayOrderResult"> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        SELECT date_format( b.created_date, '%Y-%m-%d' ) as created_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,sum(receivable_amt) as receivable_amt,sum(received_amt) as received_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 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+         SELECT 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        b.created_date, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        sum( b.amt ) amt, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        sum( b.order_liters ) order_liters, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        sum( b.member_amt ) member_amt, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        sum( b.receivable_amt ) receivable_amt, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        sum( b.received_amt ) received_amt, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        MAX(CASE b.oil_type WHEN '1' THEN amt ELSE 0 END) AS qy_amt, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        MAX(CASE b.oil_type WHEN '2' THEN amt ELSE 0 END) AS cy_amt, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        sum(b.order_no) order_no 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        from ( 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        SELECT 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        date_format( a.created_date, '%Y-%m-%d' ) as created_date, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        sum( a.amt ) amt, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        sum( a.order_liters ) order_liters, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        sum( a.member_amt ) member_amt, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        sum( a.receivable_amt ) receivable_amt, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        sum( a.received_amt ) received_amt, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        a.oil_type, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        count( 1 ) order_no 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        FROM 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        pay_order a 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         <where> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            <if test="stationId != null "> and station_id = #{stationId}</if> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            <if test="status != null "> and status = #{status}</if> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            <if test="orderType != null  and orderType != ''"> and order_type = #{orderType}</if> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            <if test="stationId != null "> and a.station_id = #{stationId}</if> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            <if test="status != null "> and a.status = #{status}</if> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            <if test="orderType != null  and orderType != ''"> and a.order_type = #{orderType}</if> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             <if test="stationIdList != null "> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                and station_id in 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                and a.station_id in 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 <foreach item="item" index="index" collection="stationIdList" 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                          open="(" separator="," close=")"> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                     #{item} 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 </foreach> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             </if> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         </where> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        GROUP BY  date_format( created_date, '%Y-%m-%d' ) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        ORDER BY date_format( created_date, '%Y-%m-%d' ) DESC 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        GROUP BY 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        date_format( a.created_date, '%Y-%m-%d' ),a.oil_type 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        )  b 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        GROUP BY b.created_date 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        ORDER BY b.created_date desc 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     </select> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 <!-- 日报折线图油品数据--> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     <select id="listQydata" parameterType="Long" resultMap="PayOrderResult"> 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -406,7 +634,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             <where> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 <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="status != null  and status != ''"> and status = #{status}</if> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 <if test="orderType != null  and orderType != ''"> and order_type = #{orderType}</if> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             </where> 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -417,7 +644,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         <trim prefix="(" suffix=")" suffixOverrides=","> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             <if test="orderNo != null">order_no,</if> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             <if test="stationId != null">station_id,</if> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            <if test="stationName != null">station_name,</if> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             <if test="status != null">status,</if> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             <if test="consumerId != null">consumer_id,</if> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             <if test="consumer != null">consumer,</if> 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -457,7 +683,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         <trim prefix="values (" suffix=")" suffixOverrides=","> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             <if test="orderNo != null">#{orderNo},</if> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             <if test="stationId != null">#{stationId},</if> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            <if test="stationName != null">#{stationName},</if> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             <if test="status != null">#{status},</if> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             <if test="consumerId != null">#{consumerId},</if> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             <if test="consumer != null">#{consumer},</if> 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -501,7 +726,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         <trim prefix="SET" suffixOverrides=","> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             <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="status != null">status = #{status},</if> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             <if test="consumerId != null">consumer_id = #{consumerId},</if> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             <if test="consumer != null">consumer = #{consumer},</if> 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -546,10 +770,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     </delete> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     <delete id="deletePayOrderByIds" parameterType="String"> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        delete from pay_order where order_id in  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        delete from pay_order where order_id in 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         <foreach item="orderId" collection="array" open="(" separator="," close=")"> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             #{orderId} 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         </foreach> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     </delete> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-     
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-</mapper> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+</mapper> 
			 |