|
|
@@ -504,4 +504,73 @@
|
|
|
and kllu.top_ent_id = #{entId,jdbcType=BIGINT}
|
|
|
</where>
|
|
|
</select>
|
|
|
+
|
|
|
+ <select id="exportList" resultType="com.sckw.payment.model.dto.LedgerLogisticsDto">
|
|
|
+ select kll.id,
|
|
|
+ kll.l_ledger_no lLedgerNo,
|
|
|
+ kll.name,
|
|
|
+ kll.start_time startTime,
|
|
|
+ kll.end_time endTime,
|
|
|
+ kll.tax_rate taxRate,
|
|
|
+ kll.trading,
|
|
|
+ kll.total_price totalPrice,
|
|
|
+ kll.ex_tax_price exTaxPrice,
|
|
|
+ kll.settle_price settlePrice,
|
|
|
+ kll.actual_price actualPrice,
|
|
|
+ kll.success_phone successPhone,
|
|
|
+ kll.success_user successUser,
|
|
|
+ kll.url,
|
|
|
+ kll.generate_time generateTime,
|
|
|
+ kll.receipt_time receiptTime,
|
|
|
+ kll.remark,
|
|
|
+ kll.status,
|
|
|
+ kll.create_by createBy,
|
|
|
+ kllu.top_ent_id checkEntId,
|
|
|
+ (case
|
|
|
+ when #{logisticsReq.unitType,jdbcType=INTEGER} = 1 then kll.audit_user
|
|
|
+ else kll.success_user end) as contacts,
|
|
|
+ (case
|
|
|
+ when #{logisticsReq.unitType,jdbcType=INTEGER} = 1 then kll.audit_phone
|
|
|
+ else kll.success_phone end) as phone,
|
|
|
+ kllu.firm_name firmName,
|
|
|
+ kll.order_count orderCount
|
|
|
+ from kwp_ledger_logistics kll
|
|
|
+ inner join kwp_ledger_logistics_unit kllu
|
|
|
+ on kll.id = kllu.l_ledger_id and kllu.del_flag = 0 and
|
|
|
+ kllu.unit_type = #{logisticsReq.unitType,jdbcType=INTEGER}
|
|
|
+ inner join kwp_ledger_logistics_unit kllu2
|
|
|
+ on kll.id = kllu2.l_ledger_id and kllu2.del_flag = 0 and
|
|
|
+ kllu2.unit_type = #{logisticsReq.unitTypeTwo,jdbcType=INTEGER}
|
|
|
+ <where>
|
|
|
+ kll.del_flag = 0
|
|
|
+ <choose>
|
|
|
+ <when test="idList != null and idList.size() != 0">
|
|
|
+ and kll.id in
|
|
|
+ <foreach collection="idList" open="(" separator="," close=")" item="item">
|
|
|
+ #{item,jdbcType=BIGINT}
|
|
|
+ </foreach>
|
|
|
+ </when>
|
|
|
+ <otherwise>
|
|
|
+ and kllu2.top_ent_id = #{logisticsReq.entId,jdbcType=BIGINT}
|
|
|
+ <if test="logisticsReq.status != null">
|
|
|
+ and kll.status = #{logisticsReq.status}
|
|
|
+ </if>
|
|
|
+ <if test="logisticsReq.trading != null">
|
|
|
+ and kll.trading = #{logisticsReq.trading,jdbcType=INTEGER}
|
|
|
+ </if>
|
|
|
+ <if test="logisticsReq.startCreateTime != null and logisticsReq.startCreateTime != '' and logisticsReq.endCreateTime != null and logisticsReq.endCreateTime != ''">
|
|
|
+ and kll.generate_time between #{logisticsReq.startCreateTime,jdbcType=TIMESTAMP}
|
|
|
+ and #{logisticsReq.endCreateTime,jdbcType=TIMESTAMP}
|
|
|
+ </if>
|
|
|
+ <if test="logisticsReq.keywords != null and logisticsReq.keywords != ''">
|
|
|
+ and (
|
|
|
+ kll.l_ledger_no like concat('%', #{logisticsReq.keywords,jdbcType=VARCHAR}, '%')
|
|
|
+ or kllu.firm_name like concat('%', #{logisticsReq.keywords,jdbcType=VARCHAR}, '%')
|
|
|
+ or kllu.contacts like concat('%', #{logisticsReq.keywords,jdbcType=VARCHAR}, '%')
|
|
|
+ )
|
|
|
+ </if>
|
|
|
+ </otherwise>
|
|
|
+ </choose>
|
|
|
+ </where>
|
|
|
+ </select>
|
|
|
</mapper>
|