-- 最佳實踐
<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>