输入条件支持模糊查询

This commit is contained in:
19173159168
2025-09-09 23:51:42 +08:00
parent 759f824cf8
commit 07d2eb3efd
15 changed files with 31 additions and 32 deletions

View File

@ -27,12 +27,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<include refid="selectZcOrderCarChangeVo"/>
<where>
<if test="orderId != null "> and order_id = #{orderId}</if>
<if test="orderNo != null and orderNo != ''"> and order_no = #{orderNo}</if>
<if test="orderSubNo != null and orderSubNo != ''"> and order_sub_no = #{orderSubNo}</if>
<if test="orderNo != null and orderNo != ''"> and order_no like concat('%', #{orderNo}, '%')</if>
<if test="orderSubNo != null and orderSubNo != ''"> and order_sub_no like concat('%', #{orderSubNo}, '%')</if>
<if test="oldVehicleId != null "> and old_vehicle_id = #{oldVehicleId}</if>
<if test="oldVehicleVin != null and oldVehicleVin != ''"> and old_vehicle_vin = #{oldVehicleVin}</if>
<if test="oldVehicleVin != null and oldVehicleVin != ''"> and old_vehicle_vin like concat('%', #{oldVehicleVin}, '%')</if>
<if test="newVehicleId != null "> and new_vehicle_id = #{newVehicleId}</if>
<if test="newVehicleVin != null and newVehicleVin != ''"> and new_vehicle_vin = #{newVehicleVin}</if>
<if test="newVehicleVin != null and newVehicleVin != ''"> and new_vehicle_vin like concat('%', #{newVehicleVin}, '%')</if>
<if test="operatorId != null "> and operator_id = #{operatorId}</if>
</where>
</select>

View File

@ -85,7 +85,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<include refid="selectZcOrderDistribVo"/>
<where>
<if test="orderId != null "> and a.order_id = #{orderId}</if>
<if test="orderNo != null and orderNo != ''"> and a.order_no = #{orderNo}</if>
<if test="orderNo != null and orderNo != ''"> and a.order_no like concat('%', #{orderNo}, '%')</if>
<if test="companyId != null "> and a.company_id = #{companyId}</if>
<if test="referralUserId != null "> and a.referral_user_id = #{referralUserId}</if>
<if test="distribType != null and distribType != ''"> and a.distrib_type = #{distribType}</if>
@ -98,8 +98,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
and date_format(b.first_order_time,'%y%m%d') &lt;= date_format(#{params.endFirstOrderTime},'%y%m%d')
</if>
<if test="zcOrderMain != null and zcOrderMain.storeName != null and zcOrderMain.storeName != '' "> and s.name = #{zcOrderMain.storeName}</if>
<if test="zcOrderMain != null and zcOrderMain.licensePlate != null and zcOrderMain.licensePlate != '' "> and zc.license_plate = #{zcOrderMain.licensePlate}</if>
<if test="zcOrderMain != null and zcOrderMain.storeName != null and zcOrderMain.storeName != '' "> and s.name like concat('%', #{zcOrderMain.storeName}, '%') </if>
<if test="zcOrderMain != null and zcOrderMain.licensePlate != null and zcOrderMain.licensePlate != '' "> and zc.license_plate like concat('%', #{zcOrderMain.licensePlate}, '%')</if>
</where>
order by b.first_order_time desc
</select>

View File

@ -99,14 +99,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
left join zc_company_store s on s.id = a.store_id
left join zc_car zc on zc.id = a.vehicle_id
<where>
<if test="orderNo != null and orderNo != ''"> and a.order_no = #{orderNo}</if>
<if test="orderNo != null and orderNo != ''"> and a.order_no like concat('%', #{orderNo}, '%')</if>
<if test="orderStatus != null and orderStatus != ''"> and a.order_status = #{orderStatus}</if>
<if test="operatorId != null "> and a.operator_id = #{operatorId}</if>
<if test="storeId != null "> and a.store_id = #{storeId}</if>
<if test="vehicleId != null "> and a.vehicle_id = #{vehicleId}</if>
<if test="customerId != null "> and a.customer_id = #{customerId}</if>
<if test="customerName != null and customerName != ''"> and a.customer_name like concat('%', #{customerName}, '%')</if>
<if test="customerPhone != null and customerPhone != ''"> and a.customer_phone = #{customerPhone}</if>
<if test="customerPhone != null and customerPhone != ''"> and a.customer_phone like concat('%', #{customerPhone}, '%')</if>
<if test="rentalType != null and rentalType != ''"> and a.rental_type = #{rentalType}</if>
<if test="rentalDays != null "> and a.rental_days = #{rentalDays}</if>
<if test="rentalPrice != null "> and a.rental_price = #{rentalPrice}</if>
@ -121,8 +121,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="rentCarRuleId != null "> and a.rent_car_rule_id = #{rentCarRuleId}</if>
<if test="rentBatteyRuleId != null "> and a.rent_battey_rule_id = #{rentBatteyRuleId}</if>
<if test="storeName != null and storeName!= '' "> and s.name = #{storeName}</if>
<if test="licensePlate != null and licensePlate!= '' "> and zc.license_plate = #{licensePlate}</if>
<if test="storeName != null and storeName!= '' "> and s.name like concat('%', #{storeName}, '%')</if>
<if test="licensePlate != null and licensePlate!= '' "> and zc.license_plate like concat('%', #{licensePlate}, '%')</if>
<if test="params.beginFirstOrderTime != null and params.beginFirstOrderTime != ''"><!-- 开始时间检索 -->
and date_format(a.first_order_time,'%y%m%d') &gt;= date_format(#{params.beginFirstOrderTime},'%y%m%d')
</if>

View File

@ -31,11 +31,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<include refid="selectZcOrderSubVo"/>
<where>
<if test="orderId != null "> and order_id = #{orderId}</if>
<if test="suborderNo != null and suborderNo != ''"> and suborder_no = #{suborderNo}</if>
<if test="suborderNo != null and suborderNo != ''"> and suborder_no like concat('%', #{suborderNo}, '%')</if>
<if test="suborderType != null and suborderType != ''"> and suborder_type = #{suborderType}</if>
<if test="amount != null "> and amount = #{amount}</if>
<if test="paymentMethod != null and paymentMethod != ''"> and payment_method = #{paymentMethod}</if>
<if test="vinBatteryNo != null and vinBatteryNo != ''"> and vin_battery_no = #{vinBatteryNo}</if>
<if test="vinBatteryNo != null and vinBatteryNo != ''"> and vin_battery_no like concat('%', #{vinBatteryNo}, '%')</if>
<if test="createdAt != null "> and created_at = #{createdAt}</if>
<if test="paymentId != null and paymentId != ''"> and payment_id = #{paymentId}</if>
<if test="paidAt != null "> and paid_at = #{paidAt}</if>