|
|
|
|
queryByCondition
|
|
|
|
|
===
|
|
|
|
|
* 根据不为空的参数进行分页查询
|
|
|
|
|
|
|
|
|
|
select
|
|
|
|
|
@pageTag(){
|
|
|
|
|
t.*,
|
|
|
|
|
a.course_info_name
|
|
|
|
|
@}
|
|
|
|
|
from resources_info t
|
|
|
|
|
left join course_info a on a.course_info_id = t.course_info_id
|
|
|
|
|
where 1=1
|
|
|
|
|
@//数据权限,该sql语句功能点,如果不考虑数据权限,可以删除此行
|
|
|
|
|
and #function("resourcesInfo.query")#
|
|
|
|
|
@if(!isEmpty(resourcesInfoIds)){
|
|
|
|
|
and find_in_set(t.resources_info_id,#resourcesInfoIds#)
|
|
|
|
|
@}
|
|
|
|
|
@if(!isEmpty(resourcesInfoId)){
|
|
|
|
|
and t.resources_info_id =#resourcesInfoId#
|
|
|
|
|
@}
|
|
|
|
|
@if(!isEmpty(courseInfoIds)){
|
|
|
|
|
and find_in_set(t.course_info_id,#courseInfoIds#)
|
|
|
|
|
@}
|
|
|
|
|
@if(!isEmpty(courseInfoId)){
|
|
|
|
|
and t.course_info_id =#courseInfoId#
|
|
|
|
|
@}
|
|
|
|
|
@if(!isEmpty(resourcesInfoName)){
|
|
|
|
|
and t.resources_info_name like #'%'+resourcesInfoName+'%'#
|
|
|
|
|
@}
|
|
|
|
|
@if(!isEmpty(resourcesInfoType)){
|
|
|
|
|
and t.resources_info_type =#resourcesInfoType#
|
|
|
|
|
@}
|
|
|
|
|
@if(!isEmpty(resourcesInfoContent)){
|
|
|
|
|
and t.resources_info_content =#resourcesInfoContent#
|
|
|
|
|
@}
|
|
|
|
|
@if(!isEmpty(orgId)){
|
|
|
|
|
and t.org_id =#orgId#
|
|
|
|
|
@}
|
|
|
|
|
@if(!isEmpty(orgIdPlural)){
|
|
|
|
|
and (find_in_set(ifnull(t.org_id, 1), #orgIdPlural#))
|
|
|
|
|
@}
|
|
|
|
|
@if(!isEmpty(courseInfoFullId)){
|
|
|
|
|
and a.course_info_full_id like #courseInfoFullId+"%"#
|
|
|
|
|
@}
|
|
|
|
|
@if(!isEmpty(addType)){
|
|
|
|
|
and t.add_type =#addType#
|
|
|
|
|
@}
|
|
|
|
|
@if(isEmpty(seeSelf) && !isEmpty(userId)){
|
|
|
|
|
and t.user_id =#userId#
|
|
|
|
|
@}
|
|
|
|
|
@if(!isEmpty(seeSelf) && seeSelf && !isEmpty(userId)){
|
|
|
|
|
and (t.add_type = 'ADMIN_ADD' or t.user_id = #userId#)
|
|
|
|
|
@}
|
|
|
|
|
@if(!isEmpty(courseInfoId_1)){
|
|
|
|
|
and a.course_info_full_id like #courseInfoId_1 + '%'#
|
|
|
|
|
@} else if(!isEmpty(courseInfoId_2)){
|
|
|
|
|
and a.course_info_full_id like #courseInfoId_1 + '_' + courseInfoId_2 + '%'#
|
|
|
|
|
@} else if(!isEmpty(courseInfoId_3)){
|
|
|
|
|
and a.course_info_full_id like #courseInfoId_1 + '_' + courseInfoId_2 + '_' + courseInfoId_3 + '%'#
|
|
|
|
|
@}
|
|
|
|
|
ORDER BY t.resources_info_id DESC
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
deleteResourcesInfoByIds
|
|
|
|
|
===
|
|
|
|
|
|
|
|
|
|
* 批量删除
|
|
|
|
|
|
|
|
|
|
delete from resources_info where find_in_set(resources_info_id,#ids#)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
getValuesByQuery
|
|
|
|
|
===
|
|
|
|
|
|
|
|
|
|
* 根据不为空的参数进行查询
|
|
|
|
|
|
|
|
|
|
select t.*
|
|
|
|
|
from resources_info t
|
|
|
|
|
left join course_info a on a.course_info_id = t.course_info_id
|
|
|
|
|
where 1=1
|
|
|
|
|
@if(!isEmpty(resourcesInfoIds)){
|
|
|
|
|
and find_in_set(t.resources_info_id,#resourcesInfoIds#)
|
|
|
|
|
@}
|
|
|
|
|
@if(!isEmpty(resourcesInfoId)){
|
|
|
|
|
and t.resources_info_id =#resourcesInfoId#
|
|
|
|
|
@}
|
|
|
|
|
@if(!isEmpty(courseInfoIds)){
|
|
|
|
|
and find_in_set(t.course_info_id,#courseInfoIds#)
|
|
|
|
|
@}
|
|
|
|
|
@if(!isEmpty(courseInfoId)){
|
|
|
|
|
and t.course_info_id =#courseInfoId#
|
|
|
|
|
@}
|
|
|
|
|
@if(!isEmpty(resourcesInfoName)){
|
|
|
|
|
and t.resources_info_name =#resourcesInfoName#
|
|
|
|
|
@}
|
|
|
|
|
@if(!isEmpty(resourcesInfoType)){
|
|
|
|
|
and t.resources_info_type =#resourcesInfoType#
|
|
|
|
|
@}
|
|
|
|
|
@if(!isEmpty(resourcesInfoContent)){
|
|
|
|
|
and t.resources_info_content =#resourcesInfoContent#
|
|
|
|
|
@}
|
|
|
|
|
@if(!isEmpty(orgId)){
|
|
|
|
|
and t.org_id =#orgId#
|
|
|
|
|
@}
|
|
|
|
|
@if(!isEmpty(addType)){
|
|
|
|
|
and t.add_type =#addType#
|
|
|
|
|
@}
|
|
|
|
|
@if(!isEmpty(courseInfoFullId)){
|
|
|
|
|
and a.course_info_full_id like #courseInfoFullId+"%"#
|
|
|
|
|
@}
|
|
|
|
|
@if(isEmpty(seeSelf) && !isEmpty(userId)){
|
|
|
|
|
and t.user_id =#userId#
|
|
|
|
|
@}
|
|
|
|
|
@if(!isEmpty(seeSelf) && seeSelf && !isEmpty(userId)){
|
|
|
|
|
and (t.add_type = 'ADMIN_ADD' or t.user_id = #userId#)
|
|
|
|
|
@}
|
|
|
|
|
|
|
|
|
|
getResourcesInfoValues
|
|
|
|
|
===
|
|
|
|
|
|
|
|
|
|
* 根据不为空的参数进行查询
|
|
|
|
|
|
|
|
|
|
select t.*
|
|
|
|
|
from resources_info t
|
|
|
|
|
where 1=1
|
|
|
|
|
@if(!isEmpty(resourcesInfoId)){
|
|
|
|
|
and t.resources_info_id =#resourcesInfoId#
|
|
|
|
|
@}
|
|
|
|
|
@if(!isEmpty(courseInfoId)){
|
|
|
|
|
and t.course_info_id =#courseInfoId#
|
|
|
|
|
@}
|
|
|
|
|
@if(!isEmpty(resourcesInfoName)){
|
|
|
|
|
and t.resources_info_name =#resourcesInfoName#
|
|
|
|
|
@}
|
|
|
|
|
@if(!isEmpty(resourcesInfoType)){
|
|
|
|
|
and t.resources_info_type =#resourcesInfoType#
|
|
|
|
|
@}
|
|
|
|
|
@if(!isEmpty(resourcesInfoContent)){
|
|
|
|
|
and t.resources_info_content =#resourcesInfoContent#
|
|
|
|
|
@}
|
|
|
|
|
@if(!isEmpty(orgId)){
|
|
|
|
|
and t.org_id =#orgId#
|
|
|
|
|
@}
|
|
|
|
|
@if(!isEmpty(addType)){
|
|
|
|
|
and t.add_type =#addType#
|
|
|
|
|
@}
|
|
|
|
|
@if(!isEmpty(userId)){
|
|
|
|
|
and t.user_id =#userId#
|
|
|
|
|
@}
|