数据库中的表:
需求
launchTypes是存得以逗号,分割的数据,前端给我传一个launchType,我要查询包含这个launchType的数据
sql
<select id="selectCityAdsRecord"
resultType="com.wanshun.carlifeservice.cardatamodel.po.adscity.CityAdsRecordDo">
SELECT *
FROM cityadsrecord
<where>
(find_in_set(#{cityCode}, cityCode) OR cityCode = "-1")
AND find_in_set(#{launchType},launchTypes )
AND checkedStatus = 1
AND expireTime > now()
</where>
</select>
学习博客: