This commit is contained in:
sxu 2023-12-06 17:16:39 +08:00
parent cc7044b9fa
commit 5a3d7df4e7
1 changed files with 4 additions and 1 deletions

View File

@ -56,7 +56,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="location != null and location != ''"> and d.location = #{location}</if>
<if test="brand != null and brand != ''"> and d.brand = #{brand}</if>
<if test="modelName != null and modelName != ''"> and d.model_name like concat('%', #{modelName}, '%')</if>
<if test="productionDate != null and productionDate != ''"> and d.production_date = #{productionDate}</if>
<if test="ageMin != null and ageMin != '' and ageMax != null and ageMax != ''">
and DATEDIFF(DATE_FORMAT(now(), '%Y-%m-%d'), d.production_date) &gt;= #{ageMin} * 365
and DATEDIFF(DATE_FORMAT(now(), '%Y-%m-%d'), d.production_date) &lt;= #{ageMax} * 365
</if>
<if test="workingHoursMin != null and workingHoursMin != '' and workingHoursMax != null and workingHoursMax != ''">
and d.working_hours &gt;= #{workingHoursMin} and d.working_hours &lt;= #{workingHoursMax}
</if>