SELECT mac FROM t_sys_device WHERE valid_time='9999-12-31' and type=0 and collect_code in #{item} and find_in_set(#{collectCode},tl.label_code) or
批量插入
insert into t_person_code(name,id_type, id_no, house_region,house_address,key_person)
values
(
#{item.name},#{item.idType}, #{item.idNo}, #{item.houseRegion},#{item.houseAddress},#{item.keyPerson}
)
一个字段如果是 1/2 或是1,2 sql判断方法 sbgnlx字段名
find_in_set(#{sbgnlx}, replace(sbgnlx, ‘/’, ‘,’))
<if test="deviceMapInfo.sbgnlx != null and deviceMapInfo.sbgnlx != ''">
and find_in_set(#{deviceMapInfo.sbgnlx}, replace(ti.sbgnlx, '/', ','))
</if>
假如数据库的字段数据是1,2这样的类型 想查询数值1或是2的应该这样查
select * from ipbd_resource where FIND_IN_SET(2,catalog_id)
批量修改
update student
studentNo = #{item.studentNo},
studentName = #{item.studentName},
studentAge = #{item.studentAge}
where id =#{item.id}