8 changed files with 341 additions and 7 deletions
@ -0,0 +1,122 @@ |
|||
<?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="com.kms.build.mapper.BsSgcJsjdBuiRealNameProMapper"> |
|||
|
|||
<resultMap id="BsSgcJsjdBuiRealName" type="BsSgcJsjdBuiRealNamePro"> |
|||
<id property="id" column="id"/> |
|||
<result property="projectName" column="project_name"/> |
|||
<result property="proCode" column="pro_code"/> |
|||
<result property="adcd" column="adcd"/> |
|||
<result property="proNo" column="pro_no"/> |
|||
</resultMap> |
|||
|
|||
<select id="getByUser" resultMap="BsSgcJsjdBuiRealName"> |
|||
select id,project_name,pro_code,adcd,pro_no from bs_sgc_jsjd_bui_real_name_pro np |
|||
<if test="userType==01"> |
|||
WHERE |
|||
np.PRO_NO IN ( |
|||
SELECT |
|||
PRO_NO |
|||
FROM |
|||
sys_user_pro |
|||
<where> |
|||
<if test="userId!=null and userId!=''"> |
|||
AND user_id=#{userId}) |
|||
</if> |
|||
<if test="projectName!=null and projectName!=''"> |
|||
and np.project_name like concat('%',#{projectName},'%') |
|||
</if> |
|||
<if test="proCode != null and proCode != ''"> |
|||
and np.PRO_CODE=#{proCode} |
|||
</if> |
|||
<if test="proNo != null and proNo != ''"> |
|||
and np.PRO_NO=#{proNo} |
|||
</if> |
|||
<if test="adcd!=null and adcd !=''"> |
|||
and np.adcd like concat(#{adcd},'%') |
|||
</if> |
|||
<if test="id!=null and id!=''"> |
|||
and id=#{id} |
|||
</if> |
|||
order by np.create_time desc LIMIT #{pageNum},#{pageSize}; |
|||
</where> |
|||
</if> |
|||
|
|||
<if test="userType==00"> |
|||
<where> |
|||
<if test="projectName!=null and projectName!=''"> |
|||
and np.project_name like concat('%',#{projectName},'%') |
|||
</if> |
|||
<if test="proCode != null and proCode != ''"> |
|||
and np.PRO_CODE=#{proCode} |
|||
</if> |
|||
<if test="proNo != null and proNo != ''"> |
|||
and np.PRO_NO=#{proNo} |
|||
</if> |
|||
<if test="adcd!=null and adcd !=''"> |
|||
and np.adcd like concat(#{adcd},'%') |
|||
</if> |
|||
<if test="id!=null and id!=''"> |
|||
and id=#{id} |
|||
</if> |
|||
</where> |
|||
order by np.create_time desc LIMIT #{pageNum},#{pageSize}; |
|||
</if> |
|||
</select> |
|||
|
|||
|
|||
<select id="getCount" resultMap="BsSgcJsjdBuiRealName"> |
|||
select id,project_name,pro_code,adcd,pro_no from bs_sgc_jsjd_bui_real_name_pro np |
|||
<if test="userType==01"> |
|||
WHERE |
|||
np.pro_no IN ( |
|||
SELECT |
|||
PRO_NO |
|||
FROM |
|||
sys_user_pro |
|||
<where> |
|||
<if test="userId!=null and userId!=''"> |
|||
AND user_id=#{userId}) |
|||
</if> |
|||
<if test="projectName!=null and projectName!=''"> |
|||
and np.project_name like concat('%',#{projectName},'%') |
|||
</if> |
|||
<if test="proCode != null and proCode != ''"> |
|||
and np.PRO_CODE=#{proCode} |
|||
</if> |
|||
<if test="proNo != null and proNo != ''"> |
|||
and np.PRO_NO=#{proNo} |
|||
</if> |
|||
<if test="adcd!=null and adcd !=''"> |
|||
and np.adcd like concat(#{adcd},'%') |
|||
</if> |
|||
<if test="id!=null and id!=''"> |
|||
and id=#{id} |
|||
</if> |
|||
</where> |
|||
</if> |
|||
|
|||
<if test="userType==00"> |
|||
<where> |
|||
<if test="projectName!=null and projectName!=''"> |
|||
and np.project_name like concat('%',#{projectName},'%') |
|||
</if> |
|||
<if test="proCode != null and proCode != ''"> |
|||
and np.PRO_CODE=#{proCode} |
|||
</if> |
|||
<if test="proNo != null and proNo != ''"> |
|||
and np.PRO_NO=#{proNo} |
|||
</if> |
|||
<if test="adcd!=null and adcd !=''"> |
|||
and np.adcd like concat(#{adcd},'%') |
|||
</if> |
|||
<if test="id!=null and id!=''"> |
|||
and id=#{id} |
|||
</if> |
|||
</where> |
|||
</if> |
|||
</select> |
|||
|
|||
</mapper> |
Loading…
Reference in new issue