标签:查询 and sel names country creat 文件 app ltm
<mapper namespace="com.edc.dao.organize.OrganizeInfoMapper" > //对应相应的mapper.java文件
<select id="findBySearch" resultMap="BaseResultMap" parameterType="java.util.Map" >
SELECT i.* FROM t_organize_info i,t_location_city ci,t_location_country co,t_location_province p
WHERE i.provinceId=p.provinceId AND i.countryId=co.countryId AND i.cityId=ci.cityId
<if test="region!=null and region!=‘‘">
and (co.countryName LIKE CONCAT(CONCAT(‘%‘, #{region}),‘%‘)
or p.provinceName LIKE CONCAT(CONCAT(‘%‘, #{region}),‘%‘)
or ci.cityName LIKE CONCAT(CONCAT(‘%‘, #{region}),‘%‘))
</if>
<if test="organizename!=null and organizename!=‘‘">
and i.organizename LIKE CONCAT(CONCAT(‘%‘, #{organizename}),‘%‘)
</if>
<if test="type!=null and type!=‘‘">
AND i.type LIKE CONCAT(CONCAT(‘%‘, #{type}),‘%‘)
</if>
and i.del=0 order by i.createtime desc
</select>
标签:查询 and sel names country creat 文件 app ltm
原文地址:http://www.cnblogs.com/1234cjq/p/6859933.html