You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

203 lines
5.4 KiB
Markdown

3 years ago
queryByCondition
===
* 根据不为空的参数进行分页查询
select
@pageTag(){
3 years ago
t.*,
a.course_info_name
@}
3 years ago
from resources_info t
left join course_info a on a.course_info_id = t.course_info_id
where 1=1
@//数据权限该sql语句功能点,如果不考虑数据权限,可以删除此行
3 years ago
and #function("resourcesInfo.query")#
@if(!isEmpty(resourcesInfoIds)){
3 years ago
and find_in_set(t.resources_info_id,#resourcesInfoIds#)
@}
@if(!isEmpty(resourcesInfoId)){
3 years ago
and t.resources_info_id =#resourcesInfoId#
@}
@if(!isEmpty(courseInfoIds)){
3 years ago
and find_in_set(t.course_info_id,#courseInfoIds#)
@}
@if(!isEmpty(courseInfoId)){
3 years ago
and t.course_info_id =#courseInfoId#
@}
@if(!isEmpty(resourcesInfoName)){
3 years ago
and t.resources_info_name like #'%'+resourcesInfoName+'%'#
@}
@if(!isEmpty(resourcesInfoType)){
3 years ago
and t.resources_info_type =#resourcesInfoType#
@}
@if(!isEmpty(resourcesInfoContent)){
3 years ago
and t.resources_info_content =#resourcesInfoContent#
@}
@if(!isEmpty(orgId)){
3 years ago
and t.org_id =#orgId#
@}
@if(!isEmpty(orgIdPlural)){
and find_in_set(t.org_id, #orgIdPlural#)
@}
@if(!isEmpty(courseInfoFullId)){
and a.course_info_full_id like #courseInfoFullId+"%"#
@}
2 years ago
@if(!isEmpty(addType)){
and t.add_type =#addType#
@}
@if(isEmpty(seeSelf) && !isEmpty(userId)){
3 years ago
and t.user_id =#userId#
@}
2 years ago
@if(!isEmpty(seeSelf) && seeSelf && !isEmpty(userId)){
and (t.add_type = 'ADMIN_ADD' or t.user_id = #userId#)
@}
ORDER BY t.resources_info_id DESC
3 years ago
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
3 years ago
where 1=1
@if(!isEmpty(resourcesInfoIds)){
3 years ago
and find_in_set(t.resources_info_id,#resourcesInfoIds#)
@}
@if(!isEmpty(resourcesInfoId)){
3 years ago
and t.resources_info_id =#resourcesInfoId#
@}
@if(!isEmpty(courseInfoIds)){
3 years ago
and find_in_set(t.course_info_id,#courseInfoIds#)
@}
@if(!isEmpty(courseInfoId)){
3 years ago
and t.course_info_id =#courseInfoId#
@}
@if(!isEmpty(resourcesInfoName)){
3 years ago
and t.resources_info_name =#resourcesInfoName#
@}
@if(!isEmpty(resourcesInfoType)){
3 years ago
and t.resources_info_type =#resourcesInfoType#
@}
@if(!isEmpty(resourcesInfoContent)){
3 years ago
and t.resources_info_content =#resourcesInfoContent#
@}
@if(!isEmpty(orgId)){
3 years ago
and t.org_id =#orgId#
@}
2 years ago
@if(!isEmpty(addType)){
and t.add_type =#addType#
@}
@if(!isEmpty(courseInfoFullId)){
and a.course_info_full_id like #courseInfoFullId+"%"#
@}
2 years ago
@if(isEmpty(seeSelf) && !isEmpty(userId)){
3 years ago
and t.user_id =#userId#
@}
2 years ago
@if(!isEmpty(seeSelf) && seeSelf && !isEmpty(userId)){
and (t.add_type = 'ADMIN_ADD' or t.user_id = #userId#)
@}
3 years ago
getResourcesInfoValues
===
* 根据不为空的参数进行查询
select t.*
from resources_info t
where 1=1
@if(!isEmpty(resourcesInfoId)){
3 years ago
and t.resources_info_id =#resourcesInfoId#
@}
@if(!isEmpty(courseInfoId)){
3 years ago
and t.course_info_id =#courseInfoId#
@}
@if(!isEmpty(resourcesInfoName)){
3 years ago
and t.resources_info_name =#resourcesInfoName#
@}
@if(!isEmpty(resourcesInfoType)){
3 years ago
and t.resources_info_type =#resourcesInfoType#
@}
@if(!isEmpty(resourcesInfoContent)){
3 years ago
and t.resources_info_content =#resourcesInfoContent#
@}
@if(!isEmpty(orgId)){
3 years ago
and t.org_id =#orgId#
@}
2 years ago
@if(!isEmpty(addType)){
and t.add_type =#addType#
@}
@if(!isEmpty(userId)){
3 years ago
and t.user_id =#userId#
@}
2 years ago
getValuesByQuery
===
* 根据不为空的参数进行查询
select t.*
from resources_question t
where 1=1
@if(!isEmpty(resourcesQuestionId)){
and t.resources_question_id =#resourcesQuestionId#
@}
@if(!isEmpty(courseInfoId)){
and t.course_info_id =#courseInfoId#
@}
@if(!isEmpty(courseInfoIds)){
and find_in_set(t.course_info_id, #courseInfoIds#)
@}
@if(!isEmpty(questionType)){
and t.question_type =#questionType#
@}
@if(!isEmpty(questionScore)){
and t.question_score =#questionScore#
@}
@if(!isEmpty(questionStem)){
and t.question_stem =#questionStem#
@}
@if(!isEmpty(questionOptionA)){
and t.question_option_a =#questionOptionA#
@}
@if(!isEmpty(questionOptionB)){
and t.question_option_b =#questionOptionB#
@}
@if(!isEmpty(questionOptionC)){
and t.question_option_c =#questionOptionC#
@}
@if(!isEmpty(questionOptionD)){
and t.question_option_d =#questionOptionD#
@}
@if(!isEmpty(questionOptionE)){
and t.question_option_e =#questionOptionE#
@}
@if(!isEmpty(questionAnswer)){
and t.question_answer =#questionAnswer#
@}
@if(!isEmpty(questionAnalysis)){
and t.question_analysis =#questionAnalysis#
@}
@if(!isEmpty(questionStatus)){
and t.question_status =#questionStatus#
@}
@if(!isEmpty(orgId)){
and t.org_id =#orgId#
@}
@if(!isEmpty(userId)){
and t.user_id =#userId#
@}
@if(!isEmpty(addType)){
and t.add_type =#addType#
@}