- 系统管理模块(用户/角色/组织/权限/日志) - 教育培训计划管理模块 - 教育培训实施模块 - 考试管理模块 - 调研问卷管理模块 - 外派培训管理模块 - 年度培训总结模块 - 学习资源管理模块 - 任职资格管理模块 - 即时通讯模块 - APP 版本管理 - 统计分析模块(FineReport) - 代码审查标准和报告(CODE_REVIEW_GUIDE.md, CODE_REVIEW_REPORT.md) - 项目开发指南(PROJECT_GUIDE.md)
189 lines
6.6 KiB
XML
189 lines
6.6 KiB
XML
<?xml version="1.0" encoding="utf-8"?>
|
|
<dynamic-sql>
|
|
<sql id="getfile_list"><![CDATA[
|
|
select file.*,limitation.user,limitation.user_id
|
|
,course.course_person,course.course_person_id
|
|
,class.class_person,class.class_person_id
|
|
from et_resource_file as file
|
|
left join et_resource_limitation as limitation
|
|
on file.id = limitation.file_id
|
|
left join et_resource_limitation_class as class
|
|
on limitation.user_id = class.class_id
|
|
left join et_resource_limitation_course as course
|
|
on limitation.user_id = course.course_id
|
|
where 1=0
|
|
<@p p="or %s">pg</@p>
|
|
<@p p=" and ((user_id IN(%s)" f="?">user_id</@p>
|
|
<@p p=" and %s)">state</@p>
|
|
<@p p=" or %s)">providerid</@p>
|
|
<@p p="and (title like ?">key</@p>
|
|
<@p p="or category like ?">key</@p>
|
|
<@p p="or providerdepartname like ?)">key</@p>
|
|
group by file.id
|
|
|
|
]]>
|
|
</sql>
|
|
|
|
<sql id="getfile_list之前的写法"><![CDATA[
|
|
select
|
|
*
|
|
from et_resource_file where 1=1
|
|
<@p p="and %s">state</@p>
|
|
<@p p="and %s">pg</@p>
|
|
<@p p="and (title like ?">key</@p>
|
|
<@p p="or category like ?)">key</@p>
|
|
|
|
]]>
|
|
</sql>
|
|
|
|
<sql id="getfile_listByIds"><![CDATA[
|
|
select * from et_resource_file where id in
|
|
(
|
|
<@p f="?">id</@p>
|
|
)
|
|
]]>
|
|
</sql>
|
|
<sql id="getfileById"><![CDATA[
|
|
select * from et_resource_file where id =
|
|
(
|
|
<@p f="?">id</@p>
|
|
)
|
|
]]>
|
|
</sql>
|
|
<sql id="addFileClickById"><![CDATA[
|
|
update et_resource_file set
|
|
sumok = sumok + 1
|
|
where id =
|
|
(
|
|
<@p f="?">id</@p>
|
|
)
|
|
]]>
|
|
</sql>
|
|
|
|
<sql id="fileCoursePerson"><![CDATA[
|
|
insert et_resource_limitation_course
|
|
select md5(uuid()),<@p p=" ? ">limitation_id</@p> as limitation_id,<@p p=" ? ">file_id</@p> as file_id,coursename,courseid,username,usercode
|
|
from v_class_user
|
|
where <@p>courseid</@p>
|
|
]]></sql>
|
|
|
|
<sql id="fileClassPerson"><![CDATA[
|
|
insert et_resource_limitation_class
|
|
select md5(uuid()),<@p p=" ? ">limitation_id</@p> as limitation_id,<@p p=" ? ">file_id</@p> as file_id,classname,classid,username,usercode
|
|
from (SELECT
|
|
`et_train_pd_cc`.`id` AS `classid`,
|
|
`et_train_pd_cc`.`bjmc` AS `classname`,
|
|
`et_train_pd_cc`.`kcmcid` AS `courseid`,
|
|
`et_train_pd_cc`.`kcmc` AS `coursename`,
|
|
`et_train_pd_cc_user`.`usercode` AS `usercode`,
|
|
`et_train_pd_cc_user`.`username` AS `username`,
|
|
`et_train_pd_cc_user`.`groupid` AS `userdeptid`,
|
|
`et_train_pd_cc_user`.`groupname` AS `userdeptname`
|
|
FROM
|
|
( `et_train_pd_cc` LEFT JOIN `et_train_pd_cc_user` ON ( ( `et_train_pd_cc`.`id` = `et_train_pd_cc_user`.`ccid` ) ) )
|
|
where 1=1
|
|
<@p p="AND `et_train_pd_cc`.`id` = ?">classid</@p>
|
|
)a
|
|
|
|
]]></sql>
|
|
|
|
<sql id="getFileCheck"><![CDATA[
|
|
select * from et_resource_file where
|
|
<@p>pg</@p>
|
|
<@p p=" and %s ">providerid</@p>
|
|
or id in
|
|
(select a.file_id from et_resource_limitation a left join et_resource_limitation_class b on a.id = b.limitation_id where 1=1 <@p p="AND b.class_person_id = ?">class_person_id</@p>)
|
|
or id in
|
|
(select a.file_id from et_resource_limitation a left join et_resource_limitation_course b on a.id = b.limitation_id where 1=1 <@p p="AND b.course_person_id = ?">course_person_id</@p>)
|
|
<@p p="and (title like ?">key</@p>
|
|
<@p p="or category like ?">key</@p>
|
|
<@p p="or providerdepartname like ?)">key</@p>
|
|
]]>
|
|
</sql>
|
|
<sql id="getFileCheck查询效率低"><![CDATA[
|
|
select file.*,limitation.user,limitation.user_id
|
|
,course.course_person,course.course_person_id
|
|
,class.class_person,class.class_person_id
|
|
from et_resource_file as file
|
|
left join et_resource_limitation as limitation
|
|
on file.id = limitation.file_id
|
|
left join et_resource_limitation_class as class
|
|
on limitation.user_id = class.class_id
|
|
left join et_resource_limitation_course as course
|
|
on limitation.user_id = course.course_id
|
|
where
|
|
<@p>pg</@p>
|
|
<@p p=" and (%s">class_person_id</@p>
|
|
<@p p=" or %s">course_person_id</@p>
|
|
<@p p=" or %s)">providerid</@p>
|
|
<@p p="and (title like ?">key</@p>
|
|
<@p p="or category like ?">key</@p>
|
|
<@p p="or providerdepartname like ?)">key</@p>
|
|
group by file.id
|
|
|
|
]]>
|
|
</sql>
|
|
|
|
<sql id="getFileAdminLeader"><![CDATA[
|
|
select * from et_resource_file
|
|
where 1=1
|
|
<@p p=" and %s ">state</@p>
|
|
<@p p=" and %s ">pg</@p>
|
|
<@p p=" and %s ">providerdepartid</@p>
|
|
<@p p="and providerdepartid in(%s)" f="?">groupidarray</@p>
|
|
<@p p="and (title like ?">key</@p>
|
|
<@p p="or category like ?">key</@p>
|
|
<@p p="or providerdepartname like ?)">key</@p>
|
|
]]></sql>
|
|
|
|
<sql id="getLFileHistory"><![CDATA[
|
|
select title,provider,uploadtime,state_desc,approver_suggestion,approver,approver_edittime
|
|
from et_resource_file as file
|
|
INNER JOIN et_resource_adminleader as adminleader
|
|
on file.id = adminleader.file_id
|
|
where 1=1
|
|
<@p p=" and %s ">file_id</@p>
|
|
]]></sql>
|
|
|
|
<sql id="getIsNotLoginer"><![CDATA[
|
|
select providerid from et_resource_file
|
|
where <@p>id</@p>
|
|
]]></sql>
|
|
|
|
<sql id="getAllList"><![CDATA[
|
|
select * from et_resource_file
|
|
where 1=1
|
|
<@p p=" and %s ">pg</@p>
|
|
<@p p="and (title like ?">key</@p>
|
|
<@p p="or category like ?">key</@p>
|
|
<@p p="or providerdepartname like ?)">key</@p>
|
|
|
|
]]></sql>
|
|
|
|
<sql id="getFileUrl"><![CDATA[
|
|
select * from et_resource_file
|
|
where 1=1
|
|
<@p p=" and %s ">id</@p>
|
|
]]></sql>
|
|
|
|
<sql id="上传资料期限 定时任务删除"><![CDATA[
|
|
select zlqxid,uploadtime,datediff(curdate(),uploadtime) from et_resource_file
|
|
]]></sql>
|
|
|
|
<sql id="getFileAndLimitationList"><![CDATA[
|
|
select * from et_resource_file f
|
|
inner join et_resource_limitation l on l.file_id = f.id
|
|
where 1=1
|
|
and edittime < now()
|
|
<@p p=" and %s ">user_id</@p>
|
|
]]></sql>
|
|
|
|
<sql id="insertFileClassUser"><![CDATA[
|
|
insert into et_resource_limitation_class
|
|
select md5(uuid()) as id,l.id limitation_id,l.file_id,l.user class,l.user_id class_id,u.username class_person,u.usercode class_person_id
|
|
from et_resource_limitation l
|
|
inner join et_train_pd_cc_user u on l.user_id = u.ccid
|
|
where <@p>ccid</@p>
|
|
]]></sql>
|
|
|
|
</dynamic-sql> |