mybatis处理LIKE模糊查询字符串拼接

it2022-05-05  100

-- 最佳实践

<select id="getSealByMap" parameterType="map" resultType="map"> SELECT ls.`id`,ls.`in_date`,ls.`name`,ls.`seal_type`,ls.`crop_no`,sos.`SEAL_ORDER_ID` FROM lv_seal ls LEFT JOIN se_seal_order_seal sos ON ls.`id`=sos.`SEAL_ID` LEFT JOIN se_seal_order sso ON sso.`ID`=sos.`SEAL_ORDER_ID` WHERE ls.`is_deleted`='N' AND ls.`crop_no`=#{cropNo} AND ls.`name` LIKE CONCAT('%',#{sealName},'%') AND ls.`seal_type`=#{sealType} ORDER BY ls.`in_date` </select>

转载于:https://www.cnblogs.com/sung1024/p/11178628.html


最新回复(0)