sql语句查询之concat()及条件嵌套应用
程序员文章站
2024-03-02 18:39:04
...
<select id="selectFreezeList" resultMap="resultMap">
SELECT * FROM freeze_list WHERE status = '1'
<if test="cusName != null and cusName != '' and cusId = null and cusId ='' ">
and enterprise_name like CONCAT('%',#{cusName},'%')
</if>
<if test="cusId != null and cusId != ''">
and bill_code like CONCAT('%',#{cusId},'%')
</if>
ORDER BY create_time DESC
</select>
concat 拼接