Commit c8c6a156 by wushanyu

系统管理权限查询页面,地市县级管理员sql进行优化,将公共查询条件进行提取

parent def9f362
......@@ -38,14 +38,6 @@
<result column="TQYHBZ" property="tqyhbz" jdbcType="VARCHAR" />
</resultMap>
<!--地市县级管理员公共sql-->
<sql id="Base_Column_List" >
ID, UNITCODE, USERNAME, PASSWORD, TRUE_NAME, OPEN_FLAG, DEFAULT_MODEL, REMARK, LRR,
LRSJ, GXR, GXSJ, LRDWDM, LRDWMC, IDENTITYCARD, SEX, BIRTHDAY, TELEPHONE, UNITNAME,
SCBZ, IP, GRADE, POLICEMANID, DEFAULT_DESKTOP, THEME, LASTLOGINTIME, LASTCHECKTIME,
XXZYURL, GZZM_ZHY, GZZM_YPY, GZZM_ZCY, GZZM_PLAY, GLYBZ, TQYHBZ
</sql>
<!--查询地市级管理员-->
<!--其他省份-->
<select id="selectDsxjglyListByCondition" resultMap="BaseResultMap">
......@@ -60,16 +52,7 @@
from sys_role r join sys_user_role u on r.id=u.role_id where u.scbz='0' and r.scbz='0' GROUP BY u.user_id) tt
on t.id=tt.user_id
where scbz='0' and t.username != 'admin'
<if test="countycode !=null"> and REGEXP_LIKE (UNITCODE, '^'||#{countycode})</if>
<if test="trueName !=null"> and true_name like '%'||#{trueName}||'%'</if>
<if test="policemanid !=null"> and policemanid like '%'||#{policemanid}||'%'</if>
<if test="unitcode !=null"> and UNITCODE like '%'||#{unitcode}||'%'
<if test="unitcode == '61'">and rolename like '%省市县管理员%'</if>
<if test="unitcode != '61'">and rolename like '%地市管理员%'</if>
</if>
<if test="telephone !=null"> and telephone like '%'||#{telephone}||'%'</if>
<if test="grade !=null"> and grade = #{grade}</if>
<if test="grade ==null"> and grade = 'D'</if>
<include refid="query_condition_qtsf" />
) t where ROWNUM <![CDATA[<=]]>
${limit*page}
) where rn > ${(page-1)*limit}
......@@ -84,15 +67,7 @@
from sys_role r join sys_user_role u on r.id=u.role_id where u.scbz='0' and r.scbz='0' GROUP BY u.user_id) tt
on t.id=tt.user_id
where scbz='0' and t.username != 'admin'
<if test="trueName !=null"> and true_name like '%'||#{trueName}||'%'</if>
<if test="policemanid !=null"> and policemanid like '%'||#{policemanid}||'%'</if>
<if test="unitcode !=null"> and UNITCODE like '%'||#{unitcode}||'%'
<if test="unitcode == '61'">and rolename like '%省市县管理员%'</if>
<if test="unitcode != '61'">and rolename like '%地市管理员%'</if>
</if>
<if test="telephone !=null"> and telephone like '%'||#{telephone}||'%'</if>
<if test="grade !=null"> and grade = #{grade}</if>
<if test="grade ==null"> and grade = 'D'</if>
<include refid="query_condition_qtsf" />
</select>
<!--山西特殊情况-->
......@@ -108,12 +83,7 @@
from sys_role r join sys_user_role u on r.id=u.role_id where u.scbz='0' and r.scbz='0' GROUP BY u.user_id) tt
on t.id=tt.user_id
where scbz='0' and t.username != 'admin' and rolename like '%地市级管理员%'
<if test="trueName !=null"> and true_name like '%'||#{trueName}||'%'</if>
<if test="policemanid !=null"> and policemanid like '%'||#{policemanid}||'%'</if>
<if test="unitcode !=null"> and UNITCODE like '%'||#{unitcode}||'%'</if>
<if test="telephone !=null"> and telephone like '%'||#{telephone}||'%'</if>
<if test="grade !=null"> and grade = #{grade}</if>
<if test="grade ==null"> and grade = 'D'</if>
<include refid="query_condition_sx" />
) t where ROWNUM <![CDATA[<=]]>
${limit*page}
) where rn > ${(page-1)*limit}
......@@ -128,13 +98,41 @@
from sys_role r join sys_user_role u on r.id=u.role_id where u.scbz='0' and r.scbz='0' GROUP BY u.user_id) tt
on t.id=tt.user_id
where scbz='0' and t.username != 'admin' and rolename like '%地市级管理员%'
<include refid="query_condition_sx" />
</select>
<!--地市县级管理员公共Column-->
<sql id="Base_Column_List" >
ID, UNITCODE, USERNAME, PASSWORD, TRUE_NAME, OPEN_FLAG, DEFAULT_MODEL, REMARK, LRR,
LRSJ, GXR, GXSJ, LRDWDM, LRDWMC, IDENTITYCARD, SEX, BIRTHDAY, TELEPHONE, UNITNAME,
SCBZ, IP, GRADE, POLICEMANID, DEFAULT_DESKTOP, THEME, LASTLOGINTIME, LASTCHECKTIME,
XXZYURL, GZZM_ZHY, GZZM_YPY, GZZM_ZCY, GZZM_PLAY, GLYBZ, TQYHBZ
</sql>
<!--其他省份地市县级管理员查询条件-->
<sql id="query_condition_qtsf">
<if test="countycode !=null"> and REGEXP_LIKE (UNITCODE, '^'||#{countycode})</if>
<if test="trueName !=null"> and true_name like '%'||#{trueName}||'%'</if>
<if test="policemanid !=null"> and policemanid like '%'||#{policemanid}||'%'</if>
<if test="unitcode !=null"> and UNITCODE like '%'||#{unitcode}||'%'
<if test="unitcode == '61'">and rolename like '%省市县管理员%'</if>
<if test="unitcode != '61'">and rolename like '%地市管理员%'</if>
</if>
<if test="telephone !=null"> and telephone like '%'||#{telephone}||'%'</if>
<if test="grade !=null"> and grade = #{grade}</if>
<if test="grade ==null"> and grade = 'D'</if>
</sql>
<!--山西省地市县级管理员查询条件-->
<sql id="query_condition_sx">
<if test="countycode !=null"> and REGEXP_LIKE (UNITCODE, '^'||#{countycode})</if>
<if test="trueName !=null"> and true_name like '%'||#{trueName}||'%'</if>
<if test="policemanid !=null"> and policemanid like '%'||#{policemanid}||'%'</if>
<if test="unitcode !=null"> and UNITCODE like '%'||#{unitcode}||'%'</if>
<if test="telephone !=null"> and telephone like '%'||#{telephone}||'%'</if>
<if test="grade !=null"> and grade = #{grade}</if>
<if test="grade ==null"> and grade = 'D'</if>
</select>
</sql>
<!-- 专项案件省厅负责人审批-->
<select id="selectZxajstfzrUserByCondition" resultType="com.xzxtshiro.pojo.SysUser">
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment