|
@@ -2,68 +2,64 @@
|
|
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
|
|
<mapper namespace="com.sqx.modules.reconciliation.mapper.PlatformBillMapper">
|
|
<mapper namespace="com.sqx.modules.reconciliation.mapper.PlatformBillMapper">
|
|
|
|
|
|
|
|
- <select id="selectCashOutList" resultType="com.sqx.modules.pay.vo.CashOutVO">
|
|
|
|
|
- select gh.shop_name, co.*,rs.station_name as stationName,tu.user_name as userName, gh.mch_id as mchId, tu.phone as phoneNumber
|
|
|
|
|
- from cash_out co
|
|
|
|
|
- left join goods_shop gh on gh.shop_id = co.shop_id
|
|
|
|
|
- left join tb_user tu on tu.user_id=co.user_id
|
|
|
|
|
- left join rider_station rs on tu.rider_station_id=rs.id
|
|
|
|
|
|
|
+ <select id="riderBill" resultType="com.sqx.modules.reconciliation.model.RiderBillVo">
|
|
|
|
|
+ select pb.*,tu.user_name as userName,tu.phone ,rs.station_name as stationName
|
|
|
|
|
+ from platform_bill pb left join tb_user tu on pb.user_id =tu.user_id
|
|
|
|
|
+ left join rider_station rs on rs.id =tu.rider_station_id
|
|
|
<where>
|
|
<where>
|
|
|
- <if test="params.zhifubaoName != null and params.zhifubaoName != '' and params.zhifubaoName != 'null'">
|
|
|
|
|
- and co.zhifubao_name = #{params.zhifubaoName}
|
|
|
|
|
|
|
+ pb.`type` =2
|
|
|
|
|
+ <if test="params.startDate != null and params.startDate != '' and params.startDate != 'null'">
|
|
|
|
|
+ and pb.day_id >= #{params.startDate}
|
|
|
</if>
|
|
</if>
|
|
|
- <if test="params.zhifubao != null and params.zhifubao != '' and params.zhifubao != 'null'">
|
|
|
|
|
- and co.zhifubao = #{params.zhifubao}
|
|
|
|
|
|
|
+ <if test="params.endDate != null and params.endDate != '' and params.endDate != 'null'">
|
|
|
|
|
+ and pb.day_id <![CDATA[ <= ]]> #{params.endDate}
|
|
|
</if>
|
|
</if>
|
|
|
- <if test="params.userId != null">
|
|
|
|
|
- and co.user_id = #{params.userId}
|
|
|
|
|
|
|
+ <if test="params.riderStation != null and params.riderStation != ''">
|
|
|
|
|
+ and rs.id = #{params.riderStation}
|
|
|
</if>
|
|
</if>
|
|
|
- <if test="params.type != null and params.type != '' and params.type != 'null'">
|
|
|
|
|
- and co.type = #{params.type}
|
|
|
|
|
|
|
+ <if test="params.riderPhone != null and params.riderPhone != '' and params.riderPhone != 'null'">
|
|
|
|
|
+ and tu.phone like concat('%',#{params.riderPhone},'%')
|
|
|
</if>
|
|
</if>
|
|
|
- <if test="params.state != null">
|
|
|
|
|
- and co.state = #{params.state}
|
|
|
|
|
|
|
+ <if test="params.riderName != null and params.riderName != '' and params.riderName != 'null'">
|
|
|
|
|
+ and tu.user_name like concat('%',#{params.riderName},'%')
|
|
|
</if>
|
|
</if>
|
|
|
- <if test="params.phone != null and params.phone != '' and params.phone != 'null'">
|
|
|
|
|
- and tu.phone like concat('%',#{params.phone},'%')
|
|
|
|
|
- </if>
|
|
|
|
|
- <if test="params.userName != null and params.userName != '' and params.userName != 'null'">
|
|
|
|
|
- and tu.user_name like concat('%',#{params.userName},'%')
|
|
|
|
|
- </if>
|
|
|
|
|
- <if test="params.classify == 1 || params.classify == 5 || params.classify == 6">
|
|
|
|
|
- and co.classify = #{params.classify}
|
|
|
|
|
- </if>
|
|
|
|
|
- <if test="params.classify == 2">
|
|
|
|
|
- and co.classify in (2, 3, 4)
|
|
|
|
|
- </if>
|
|
|
|
|
- <if test="params.startTime != null and params.startTime != '' and params.startTime != 'null'">
|
|
|
|
|
- and co.create_at <![CDATA[ >= ]]> #{params.startTime}
|
|
|
|
|
- </if>
|
|
|
|
|
- <if test="params.endTime != null and params.endTime != '' and params.endTime != 'null'">
|
|
|
|
|
- and co.create_at <![CDATA[ <= ]]> #{params.endTime}
|
|
|
|
|
|
|
+ </where>
|
|
|
|
|
+ order by pb.bill_id desc
|
|
|
|
|
+ </select>
|
|
|
|
|
+
|
|
|
|
|
+ <select id="shopBill" resultType="com.sqx.modules.reconciliation.model.ShopBillVo">
|
|
|
|
|
+ select pb.*,gs.shop_name as shopName,gs.phone
|
|
|
|
|
+ from platform_bill pb left join tb_user tu on pb.user_id =tu.user_id
|
|
|
|
|
+ left join goods_shop gs on gs.user_id =tu.user_id
|
|
|
|
|
+ <where>
|
|
|
|
|
+ pb.`type` = 1
|
|
|
|
|
+ <if test="params.startDate != null and params.startDate != '' and params.startDate != 'null'">
|
|
|
|
|
+ and pb.day_id >= #{params.startDate}
|
|
|
</if>
|
|
</if>
|
|
|
- <if test="params.outStartTime != null and params.outStartTime != '' and params.outStartTime != 'null'">
|
|
|
|
|
- and co.out_at <![CDATA[ >= ]]> #{params.outStartTime}
|
|
|
|
|
|
|
+ <if test="params.endDate != null and params.endDate != '' and params.endDate != 'null'">
|
|
|
|
|
+ and pb.day_id <![CDATA[ <= ]]> #{params.endDate}
|
|
|
</if>
|
|
</if>
|
|
|
- <if test="params.outEndTime != null and params.outEndTime != '' and params.outEndTime != 'null'">
|
|
|
|
|
- and co.out_at <![CDATA[ <= ]]> #{params.outEndTime}
|
|
|
|
|
|
|
+ <if test="params.shopPhone != null and params.shopPhone != '' and params.shopPhone != 'null'">
|
|
|
|
|
+ and gs.phone like concat('%',#{params.shopPhone},'%')
|
|
|
</if>
|
|
</if>
|
|
|
<if test="params.shopName != null and params.shopName != '' and params.shopName != 'null'">
|
|
<if test="params.shopName != null and params.shopName != '' and params.shopName != 'null'">
|
|
|
- and gh.shop_name like concat('%',#{params.shopName},'%')
|
|
|
|
|
- </if>
|
|
|
|
|
- <if test="params.bankCardNo != null and params.bankCardNo != '' and params.bankCardNo != 'null'">
|
|
|
|
|
- and co.bank_card_no = #{params.bankCardNo}
|
|
|
|
|
- </if>
|
|
|
|
|
- <if test="params.bankRealName != null and params.bankRealName != '' and params.bankRealName != 'null'">
|
|
|
|
|
- and co.bank_real_name = #{params.bankRealName}
|
|
|
|
|
|
|
+ and gs.shop_name like concat('%',#{params.shopName},'%')
|
|
|
</if>
|
|
</if>
|
|
|
- <if test="params.openBank != null and params.openBank != '' and params.openBank != 'null'">
|
|
|
|
|
- and co.open_bank = #{params.openBank}
|
|
|
|
|
|
|
+ </where>
|
|
|
|
|
+ order by pb.bill_id desc
|
|
|
|
|
+ </select>
|
|
|
|
|
+ <select id="platformBill" resultType="com.sqx.modules.reconciliation.model.PlatformBill">
|
|
|
|
|
+ select pb.*
|
|
|
|
|
+ from platform_bill pb
|
|
|
|
|
+ <where>
|
|
|
|
|
+ pb.`type` = 0
|
|
|
|
|
+ <if test="params.startDate != null and params.startDate != '' and params.startDate != 'null'">
|
|
|
|
|
+ and pb.day_id >= #{params.startDate}
|
|
|
</if>
|
|
</if>
|
|
|
- <if test="params.riderStationId != null and params.riderStationId != '' ">
|
|
|
|
|
- and tu.rider_station_id = #{params.riderStationId}
|
|
|
|
|
|
|
+ <if test="params.endDate != null and params.endDate != '' and params.endDate != 'null'">
|
|
|
|
|
+ and pb.day_id <![CDATA[ <= ]]> #{params.endDate}
|
|
|
</if>
|
|
</if>
|
|
|
</where>
|
|
</where>
|
|
|
- order by id desc
|
|
|
|
|
|
|
+ order by pb.bill_id desc
|
|
|
</select>
|
|
</select>
|
|
|
</mapper>
|
|
</mapper>
|