<?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.*,
|
arb."res_reg_code" as resRegCode,arb."eng_scal" as engScal,
|
case when b."ad_grad" = 4 THEN b."ad_name" ELSE NULL
|
END AS townName,
|
case when b."ad_grad" = 3 THEN b."ad_name"
|
when c."ad_grad" = 3 THEN c."ad_name"
|
END AS countyName,
|
case when b."ad_grad" = 2 THEN b."ad_name"
|
when c."ad_grad" = 2 THEN c."ad_name"
|
ELSE d."ad_name" END AS cityName
|
FROM SM_RESCUETEAM_MANAGE RM
|
LEFT JOIN SJZT_MD."att_res_base" arb ON RM.res_guid = arb."guid"
|
LEFT JOIN SJZT_MD."att_ad_base" b ON arb."interior_ad_guid" = b."guid"
|
LEFT JOIN SJZT_MD."att_ad_base" c ON b."p_ad_code" = c."guid"
|
LEFT JOIN SJZT_MD."att_ad_base" d ON c."p_ad_code" = d."guid"
|
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>
|