|
|
@@ -156,15 +156,14 @@
|
|
|
select
|
|
|
<include refid="sell_col"/>
|
|
|
from kwp_ledger_trade klt
|
|
|
- inner join kwp_ledger_trade_unit kltu
|
|
|
- on klt.id = kltu.t_ledger_id and kltu.del_flag = 0 and
|
|
|
- kltu.unit_type = #{tradeReq.unitType,jdbcType=INTEGER}
|
|
|
- inner join kwp_ledger_trade_unit kltu2
|
|
|
- on klt.id = kltu2.t_ledger_id and kltu2.del_flag = 0 and kltu2.unit_type =
|
|
|
- #{tradeReq.unitTypeTwo,jdbcType=INTEGER}
|
|
|
+ inner join kwp_ledger_trade_unit kltu
|
|
|
+ on klt.id = kltu.t_ledger_id and kltu.del_flag = 0 and
|
|
|
+ kltu.unit_type = #{tradeReq.unitType,jdbcType=INTEGER}
|
|
|
+ inner join kwp_ledger_trade_unit kltu2
|
|
|
+ on klt.id = kltu2.t_ledger_id and kltu2.del_flag = 0 and kltu2.unit_type =
|
|
|
+ #{tradeReq.unitTypeTwo,jdbcType=INTEGER}
|
|
|
<where>
|
|
|
klt.del_flag = 0
|
|
|
- and kltu2.top_ent_id = #{tradeReq.entId,jdbcType=BIGINT}
|
|
|
<if test="tradeReq.status != null">
|
|
|
and klt.status = #{tradeReq.status}
|
|
|
</if>
|
|
|
@@ -173,20 +172,20 @@
|
|
|
</if>
|
|
|
<if test="tradeReq.endCreateTime != null and tradeReq.endCreateTime != '' and tradeReq.startCreateTime != null and tradeReq.startCreateTime != ''">
|
|
|
and klt.generate_time between #{tradeReq.startCreateTime,jdbcType=TIMESTAMP}
|
|
|
- and #{tradeReq.endCreateTime,jdbcType=TIMESTAMP}
|
|
|
+ and #{tradeReq.endCreateTime,jdbcType=TIMESTAMP}
|
|
|
</if>
|
|
|
<if test="tradeReq.keywords != null and tradeReq.keywords != ''">
|
|
|
and (
|
|
|
- klt.t_ledger_no like concat('%'
|
|
|
- , #{tradeReq.keywords,jdbcType=VARCHAR}
|
|
|
- , '%')
|
|
|
- or kltu.firm_name like concat('%'
|
|
|
- , #{tradeReq.keywords,jdbcType=VARCHAR}
|
|
|
- , '%')
|
|
|
- or kltu.contacts like concat('%'
|
|
|
- , #{tradeReq.keywords,jdbcType=VARCHAR}
|
|
|
- , '%')
|
|
|
- )
|
|
|
+ klt.t_ledger_no like concat('%'
|
|
|
+ , #{tradeReq.keywords,jdbcType=VARCHAR}
|
|
|
+ , '%')
|
|
|
+ or kltu.firm_name like concat('%'
|
|
|
+ , #{tradeReq.keywords,jdbcType=VARCHAR}
|
|
|
+ , '%')
|
|
|
+ or kltu.contacts like concat('%'
|
|
|
+ , #{tradeReq.keywords,jdbcType=VARCHAR}
|
|
|
+ , '%')
|
|
|
+ )
|
|
|
</if>
|
|
|
</where>
|
|
|
order by klt.generate_time desc
|