(SELECT name FROM zzgl_bmgw_m WHERE id = (SELECT bmgw_id FROM yggl_main_emp WHERE a.emp_num = emp_num and a.org_code=org_code limit 1) limit 1) as gw_name,
(SELECT id FROM zzgl_bmgw_m WHERE id = (SELECT up_id FROM zzgl_bmgw_m WHERE id = (SELECT bmgw_id FROM yggl_main_emp WHERE a.emp_num = emp_num and a.org_code=org_code limit 1) limit 1) limit 1) as bm_id,
...
...
@@ -114,7 +114,7 @@
and (
a.title like CONCAT('%',#{param.query},'%') or
a.initiator like CONCAT('%',#{param.query},'%') or
a.id like CONCAT('%',#{param.query},'%')
a.id like CONCAT('%',#{param.query},'%')
)
</if>
<iftest="param.sts != null">
...
...
@@ -127,52 +127,52 @@
and a.create_time <![CDATA[ <= ]]> #{param.endTime}
</if>
<iftest="param.empNums != null and param.empNums.size() > 0">
(SELECT name FROM zzgl_bmgw_m WHERE id = (SELECT bmgw_id FROM yggl_main_emp WHERE a.emp_num = emp_num limit 1) limit 1) as gw_name,
(SELECT id FROM zzgl_bmgw_m WHERE id = (SELECT up_id FROM zzgl_bmgw_m WHERE id = (SELECT bmgw_id FROM yggl_main_emp WHERE a.emp_num = emp_num limit 1) limit 1) limit 1) as bm_id,
(SELECT name FROM zzgl_bmgw_m WHERE id = (SELECT up_id FROM zzgl_bmgw_m WHERE id = (SELECT bmgw_id FROM yggl_main_emp WHERE a.emp_num = emp_num limit 1) limit 1) limit 1) as bm_name
FROM spmk_approve_summary a
WHERE a.org_code = #{param.orgCode} and a.is_delete=0
<iftest="param.type != null and param.type >= 1">
and a.id in
(SELECT approve_summary_id FROM spmk_approve_execute_record WHERE id IN
(SELECT
approve_execute_record_id
FROM
spmk_executor
WHERE
and a.id in
(SELECT approve_summary_id FROM spmk_approve_execute_record WHERE id IN
(SELECT
approve_execute_record_id
FROM
spmk_executor
WHERE
emp_num = #{param.empNum}
<iftest="param.sts == 0">
and sts not in (2,3,4)
</if>
)
)
<iftest="param.type == 3">
and type in (0,1,2)
</if>
<iftest="param.type != 3">
and type = #{param.type}
</if>
)
)
</if>
<iftest="param.type != null and param.type == 0">
and a.emp_num = #{param.empNum}
</if>
<iftest="param.sts != null">
<iftest="param.sts == 5">
and a.sts in (0,1,2,3)
...
...
@@ -184,13 +184,13 @@
and a.sts = #{param.sts}
</if>
</if>
<iftest="param.query != null and param.query != ''">
and (
a.title like CONCAT('%',#{param.query},'%') or
a.initiator like CONCAT('%',#{param.query},'%') or
a.id like CONCAT('%',#{param.query},'%')
a.id like CONCAT('%',#{param.query},'%')
)
</if>
<iftest="param.startTime != null and param.startTime != ''">
...
...
@@ -198,12 +198,12 @@
</if>
<iftest="param.endTime != null and param.endTime != ''">
and a.create_time <![CDATA[ <= ]]> #{param.endTime}