select currval('lf.sys_apply_id_seq'::regclass) as id
insert into lf.sys_apply
(userid,depids,tabs,entities,wkt,pwd,status,count,descr,create_user,create_time)
values
(#{userid},#{depids},#{tabs},#{entities},#{wkt},#{pwd},#{status},#{count},#{descr},#{createUser},now())
insert into lf.sys_apply
(userid,depids,tabs,entities,wkt,pwd,status,count,descr,create_user,create_time)
values
(#{item.userid},#{item.depids},#{item.tabs},#{item.entities},#{item.wkt},#{item.pwd},#{item.status},#{item.count},#{item.descr},#{item.createUser},now())
delete from lf.sys_apply where id = #{id}
delete from lf.sys_apply where id in
#{id}
update lf.sys_apply
set userid=#{userid},depids=#{depids},tabs=#{tabs},entities=#{entities},wkt=#{wkt},pwd=#{pwd},status=#{status},count=#{count},descr=#{descr},update_user=#{updateUser},update_time=now()
where id=#{id}
update lf.sys_apply
userid=#{item.userid},depids=#{item.depids},tabs=#{item.tabs},entities=#{item.entities},wkt=#{item.wkt},pwd=#{item.pwd},status=#{item.status},count=#{item.count},descr=#{item.descr},update_user=#{item.updateUser},update_time=now()
where id = #{item.id}
update lf.sys_apply set status = -10, update_user = #{userid}, update_time = now() where status between -1 and 9 and id = #{id}
update lf.sys_flow set status = 0, update_user = #{userid}, update_time = now() where status = -1 and applyid = #{id};
update lf.sys_apply a set status = (select count(*) from lf.sys_flow b where b.status = 1 and b.applyid = a.id), update_user = #{userid}, update_time = now() where status = -1 and id = #{id};
update lf.sys_flow set status = 1, update_user = #{userid}, update_time = now() where id = #{flowId};
update lf.sys_apply a set status = (select count(*) from lf.sys_flow b where b.status = 1 and b.applyid = a.id), update_user = #{userid}, update_time = now() where id = #{applyid};
update lf.sys_apply set status = 10 where status = count and id = #{applyid};
update lf.sys_flow set status = -1, update_user = #{userid}, update_time = now() where status = 0 and id = #{flowId};
update lf.sys_apply set status = -1, update_user = #{userid}, update_time = now() where status between 0 and 9 and id = #{applyid};