|
@@ -47,6 +47,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<result property="wxNum" column="wx_num" />
|
|
|
<result property="zfbNum" column="zfb_num" />
|
|
|
<result property="xjNum" column="xj_num" />
|
|
|
+ <result property="qyAmt" column="qy_amt" />
|
|
|
+ <result property="cyAmt" column="cy_amt" />
|
|
|
</resultMap>
|
|
|
|
|
|
|
|
@@ -104,6 +106,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<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>
|
|
@@ -206,15 +209,15 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
</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
|
|
|
+ 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
|
|
|
<where>
|
|
|
<if test="stationId != null "> and station_id = #{stationId}</if>
|
|
|
<if test="status != null "> and status = #{status}</if>
|
|
|
</where>
|
|
|
- GROUP BY date_format( pay_date, '%Y-%m-%d' )
|
|
|
- ORDER BY date_format( pay_date, '%Y-%m-%d' ) DESC
|
|
|
+ GROUP BY date_format( created_date, '%Y-%m-%d' )
|
|
|
+ ORDER BY date_format( created_date, '%Y-%m-%d' ) DESC
|
|
|
</select>
|
|
|
<!-- 日报折线图油品数据-->
|
|
|
<select id="listQydata" parameterType="Long" resultMap="PayOrderResult">
|
|
@@ -222,6 +225,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
from pay_order
|
|
|
<where>
|
|
|
<if test="stationId != null "> and station_id = #{stationId}</if>
|
|
|
+ <if test="status != null and status != ''"> and status = #{status}</if>
|
|
|
<if test="oilName != null "> and oil_name = #{oilName}</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')
|
|
@@ -238,6 +242,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
from pay_order
|
|
|
<where>
|
|
|
<if test="stationId != null "> and station_id = #{stationId}</if>
|
|
|
+ <if test="status != null and status != ''"> and status = #{status}</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>
|