127 lines
5.8 KiB
XML
127 lines
5.8 KiB
XML
|
|
<?xml version="1.0" encoding="utf-8"?>
|
||
|
|
<dynamic-sql>
|
||
|
|
<sql id="getOutTrainList"><![CDATA[
|
||
|
|
select t.*,l.kcmc from et_train_ot t
|
||
|
|
left join et_train_kc_all l on t.wpid = l.id
|
||
|
|
where 1=1
|
||
|
|
<@p p="AND t.ID IN(%s)" f="?">id</@p>
|
||
|
|
<@p p=" AND (%s)" s=" or" f="%S LIKE ?">pxmc,kcmc,addgroupname</@p>
|
||
|
|
<@p p="AND (%s)">dwxz</@p>
|
||
|
|
<@p p="AND (%s)">status</@p>
|
||
|
|
<@p p="AND (%s)">delstatus</@p>
|
||
|
|
<@p p="and UPPER(sld) = ?">sld</@p>
|
||
|
|
<@p p="and addgroupid = ?">groupid</@p>
|
||
|
|
<@p p="and addgroupid in(%s)" f="?">groupidarray</@p>
|
||
|
|
<@p p="and addusercode = ?">addusercode</@p>
|
||
|
|
<@p p="and pxstarttime >= ?">startdate1</@p>
|
||
|
|
<@p p="and pxstarttime <= ?">startdate2</@p>
|
||
|
|
<@p p="and pxendtime >= ?">enddate1</@p>
|
||
|
|
<@p p="and pxendtime <= ?">enddate2</@p>
|
||
|
|
]]></sql>
|
||
|
|
|
||
|
|
<sql id="getOutTrainDbList以前的写法备份"><![CDATA[
|
||
|
|
select ot.* from et_train_ot ot,et_train_ot_xy xy where 1=1 and ot.delstatus=0 and ot.status=5
|
||
|
|
and (ot.id=xy.otid and UPPER(xy.usercode)=UPPER(<@p f="?">usercode</@p> ) and ot.pxdjfw='1'
|
||
|
|
and UPPER(<@p f="?">usercode</@p>) not in (select UPPER(pxdj.addusercode) from et_train_ot_pxdj pxdj where ot.id=pxdj.otid)
|
||
|
|
or 1=<@p f="?">sfgly</@p> and ot.pxdjfw='0' and UPPER(ot.addusercode) =UPPER(<@p f="?">usercode</@p>)
|
||
|
|
and UPPER(<@p f="?">usercode</@p>) not in (select pxdj.addusercode from et_train_ot_pxdj pxdj where ot.id=pxdj.otid))
|
||
|
|
group by ot.id order by ot.addtime desc
|
||
|
|
]]></sql>
|
||
|
|
|
||
|
|
<sql id="getOutTrainDbList"><![CDATA[
|
||
|
|
select * from et_train_ot ot
|
||
|
|
where <@p p=" addusercode= %s" f="?">usercode</@p> and pxdjfw='0' and delstatus=0 and status=5
|
||
|
|
and <@p f="?">usercode</@p> not in (select pxdj.addusercode from et_train_ot_pxdj pxdj where ot.id=pxdj.otid)
|
||
|
|
union
|
||
|
|
select ot.* from et_train_ot ot,et_train_ot_xy xy
|
||
|
|
where ot.id = xy.otid and <@p p=" xy.usercode= %s" f="?">usercode</@p> and pxdjfw='1' and delstatus=0 and status=5
|
||
|
|
and <@p f="?">usercode</@p> not in (select pxdj.addusercode from et_train_ot_pxdj pxdj where ot.id=pxdj.otid)
|
||
|
|
]]></sql>
|
||
|
|
|
||
|
|
<sql id="getOutTrainDeleteList"><![CDATA[
|
||
|
|
select otdel.*,ot.id otidid,ot.pxmc,ot.pxstarttime,ot.pxendtime
|
||
|
|
from et_train_ot_del otdel left join et_train_ot ot on(otdel.otid=ot.id) where 1=1
|
||
|
|
<@p p="and ot.pxmc like ?">pxmc</@p>
|
||
|
|
<@p p="AND otdel.ID IN(%s)" f="?">id</@p>
|
||
|
|
<@p p="AND otdel.status =%s" f="?">status</@p>
|
||
|
|
<@p p="AND otdel.addgroupid =%s" f="?">groupid</@p>
|
||
|
|
<@p p="and otdel.addgroupid in(%s)" f="?">groupidarray</@p>
|
||
|
|
<@p p="AND otdel.addusercode =%s" f="?">addusercode</@p>
|
||
|
|
]]></sql>
|
||
|
|
<sql id="getOutTrainXyList"><![CDATA[
|
||
|
|
select * from et_train_ot_xy where 1=1
|
||
|
|
<@p p="AND otid IN(%s)" f="?">otid</@p>
|
||
|
|
order by etsort asc
|
||
|
|
]]></sql>
|
||
|
|
<sql id="deleteOutTrainxy"><![CDATA[
|
||
|
|
DELETE FROM et_train_ot_xy WHERE otid IN(<@p f="?">otid</@p>)
|
||
|
|
]]>
|
||
|
|
</sql>
|
||
|
|
|
||
|
|
<sql id="getOutTrainPxdjByID"><![CDATA[
|
||
|
|
select ot.pxmc, pxdj.* from et_train_ot_pxdj pxdj left join et_train_ot ot on(ot.id=pxdj.otid) where 1=1
|
||
|
|
<@p p="AND pxdj.ID IN(%s)" f="?">id</@p>
|
||
|
|
]]></sql>
|
||
|
|
<sql id="getOutTrainPxdjByOTID"><![CDATA[
|
||
|
|
select ot.pxmc, pxdj.* from et_train_ot_pxdj pxdj left join et_train_ot ot on(ot.id=pxdj.otid) where 1=1
|
||
|
|
<@p p="AND ot.ID IN(%s)" f="?">id</@p>
|
||
|
|
]]></sql>
|
||
|
|
<sql id="getOutTrainPxdjList以前的写法备份"><![CDATA[
|
||
|
|
select ot.pxmc, pxdj.* from et_train_ot_pxdj pxdj left join et_train_ot ot on(ot.id=pxdj.otid) where 1=1
|
||
|
|
<@p p="AND pxdj.ID IN(%s)" f="?">id</@p>
|
||
|
|
<@p p="and ot.pxmc like ?">pxmc</@p>
|
||
|
|
and (('0'=<@p f="?">sfsp</@p>
|
||
|
|
and 1=1
|
||
|
|
<@p p="AND UPPER(pxdj.addusercode) =UPPER(%s)" f="?">usercode</@p>
|
||
|
|
or '1'=<@p f="?">sfgly</@p>
|
||
|
|
<@p p="AND pxdj.addgroupid =%s" f="?">groupid</@p>
|
||
|
|
and 1=1 ) or (1=1
|
||
|
|
<@p p="AND UPPER(pxdj.addusercode) =UPPER(%s)" f="?">usercode</@p>
|
||
|
|
<@p p="AND pxdj.addgroupid =%s" f="?">groupid</@p>
|
||
|
|
<@p p="AND pxdj.status =%s" f="?">status</@p>
|
||
|
|
and '1'=<@p f="?))">sfsp</@p>
|
||
|
|
]]></sql>
|
||
|
|
|
||
|
|
<sql id="getOutTrainPxdjList"><![CDATA[
|
||
|
|
select ot.pxmc, pxdj.*
|
||
|
|
from et_train_ot_pxdj pxdj
|
||
|
|
left join et_train_ot ot
|
||
|
|
on(ot.id=pxdj.otid) where 1=1
|
||
|
|
<@p p="and pxdj.addusercode = %s" f="?">usercode</@p>
|
||
|
|
<@p p="and pxdj.status = %s" f="?">status</@p>
|
||
|
|
<@p p="and pxdj.addgroupid = %s" f="?">groupid</@p>
|
||
|
|
<@p p="and pxdj.addgroupid in(%s)" f="?">groupidarray</@p>
|
||
|
|
<@p p="and ot.pxmc like ?">pxmc</@p>
|
||
|
|
<@p p="or pxdj.addgroupname like ?">addgroupname</@p>
|
||
|
|
]]></sql>
|
||
|
|
|
||
|
|
|
||
|
|
<sql id="getOutTrainPxdjxyList"><![CDATA[
|
||
|
|
(select pxdj.id,xy.username,xy.usercode,pxdj.status from et_train_ot_xy xy left join et_train_ot ot on(xy.otid=ot.id)
|
||
|
|
left join et_train_ot_pxdj pxdj on(pxdj.otid=xy.otid and xy.usercode= pxdj.addusercode) where 1=1
|
||
|
|
<@p p="AND xy.otid IN(%s)" f="?">otid</@p>
|
||
|
|
and ot.pxdjfw='1'
|
||
|
|
order by xy.etsort asc)
|
||
|
|
union
|
||
|
|
(select pxdj.id,ot.addusername username,ot.addusercode,pxdj.status from et_train_ot ot
|
||
|
|
left join et_train_ot_pxdj pxdj on(ot.id=pxdj.otid and ot.addusercode = pxdj.addusercode) where 1=1
|
||
|
|
<@p p="AND ot.id IN(%s)" f="?">otid</@p>
|
||
|
|
and ot.pxdjfw='0')
|
||
|
|
]]></sql>
|
||
|
|
|
||
|
|
|
||
|
|
<sql id="update_et_train_ot_status"><![CDATA[
|
||
|
|
update et_train_ot set delstatus=1 where 1=1
|
||
|
|
<@p p="AND ID IN(%s)" f="?">id</@p>
|
||
|
|
]]>
|
||
|
|
</sql>
|
||
|
|
|
||
|
|
<sql id="getOutComboxList"><![CDATA[
|
||
|
|
select id,concat(pxmc," (提交人:",addusername,",提交时间",addtime,")") pxmc
|
||
|
|
from et_train_ot
|
||
|
|
where 1=1
|
||
|
|
<@p p="and delstatus = ?">delstatus</@p>
|
||
|
|
<@p p="and addgroupid = ?">addgroupid</@p>
|
||
|
|
]]>
|
||
|
|
</sql>
|
||
|
|
</dynamic-sql>
|