@ -5,82 +5,381 @@
<mapper namespace= "com.qs.serve.modules.seeyon.mapper.CommonCheckMapper" >
<select id= "pageCallbackList" resultType= "com.qs.serve.modules.seeyon.entity.vo.TodoVO" >
select
<if test= "query.targetType == 'CostBill'" >
select
'CostBill' as target_type,
cost.id as target_id,
cost.`code` as target_code,
cost.charge_theme as title,
cost.submit_time
from tbs_cost_apply cost where cost.charge_state = 4 and cost.user_id = #{query.userId} and cost.del_flag = 0
UNION
select
cost.submit_time as `time`
from tbs_cost_apply cost where cost.charge_state = 4 and cost.user_id = #{query.userId} and cost.del_flag = 0
<if test= "query.title !=null and query.title != ''" >
and cost.charge_theme like concat('%',#{query.title},'%')
</if>
<if test= "query.targetCode !=null and query.targetCode != ''" >
and cost.code like concat('%',#{query.targetCode},'%')
</if>
<if test= "query.startDate !=null" >
and cost.submit_time > = #{query.startDate}
</if>
<if test= "query.endDate !=null" >
and cost.submit_time < = #{query.endDate}
</if>
</if>
<if test= "query.targetType == 'ReleasePolicy'" >
select
'ReleasePolicy' as target_type,
policy.id as target_id,
policy.policy_code as target_code,
policy.title,
policy.submit_time
from tzc_policy policy where policy.policy_status = 4 and policy.user_id = #{query.userId} and policy.del_flag = 0
UNION
select
policy.submit_time as `time`
from tzc_policy policy where policy.policy_status = 4 and policy.user_id = #{query.userId} and policy.del_flag = 0
<if test= "query.title !=null and query.title != ''" >
and policy.title like concat('%',#{query.title},'%')
</if>
<if test= "query.targetCode !=null and query.targetCode != ''" >
and policy.policy_code like concat('%',#{query.targetCode},'%')
</if>
<if test= "query.startDate !=null" >
and policy.submit_time > = #{query.startDate}
</if>
<if test= "query.endDate !=null" >
and policy.submit_time < = #{query.endDate}
</if>
</if>
<if test= "query.targetType == 'CheckCost'" >
select
'CheckCost' as target_type,
vtb.id as target_id,
vtb.`verification_code` as target_code,
act.act_title as title,
vtb.create_time as submit_time
from vtb_verification vtb
left join tbs_activity act on vtb.activity_id = act.id
where vtb.verification_state = 3 and vtb.user_id = #{query.userId} and act.del_flag = 0 and vtb.del_flag = 0
UNION
select
vtb.create_time as `time`
from vtb_verification vtb
left join tbs_activity act on vtb.activity_id = act.id
where vtb.verification_state = 3 and vtb.user_id = #{query.userId} and act.del_flag = 0 and vtb.del_flag = 0
<if test= "query.title !=null and query.title != ''" >
and act.act_title like concat('%',#{query.title},'%')
</if>
<if test= "query.targetCode !=null and query.targetCode != ''" >
and vtb.`verification_code` like concat('%',#{query.targetCode},'%')
</if>
<if test= "query.startDate !=null" >
and vtb.create_time > = #{query.startDate}
</if>
<if test= "query.endDate !=null" >
and vtb.create_time < = #{query.endDate}
</if>
</if>
<if test= "query.targetType == 'budgetAdjust'" >
select
'budgetAdjust' as target_type,
budget.id as target_id,
budget.budget_number as target_code,
budget.budget_code as title,
budget.submit_time
from tbs_budget budget
where budget.budget_check_state = 3 and budget.user_id = #{query.userId} and budget.del_flag = 0
UNION
select
budget.submit_time as `time`
from tbs_budget budget
where budget.budget_check_state = 3 and budget.user_id = #{query.userId} and budget.del_flag = 0
<if test= "query.title !=null and query.title != ''" >
and budget.budget_code like concat('%',#{query.title},'%')
</if>
<if test= "query.targetCode !=null and query.targetCode != ''" >
and budget.budget_number like concat('%',#{query.targetCode},'%')
</if>
<if test= "query.startDate !=null" >
and budget.submit_time > = #{query.startDate}
</if>
<if test= "query.endDate !=null" >
and budget.submit_time < = #{query.endDate}
</if>
</if>
<if test= "query.targetType == 'budgetAdjust2'" >
select
'budgetAdjust2' as target_type,
budget_change.id as target_id,
budget_change.change_code as target_code,
budget_change.budget_title as title,
budget_change.submit_time
from tbs_budget_change budget_change
where budget_change.budget_check_state = 3 and budget_change.user_id = #{query.userId} and budget_change.del_flag = 0
budget_change.submit_time as `time`
from tbs_budget_change budget_change
where budget_change.budget_check_state = 3 and budget_change.user_id = #{query.userId} and budget_change.del_flag = 0
<if test= "query.title !=null and query.title != ''" >
and budget_change.budget_title like concat('%',#{query.title},'%')
</if>
<if test= "query.targetCode !=null and query.targetCode != ''" >
and budget_change.change_code like concat('%',#{query.targetCode},'%')
</if>
<if test= "query.startDate !=null" >
and budget_change.submit_time > = #{query.startDate}
</if>
<if test= "query.endDate !=null" >
and budget_change.submit_time < = #{query.endDate}
</if>
</if>
<if test= "query.targetType == null " >
select
'CostBill' as target_type,
cost.id as target_id,
cost.`code` as target_code,
cost.charge_theme as title,
cost.submit_time as `time`
from tbs_cost_apply cost where cost.charge_state = 4 and cost.user_id = #{query.userId} and cost.del_flag = 0
<if test= "query.title !=null and query.title != ''" >
and cost.charge_theme like concat('%',#{query.title},'%')
</if>
<if test= "query.targetCode !=null and query.targetCode != ''" >
and cost.code like concat('%',#{query.targetCode},'%')
</if>
<if test= "query.startDate !=null" >
and cost.submit_time > = #{query.startDate}
</if>
<if test= "query.endDate !=null" >
and cost.submit_time < = #{query.endDate}
</if>
UNION
select
'ReleasePolicy' as target_type,
policy.id as target_id,
policy.policy_code as target_code,
policy.title,
policy.submit_time
from tzc_policy policy where policy.policy_status = 4 and policy.user_id = #{query.userId} and policy.del_flag = 0
<if test= "query.title !=null and query.title != ''" >
and policy.title like concat('%',#{query.title},'%')
</if>
<if test= "query.targetCode !=null and query.targetCode != ''" >
and policy.policy_code like concat('%',#{query.targetCode},'%')
</if>
<if test= "query.startDate !=null" >
and policy.submit_time > = #{query.startDate}
</if>
<if test= "query.endDate !=null" >
and policy.submit_time < = #{query.endDate}
</if>
UNION
select
'CheckCost' as target_type,
vtb.id as target_id,
vtb.`verification_code` as target_code,
act.act_title as title,
vtb.create_time as `time`
from vtb_verification vtb
left join tbs_activity act on vtb.activity_id = act.id
where vtb.verification_state = 3 and vtb.user_id = #{query.userId} and act.del_flag = 0 and vtb.del_flag = 0
<if test= "query.title !=null and query.title != ''" >
and act.act_title like concat('%',#{query.title},'%')
</if>
<if test= "query.targetCode !=null and query.targetCode != ''" >
and vtb.`verification_code` like concat('%',#{query.targetCode},'%')
</if>
<if test= "query.startDate !=null" >
and vtb.create_time > = #{query.startDate}
</if>
<if test= "query.endDate !=null" >
and vtb.create_time < = #{query.endDate}
</if>
UNION
select
'budgetAdjust' as target_type,
budget.id as target_id,
budget.budget_number as target_code,
budget.budget_code as title,
budget.submit_time as `time`
from tbs_budget budget
where budget.budget_check_state = 3 and budget.user_id = #{query.userId} and budget.del_flag = 0
<if test= "query.title !=null and query.title != ''" >
and budget.budget_code like concat('%',#{query.title},'%')
</if>
<if test= "query.targetCode !=null and query.targetCode != ''" >
and budget.budget_number like concat('%',#{query.targetCode},'%')
</if>
<if test= "query.startDate !=null" >
and budget.submit_time > = #{query.startDate}
</if>
<if test= "query.endDate !=null" >
and budget.submit_time < = #{query.endDate}
</if>
UNION
select
'budgetAdjust2' as target_type,
budget_change.id as target_id,
budget_change.change_code as target_code,
budget_change.budget_title as title,
budget_change.submit_time as `time`
from tbs_budget_change budget_change
where budget_change.budget_check_state = 3 and budget_change.user_id = #{query.userId} and budget_change.del_flag = 0
<if test= "query.title !=null and query.title != ''" >
and budget_change.budget_title like concat('%',#{query.title},'%')
</if>
<if test= "query.targetCode !=null and query.targetCode != ''" >
and budget_change.change_code like concat('%',#{query.targetCode},'%')
</if>
<if test= "query.startDate !=null" >
and budget_change.submit_time > = #{query.startDate}
</if>
<if test= "query.endDate !=null" >
and budget_change.submit_time < = #{query.endDate}
</if>
</if>
limit #{query.startRow},#{query.pageSize}
</select>
<select id= "countCallback" resultType= "java.lang.Long" >
select count(0) from (
select
'CostBill' as target_type,
cost.id as target_id
from tbs_cost_apply cost where cost.charge_state = 4 and cost.user_id = #{query.userId} and cost.del_flag = 0
UNION
select
'ReleasePolicy' as target_type,
policy.id as target_id
from tzc_policy policy where policy.policy_status = 4 and policy.user_id = #{query.userId} and policy.del_flag = 0
UNION
select
'CheckCost' as target_type,
vtb.id as target_id
from vtb_verification vtb
left join tbs_activity act on vtb.activity_id = act.id
where vtb.verification_state = 3 and vtb.user_id = #{query.userId} and vtb.del_flag = 0
UNION
select
'budgetAdjust' as target_type,
budget.id as target_id
from tbs_budget budget
where budget.budget_check_state = 3 and budget.user_id = #{query.userId} and budget.del_flag = 0
UNION
select
'budgetAdjust2' as target_type,
budget_change.id as target_id
from tbs_budget_change budget_change
where budget_change.budget_check_state = 3 and budget_change.user_id = #{query.userId} and budget_change.del_flag = 0
<if test= "query.targetType == 'CostBill'" >
select
'CostBill' as target_type,
cost.id as target_id
from tbs_cost_apply cost where cost.charge_state = 4 and cost.user_id = #{query.userId} and cost.del_flag = 0
<if test= "query.title !=null and query.title != ''" >
and cost.charge_theme like concat('%',#{query.title},'%')
</if>
<if test= "query.targetCode !=null and query.targetCode != ''" >
and cost.code like concat('%',#{query.targetCode},'%')
</if>
<if test= "query.startDate !=null" >
and cost.submit_time > = #{query.startDate}
</if>
<if test= "query.endDate !=null" >
and cost.submit_time < = #{query.endDate}
</if>
</if>
<if test= "query.targetType == 'ReleasePolicy'" >
select
'ReleasePolicy' as target_type,
policy.id as target_id
from tzc_policy policy where policy.policy_status = 4 and policy.user_id = #{query.userId} and policy.del_flag = 0
<if test= "query.title !=null and query.title != ''" >
and policy.title like concat('%',#{query.title},'%')
</if>
<if test= "query.targetCode !=null and query.targetCode != ''" >
and policy.policy_code like concat('%',#{query.targetCode},'%')
</if>
<if test= "query.startDate !=null" >
and policy.submit_time > = #{query.startDate}
</if>
<if test= "query.endDate !=null" >
and policy.submit_time < = #{query.endDate}
</if>
</if>
<if test= "query.targetType == 'CheckCost'" >
select
'CheckCost' as target_type,
vtb.id as target_id
from vtb_verification vtb
left join tbs_activity act on vtb.activity_id = act.id
where vtb.verification_state = 3 and vtb.user_id = #{query.userId} and vtb.del_flag = 0
</if>
<if test= "query.targetType == 'budgetAdjust'" >
select
'budgetAdjust' as target_type,
budget.id as target_id
from tbs_budget budget
where budget.budget_check_state = 3 and budget.user_id = #{query.userId} and budget.del_flag = 0
</if>
<if test= "query.targetType == 'budgetAdjust2'" >
select
'budgetAdjust2' as target_type,
budget_change.id as target_id
from tbs_budget_change budget_change
where budget_change.budget_check_state = 3 and budget_change.user_id = #{query.userId} and budget_change.del_flag = 0
</if>
<if test= "query.targetType == null " >
select
'CostBill' as target_type,
cost.id as target_id
from tbs_cost_apply cost where cost.charge_state = 4 and cost.user_id = #{query.userId} and cost.del_flag = 0
<if test= "query.title !=null and query.title != ''" >
and cost.charge_theme like concat('%',#{query.title},'%')
</if>
<if test= "query.targetCode !=null and query.targetCode != ''" >
and cost.code like concat('%',#{query.targetCode},'%')
</if>
<if test= "query.startDate !=null" >
and cost.submit_time > = #{query.startDate}
</if>
<if test= "query.endDate !=null" >
and cost.submit_time < = #{query.endDate}
</if>
union
select
'ReleasePolicy' as target_type,
policy.id as target_id
from tzc_policy policy where policy.policy_status = 4 and policy.user_id = #{query.userId} and policy.del_flag = 0
<if test= "query.title !=null and query.title != ''" >
and policy.title like concat('%',#{query.title},'%')
</if>
<if test= "query.targetCode !=null and query.targetCode != ''" >
and policy.policy_code like concat('%',#{query.targetCode},'%')
</if>
<if test= "query.startDate !=null" >
and policy.submit_time > = #{query.startDate}
</if>
<if test= "query.endDate !=null" >
and policy.submit_time < = #{query.endDate}
</if>
union
select
'CheckCost' as target_type,
vtb.id as target_id
from vtb_verification vtb
left join tbs_activity act on vtb.activity_id = act.id
where vtb.verification_state = 3 and vtb.user_id = #{query.userId} and vtb.del_flag = 0
<if test= "query.title !=null and query.title != ''" >
and act.act_title like concat('%',#{query.title},'%')
</if>
<if test= "query.targetCode !=null and query.targetCode != ''" >
and vtb.`verification_code` like concat('%',#{query.targetCode},'%')
</if>
<if test= "query.startDate !=null" >
and vtb.create_time > = #{query.startDate}
</if>
<if test= "query.endDate !=null" >
and vtb.create_time < = #{query.endDate}
</if>
union
select
'budgetAdjust' as target_type,
budget.id as target_id
from tbs_budget budget
where budget.budget_check_state = 3 and budget.user_id = #{query.userId} and budget.del_flag = 0
<if test= "query.title !=null and query.title != ''" >
and budget.budget_code like concat('%',#{query.title},'%')
</if>
<if test= "query.targetCode !=null and query.targetCode != ''" >
and budget.budget_number like concat('%',#{query.targetCode},'%')
</if>
<if test= "query.startDate !=null" >
and budget.submit_time > = #{query.startDate}
</if>
<if test= "query.endDate !=null" >
and budget.submit_time < = #{query.endDate}
</if>
union
select
'budgetAdjust2' as target_type,
budget_change.id as target_id
from tbs_budget_change budget_change
where budget_change.budget_check_state = 3 and budget_change.user_id = #{query.userId} and budget_change.del_flag = 0
<if test= "query.title !=null and query.title != ''" >
and budget_change.budget_title like concat('%',#{query.title},'%')
</if>
<if test= "query.targetCode !=null and query.targetCode != ''" >
and budget_change.change_code like concat('%',#{query.targetCode},'%')
</if>
<if test= "query.startDate !=null" >
and budget_change.submit_time > = #{query.startDate}
</if>
<if test= "query.endDate !=null" >
and budget_change.submit_time < = #{query.endDate}
</if>
</if>
) tmp_tb
</select>