|
|
@@ -10,6 +10,8 @@
|
|
|
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
|
|
|
<where>
|
|
|
a.deleted = 0
|
|
|
and ml IN (
|
|
|
@@ -31,7 +33,7 @@
|
|
|
AND a.mlh = #{mlh}
|
|
|
</if>
|
|
|
<if test="wjbh != null and wjbh != ''">
|
|
|
- AND a.wjbh like concat(concat('%',#{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}))
|
|
|
@@ -46,7 +48,7 @@
|
|
|
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}),'%'))
|
|
|
+ AND (a.ztc like concat(concat('%',#{ztc}),'%') OR a.tm like concat(concat('%',#{ztc}),'%') OR sa.tm like concat(concat('%',#{ztc}),'%'))
|
|
|
</if>
|
|
|
<if test="sql != null and sql != ''">
|
|
|
${sql}
|
|
|
@@ -71,10 +73,10 @@
|
|
|
AND a.mlh = #{mlh}
|
|
|
</if>
|
|
|
<if test="wjbh != null and wjbh != ''">
|
|
|
- AND a.wjbh like concat(concat('%',#{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}
|
|
|
+ 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 != ''">
|
|
|
AND a.bgqx = #{bgqx}
|
|
|
@@ -86,7 +88,7 @@
|
|
|
AND a.mj = #{mj}
|
|
|
</if>
|
|
|
<if test="ztc != null and ztc != ''">
|
|
|
- AND (a.ztc like concat(concat('%',#{ztc}),'%') OR a.tm like concat(concat('%',#{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="sql != null and sql != ''">
|
|
|
${sql}
|