.and(wq->wq.eq("publisher",userBean.getEmpNum()).or().eq("author",userBean.getUserInfo().getName()).or().inSql("id","select cms_content_id from cms_content_read where user_id ="+userBean.getEmpNum()))
(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,
(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 and a.org_code=org_code limit 1) limit 1) limit 1) as bm_name
SELECT
<includerefid="Base_Column_List_a"/>,
(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,
(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 and a.org_code=org_code 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.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},'%')
)
</if>
<iftest="param.sts != null">
and a.sts = #{param.sts}
</if>
<iftest="param.startTime != null and param.startTime != ''">
and a.create_time <![CDATA[ >= ]]> #{param.startTime}
</if>
<iftest="param.endTime != null and param.endTime != ''">
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
SELECT
<includerefid="Base_Column_List_a"/>,
(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
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)
</if>
<iftest="param.sts == 4">
and a.sts in (2,3)
</if>
<iftest="param.sts != 4 and param.sts != 5">
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},'%')
)
</if>
<iftest="param.startTime != null and param.startTime != ''">
and a.create_time <![CDATA[ >= ]]> #{param.startTime}
</if>
<iftest="param.endTime != null and param.endTime != ''">
and a.create_time <![CDATA[ <= ]]> #{param.endTime}
</if>
<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
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)
</if>
<iftest="param.sts == 4">
and a.sts in (2,3)
</if>
<iftest="param.sts != 4 and param.sts != 5">
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},'%')
)
</if>
<iftest="param.startTime != null and param.startTime != ''">
and a.create_time <![CDATA[ >= ]]> #{param.startTime}
</if>
<iftest="param.endTime != null and param.endTime != ''">
and a.create_time <![CDATA[ <= ]]> #{param.endTime}