查询车辆改成or
This commit is contained in:
@ -28,11 +28,20 @@
|
|||||||
zc_rent_car_rule r ON mp.car_rule_id = r.id AND r.del_flag = '0' AND r.status = '0'
|
zc_rent_car_rule r ON mp.car_rule_id = r.id AND r.del_flag = '0' AND r.status = '0'
|
||||||
<where>
|
<where>
|
||||||
s.id = #{storeCarModelReq.storeId}
|
s.id = #{storeCarModelReq.storeId}
|
||||||
<if test="storeCarModelReq.depositFree != null and storeCarModelReq.depositFree != ''">
|
<if test="(storeCarModelReq.depositFree != null and storeCarModelReq.depositFree != '') or (storeCarModelReq.autoDeduct != null and storeCarModelReq.autoDeduct != '')">
|
||||||
AND r.deposit_free = #{storeCarModelReq.depositFree}
|
AND (
|
||||||
</if>
|
<choose>
|
||||||
<if test="storeCarModelReq.autoDeduct != null and storeCarModelReq.autoDeduct != ''">
|
<when test="storeCarModelReq.depositFree != null and storeCarModelReq.depositFree != '' and storeCarModelReq.autoDeduct != null and storeCarModelReq.autoDeduct != ''">
|
||||||
AND r.auto_deduct = #{storeCarModelReq.autoDeduct}
|
r.deposit_free = #{storeCarModelReq.depositFree} OR r.auto_deduct = #{storeCarModelReq.autoDeduct}
|
||||||
|
</when>
|
||||||
|
<when test="storeCarModelReq.depositFree != null and storeCarModelReq.depositFree != ''">
|
||||||
|
r.deposit_free = #{storeCarModelReq.depositFree}
|
||||||
|
</when>
|
||||||
|
<otherwise>
|
||||||
|
r.auto_deduct = #{storeCarModelReq.autoDeduct}
|
||||||
|
</otherwise>
|
||||||
|
</choose>
|
||||||
|
)
|
||||||
</if>
|
</if>
|
||||||
AND cm.del_flag = '0' AND cm.status = '0'
|
AND cm.del_flag = '0' AND cm.status = '0'
|
||||||
</where>
|
</where>
|
||||||
|
|||||||
Reference in New Issue
Block a user