问题描述:
对于未申请过入会的人员,需要先加入到会员表中
其实最好的解决办法:
应该是将审核审批放在一个xml文件中,但是由于一些一言难尽的问题,不得不采取一些笨拙的方法。
在此过程中涉及的知识点有:
1.Oracle 的逻辑判断语法 https://blog.csdn.net/qq_26769591/article/details/88533799
2.freemaker语法
3.jsp语法等
最终的解决办法:
1.新增了一个专门处理审批的xml文件,
2.xml的内容如下:
<?xml version='1.0' encoding='UTF-8'?>
<query-config>
<!-- 修改用户信息-->
<query id="Q_AUDIT_TRADE_APPLY_2" type="batch" result="easyui">
<stmt>
<![CDATA[
update bi_trade_apply set apply_status=[state], apply_remarks =[remarks]
where apply_id=[apply_id];
<#if state=='3'>
<#if apply_type=='0'>
update bi_trade_info set trade_status=1,intrade_date=sysdate
where account=(select account from bi_trade_apply where apply_id=[apply_id]);
<#elseif apply_type=='1'>
update bi_trade_info set(sex,birthday,political_status,nation,email,card_type,card_no,qualifications,degree,post,duties,memo,dept_id,tele_phone,leaguer_type)
=(select sex,birthday,political_status,nation,email,card_type,card_no,qualifications,degree,post,duties,memo,dept_id,tele_phone,leaguer_type from bi_trade_apply bta where bta.apply_id=[apply_id])
where account=(select account from bi_trade_apply where apply_id=[apply_id])
<#elseif apply_type=='2'>
update bi_trade_info set trade_status=2
where account=(select account from bi_trade_apply where apply_id=[apply_id]);
</#if>
</#if>
<#if trade_status==-1>
insert into bi_trade_info(account,name,sex,birthday,political_status,nation,email,card_type,card_no,
qualifications,degree,post,duties,memo,dept_id,tele_phone,trade_status,intrade_date,leaguer_type)
select account,name,sex,birthday,political_status,nation,email,card_type,card_no,
qualifications,degree,post,duties,memo,dept_id,tele_phone,1,sysdate,leaguer_type
from bi_trade_apply where apply_id=[apply_id];
<#elseif trade_status==0>
update bi_trade_info set trade_status=1,intrade_date=sysdate where account=(select account from bi_trade_apply
where apply_id=[apply_id];
<#elseif trade_status==2>
update bi_trade_info set trade_status=1 where account=(select account from bi_trade_apply
where apply_id=[apply_id]);
</#if>
]]>
</stmt>
<processor name="set-value" type="before" seq="0" break="false">
<param name="var">trade_status</param>
<param name="sql">
<![CDATA[
select nvl(trade_status,-1)
from bi_trade_apply bta
left join bi_trade_info bti on bta.account=bti.account
where bta.apply_id=[apply_id]
]]>
</param>
</processor>
</query>
</query-config>