查询条件
查询值在List中的数据
<if test="factoryList != null and factoryList.size != 0">
and factory_code in
<foreach collection="factoryList" item="factoryCode" open="(" separator="," close=")">
</foreach>
</if>
<if test="vehicleModelCode != null and vehicleModelCode != ''">
and FIND_IN_SET(
</if>
<if test="isColor != null and isColor != ''">
and is_color in
<foreach item="item" collection="isColor.split(',')" open="(" separator="," close=")">
</foreach>
</if>
<if test="factoryType != null and factoryType !=''">
and ( instr(
<if test="factoryType.contains('0'.toString())">
or bd_factory_type is null
</if>)
</if>
涉及更新时间/操作时间的查询
<if test="isLatest != null and isLatest ">
and update_time > CONCAT(DATE(NOW()), ' 00:00:00')
</if>
<if test="operateTimeStart != null and operateTimeEnd != null">
and IFNULL(update_time, create_time) between
</if>
<if test="startTime != null and startTime != ''">
and date_format(create_time,'%Y-%m-%d') >= date_format(
</if>
<if test="endTime != null and endTime != ''">
and date_format(create_time,'%Y-%m-%d') <= date_format(
</if>
模糊查询
<if test="createBy != null and createBy != ''">
and create_by like concat('%',
</if>
<if test="createBy != null and createBy != ''">
<bind name="createByLike" value="'%' + createBy + '%'"/>
and create_by like
</if>