|
@@ -4,78 +4,68 @@
|
|
|
|
|
|
|
|
<select id="searchList" resultType="com.gz.rvo.archive.ArchiveRVO"
|
|
<select id="searchList" resultType="com.gz.rvo.archive.ArchiveRVO"
|
|
|
parameterType="com.gz.vo.archive.SearchArchiveVO">
|
|
parameterType="com.gz.vo.archive.SearchArchiveVO">
|
|
|
- SELECT
|
|
|
|
|
- d.dict_name mj_text,
|
|
|
|
|
- a.*
|
|
|
|
|
- FROM `tab_archives` a
|
|
|
|
|
- LEFT JOIN tab_dict d
|
|
|
|
|
- ON a.mj = d.dict_code
|
|
|
|
|
- LEFT JOIN tab_secondary_archive sa
|
|
|
|
|
- ON a.id = sa.archive_id
|
|
|
|
|
|
|
+ SELECT d.dict_name mj_text, a.*
|
|
|
|
|
+ FROM tab_archives a
|
|
|
|
|
+ LEFT JOIN tab_dict d ON a.mj = d.dict_code
|
|
|
|
|
+ LEFT JOIN tab_secondary_archive sa ON a.id = sa.archive_id
|
|
|
LEFT JOIN tab_admin u on u.id = a.created
|
|
LEFT JOIN tab_admin u on u.id = a.created
|
|
|
- <where>
|
|
|
|
|
- a.deleted = 0
|
|
|
|
|
- and ml IN (
|
|
|
|
|
- SELECT
|
|
|
|
|
- `code`
|
|
|
|
|
- FROM
|
|
|
|
|
- tab_archives_tree atr
|
|
|
|
|
- LEFT JOIN tab_menu_role tmr ON atr.id = tmr.menu_id
|
|
|
|
|
- WHERE
|
|
|
|
|
- tmr.role_id = #{roleId}
|
|
|
|
|
- AND tmr.role_type = 1
|
|
|
|
|
- )
|
|
|
|
|
- and mj in (select d.dict_code from tab_dict d left join tab_menu_role mr on d.id = mr.menu_id where
|
|
|
|
|
- mr.role_id = #{roleId} and mr.role_type = 2 )
|
|
|
|
|
-
|
|
|
|
|
- <if test="deptId!=null and deptId!=''">
|
|
|
|
|
|
|
+ where a.deleted = 0
|
|
|
|
|
+ and ml IN (
|
|
|
|
|
+ SELECT `code` FROM tab_archives_tree atr
|
|
|
|
|
+ LEFT JOIN tab_menu_role tmr ON atr.id = tmr.menu_id WHERE tmr.role_id = #{roleId} AND tmr.role_type = 1
|
|
|
|
|
+ )
|
|
|
|
|
+ and mj in (
|
|
|
|
|
+ select d.dict_code from tab_dict d left join tab_menu_role mr on d.id = mr.menu_id
|
|
|
|
|
+ where mr.role_id = #{roleId} and mr.role_type = 2
|
|
|
|
|
+ )
|
|
|
|
|
+ <if test="deptId!=null and deptId!=''">
|
|
|
and u.dept_id = #{deptId}
|
|
and u.dept_id = #{deptId}
|
|
|
- </if>
|
|
|
|
|
-
|
|
|
|
|
- <if test="dh != null and dh != ''">
|
|
|
|
|
- AND a.dh like concat(concat('%',#{dh}),'%')
|
|
|
|
|
- </if>
|
|
|
|
|
- <if test="mlh != null and mlh != ''">
|
|
|
|
|
- AND a.mlh = #{mlh}
|
|
|
|
|
- </if>
|
|
|
|
|
- <if test="wjbh != null and wjbh != ''">
|
|
|
|
|
- AND (a.wjbh like concat(concat('%',#{wjbh}),'%') OR sa.wh like concat(concat('%',#{wjbh}),'%'))
|
|
|
|
|
- </if>
|
|
|
|
|
- <if test="ml != null and ml != ''">
|
|
|
|
|
- AND (a.ml = #{ml} or a.ml in (select `code` FROM tab_archives_tree where parent_id = (SELECT id FROM `tab_archives_tree` where code = #{ml})))
|
|
|
|
|
- </if>
|
|
|
|
|
- <if test="bgqx != null and bgqx != ''">
|
|
|
|
|
- <choose>
|
|
|
|
|
- <when test="bgqx == 'D10' or bgqx == '005'">
|
|
|
|
|
- AND a.bgqx in ('D10','005')
|
|
|
|
|
- </when>
|
|
|
|
|
- <when test="bgqx == 'D30' or bgqx == '004'">
|
|
|
|
|
- AND a.bgqx in ('D30','004')
|
|
|
|
|
- </when>
|
|
|
|
|
- <when test="bgqx == 'Y'.toString() or bgqx == '001'">
|
|
|
|
|
- AND a.bgqx in ('Y','001')
|
|
|
|
|
- </when>
|
|
|
|
|
- <otherwise>
|
|
|
|
|
- AND a.bgqx = #{bgqx}
|
|
|
|
|
- </otherwise>
|
|
|
|
|
- </choose>
|
|
|
|
|
- </if>
|
|
|
|
|
- <if test="mj != null and mj != ''">
|
|
|
|
|
- AND a.mj = #{mj}
|
|
|
|
|
- </if>
|
|
|
|
|
- <if test="gdnd != null and gdnd != ''">
|
|
|
|
|
- AND a.gdnd = #{gdnd}
|
|
|
|
|
- </if>
|
|
|
|
|
- <if test="ztc != null and ztc != ''">
|
|
|
|
|
- AND (a.ztc like concat(concat('%',#{ztc}),'%') OR a.tm like concat(concat('%',#{ztc}),'%') OR sa.tm like concat(concat('%',#{ztc}),'%'))
|
|
|
|
|
- </if>
|
|
|
|
|
- <if test="qzh != null and qzh != ''">
|
|
|
|
|
- AND a.qzh = #{qzh}
|
|
|
|
|
- </if>
|
|
|
|
|
- <if test="sql != null and sql != ''">
|
|
|
|
|
- ${sql}
|
|
|
|
|
- </if>
|
|
|
|
|
- </where>
|
|
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="dh != null and dh != ''">
|
|
|
|
|
+ AND a.dh like concat(concat('%',#{dh}),'%')
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="mlh != null and mlh != ''">
|
|
|
|
|
+ AND a.mlh = #{mlh}
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="wjbh != null and wjbh != ''">
|
|
|
|
|
+ AND (a.wjbh like concat(concat('%',#{wjbh}),'%') OR sa.wh like concat(concat('%',#{wjbh}),'%'))
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="ml != null and ml != ''">
|
|
|
|
|
+ AND (a.ml = #{ml} or a.ml in (select `code` FROM tab_archives_tree where parent_id = (SELECT id FROM
|
|
|
|
|
+ `tab_archives_tree` where code = #{ml})))
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="bgqx != null and bgqx != ''">
|
|
|
|
|
+ <choose>
|
|
|
|
|
+ <when test="bgqx == 'D10' or bgqx == '005'">
|
|
|
|
|
+ AND a.bgqx in ('D10','005')
|
|
|
|
|
+ </when>
|
|
|
|
|
+ <when test="bgqx == 'D30' or bgqx == '004'">
|
|
|
|
|
+ AND a.bgqx in ('D30','004')
|
|
|
|
|
+ </when>
|
|
|
|
|
+ <when test="bgqx == 'Y'.toString() or bgqx == '001'">
|
|
|
|
|
+ AND a.bgqx in ('Y','001')
|
|
|
|
|
+ </when>
|
|
|
|
|
+ <otherwise>
|
|
|
|
|
+ AND a.bgqx = #{bgqx}
|
|
|
|
|
+ </otherwise>
|
|
|
|
|
+ </choose>
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="mj != null and mj != ''">
|
|
|
|
|
+ AND a.mj = #{mj}
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="gdnd != null and gdnd != ''">
|
|
|
|
|
+ AND a.gdnd = #{gdnd}
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="ztc != null and ztc != ''">
|
|
|
|
|
+ AND (a.ztc like concat(concat('%',#{ztc}),'%') OR a.tm like concat(concat('%',#{ztc}),'%') OR sa.tm like
|
|
|
|
|
+ concat(concat('%',#{ztc}),'%'))
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="qzh != null and qzh != ''">
|
|
|
|
|
+ AND a.qzh = #{qzh}
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="sql != null and sql != ''">
|
|
|
|
|
+ ${sql}
|
|
|
|
|
+ </if>
|
|
|
group by a.id
|
|
group by a.id
|
|
|
<if test="field != null and field != '' and order != null and order != ''">
|
|
<if test="field != null and field != '' and order != null and order != ''">
|
|
|
order by ${field} ${order}
|
|
order by ${field} ${order}
|
|
@@ -100,7 +90,8 @@
|
|
|
AND (a.wjbh like concat(concat('%',#{wjbh}),'%') OR sa.wh like concat(concat('%',#{wjbh}),'%'))
|
|
AND (a.wjbh like concat(concat('%',#{wjbh}),'%') OR sa.wh like concat(concat('%',#{wjbh}),'%'))
|
|
|
</if>
|
|
</if>
|
|
|
<if test="ml != null and ml != ''">
|
|
<if test="ml != null and ml != ''">
|
|
|
- AND a.ml = #{ml} or a.ml in (select `code` FROM tab_archives_tree where parent_id = (SELECT id FROM `tab_archives_tree` where code = #{ml}))
|
|
|
|
|
|
|
+ AND a.ml = #{ml} or a.ml in (select `code` FROM tab_archives_tree where parent_id = (SELECT id FROM
|
|
|
|
|
+ `tab_archives_tree` where code = #{ml}))
|
|
|
</if>
|
|
</if>
|
|
|
<if test="bgqx != null and bgqx != ''">
|
|
<if test="bgqx != null and bgqx != ''">
|
|
|
AND a.bgqx = #{bgqx}
|
|
AND a.bgqx = #{bgqx}
|
|
@@ -229,26 +220,24 @@
|
|
|
</select>
|
|
</select>
|
|
|
|
|
|
|
|
<select id="selectByPk" resultType="com.gz.rvo.archive.ArchiveRVO" parameterType="int">
|
|
<select id="selectByPk" resultType="com.gz.rvo.archive.ArchiveRVO" parameterType="int">
|
|
|
- SELECT
|
|
|
|
|
- d.dict_name mj_text,
|
|
|
|
|
- d1.dict_name bgqx_text,
|
|
|
|
|
- d2.title ml_Text,
|
|
|
|
|
- a.*
|
|
|
|
|
|
|
+ SELECT d.dict_name mj_text,
|
|
|
|
|
+ d1.dict_name bgqx_text,
|
|
|
|
|
+ d2.title ml_Text,
|
|
|
|
|
+ a.*
|
|
|
FROM `tab_archives` a
|
|
FROM `tab_archives` a
|
|
|
- LEFT JOIN tab_dict d ON a.mj = d.dict_code
|
|
|
|
|
- LEFT JOIN tab_dict d1 ON a.bgqx = d1.dict_code
|
|
|
|
|
- LEFT JOIN tab_archives_tree d2 ON a.ml = d2.code
|
|
|
|
|
|
|
+ LEFT JOIN tab_dict d ON a.mj = d.dict_code
|
|
|
|
|
+ LEFT JOIN tab_dict d1 ON a.bgqx = d1.dict_code
|
|
|
|
|
+ LEFT JOIN tab_archives_tree d2 ON a.ml = d2.code
|
|
|
where a.deleted = 0
|
|
where a.deleted = 0
|
|
|
- and a.id = #{id}
|
|
|
|
|
|
|
+ and a.id = #{id}
|
|
|
</select>
|
|
</select>
|
|
|
|
|
|
|
|
|
|
|
|
|
- <select id="selectByDh" resultType="com.gz.rvo.archive.ArchiveRVO" parameterType="string">
|
|
|
|
|
- SELECT
|
|
|
|
|
- d.dict_name mj_text,
|
|
|
|
|
- d1.dict_name bgqx_text,
|
|
|
|
|
- d2.title ml_Text,
|
|
|
|
|
- a.*
|
|
|
|
|
|
|
+ <select id="selectByDh" resultType="com.gz.rvo.archive.ArchiveRVO" parameterType="string">
|
|
|
|
|
+ SELECT d.dict_name mj_text,
|
|
|
|
|
+ d1.dict_name bgqx_text,
|
|
|
|
|
+ d2.title ml_Text,
|
|
|
|
|
+ a.*
|
|
|
FROM `tab_archives` a
|
|
FROM `tab_archives` a
|
|
|
LEFT JOIN tab_dict d ON a.mj = d.dict_code
|
|
LEFT JOIN tab_dict d ON a.mj = d.dict_code
|
|
|
LEFT JOIN tab_dict d1 ON a.bgqx = d1.dict_code
|
|
LEFT JOIN tab_dict d1 ON a.bgqx = d1.dict_code
|
|
@@ -258,10 +247,15 @@
|
|
|
</select>
|
|
</select>
|
|
|
|
|
|
|
|
<select id="getMenuId" resultType="int">
|
|
<select id="getMenuId" resultType="int">
|
|
|
- select menu_id from tab_menu_role where role_id = #{id} and role_type = 4
|
|
|
|
|
|
|
+ select menu_id
|
|
|
|
|
+ from tab_menu_role
|
|
|
|
|
+ where role_id = #{id}
|
|
|
|
|
+ and role_type = 4
|
|
|
</select>
|
|
</select>
|
|
|
|
|
|
|
|
<select id="getDeptId" resultType="string">
|
|
<select id="getDeptId" resultType="string">
|
|
|
- select dept_id from tab_admin where id=#{id}
|
|
|
|
|
|
|
+ select dept_id
|
|
|
|
|
+ from tab_admin
|
|
|
|
|
+ where id = #{id}
|
|
|
</select>
|
|
</select>
|
|
|
</mapper>
|
|
</mapper>
|