<?xml version="1.0" encoding="UTF-8" ?>
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
|
<mapper namespace="cn.gistack.sm.materials.mapper.RescueTeamManageMapper">
|
<!--namespace根据自己需要创建的的mapper的路径和名称填写-->
|
<select id="selectMyPage" resultType="cn.gistack.sm.materials.vo.RescueTeamManageVO">
|
SELECT RM.*,
|
aab1."ad_name" cityName,
|
aab2."ad_name" countyName,
|
aab3."ad_name" townName
|
FROM SM_RESCUETEAM_MANAGE RM
|
LEFT JOIN SJZT_MD."att_ad_base" aab1 ON aab1."guid" = RM.city
|
LEFT JOIN SJZT_MD."att_ad_base" aab2 ON aab2."guid" = RM.county
|
LEFT JOIN SJZT_MD."att_ad_base" aab3 ON aab3."guid" = RM.town
|
WHERE RM.IS_DELETED = 0
|
<if test="vo.resName !=null and vo.resName !=''">
|
AND RM.RES_NAME LIKE CONCAT('%',#{vo.resName},'%')
|
</if>
|
<if test="vo.userName !=null and vo.userName !=''">
|
AND RM.USER_NAME LIKE CONCAT('%',#{vo.userName},'%')
|
</if>
|
<if test="vo.userPhone !=null and vo.userPhone !=''">
|
AND RM.USER_PHONE LIKE CONCAT('%',#{vo.userPhone},'%')
|
</if>
|
<if test="vo.city !=null and vo.city !=''">
|
AND RM.city = #{vo.city}
|
</if>
|
<if test="vo.county !=null and vo.county !=''">
|
AND RM.county = #{vo.county}
|
</if>
|
<if test="vo.town !=null and vo.town !=''">
|
AND RM.town = #{vo.town}
|
</if>
|
<if test="vo.resGuid !=null and vo.resGuid !=''">
|
AND RM.res_guid = #{vo.resGuid}
|
</if>
|
<if test="vo.year!=null and vo.year!=''">
|
and date_format(RM.create_time,'%Y') = #{vo.year}
|
</if>
|
</select>
|
</mapper>
|