|
@@ -106,24 +106,23 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
</select>
|
|
|
|
|
|
<select id="listPersonnelStructure" parameterType="StationClassStructure" resultMap="StationClassStructureResult">
|
|
|
- SELECT a.oil_personnel,GROUP_CONCAT(DISTINCT b.gun_no) as oil_gun,ROUND(SUM(a.amt),2) as amt,ROUND(SUM(order_liters),2) as order_liters,COUNT(order_no) as order_no
|
|
|
- from station_class_structure a JOIN station_personnel b on a.oil_personnel =b.personnel_name
|
|
|
- and a.station_id = b.station_id
|
|
|
+ SELECT a.oil_personnel,GROUP_CONCAT(DISTINCT a.oil_gun) as oil_gun,ROUND(SUM(a.amt),2) as amt,ROUND(SUM(order_liters),2) as order_liters,COUNT(order_no) as order_no
|
|
|
+ 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>
|
|
|
</where>
|
|
|
- GROUP BY a.oil_personnel,b.gun_no
|
|
|
+ GROUP BY a.oil_personnel
|
|
|
</select>
|
|
|
|
|
|
<select id="listOilStructure" parameterType="StationClassStructure" resultMap="StationClassStructureResult">
|
|
|
- SELECT a.oil_name,GROUP_CONCAT(DISTINCT oil_gun) as oil_gun,ROUND(SUM(a.amt),2) as amt,ROUND(SUM(order_liters),2) as order_liters,COUNT(order_no) as order_no
|
|
|
+ SELECT a.station_id, a.oil_name,GROUP_CONCAT(DISTINCT oil_gun) as oil_gun,ROUND(SUM(a.amt),2) as amt,ROUND(SUM(a.receivable_amt),2) as receivable_amt,ROUND(SUM(order_liters),2) as order_liters,COUNT(order_no) as order_no,a.class_start_date,a.class_structure_date,a.class_structure_man
|
|
|
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>
|
|
|
</where>
|
|
|
- GROUP BY a.oil_name
|
|
|
+ GROUP BY a.oil_name,a.station_id,a.class_start_date,a.class_structure_date,a.class_structure_man
|
|
|
</select>
|
|
|
<select id="selectStationClassStructureMax" parameterType="StationClassStructure" resultMap="StationClassStructureResult">
|
|
|
select id, station_id, order_no, oil_gun, oil_name, consumer_id, consumer, amt, station_name, order_liters, pay_type, pay_way, pay_date, oil_personnel, order_type, oil_type, print_num, class_structure_no, class_structure_date, class_structure_man, oils
|