Beetl工具包扩展

beetlsql3-dev
Mlxa0324 2 years ago
parent 18355fb691
commit c7cfbb102a

@ -1,26 +1,26 @@
package com.ibeetl.admin.core.util.beetl; //package com.ibeetl.admin.core.util.beetl;
//
import org.beetl.core.Context; //import org.beetl.core.Context;
import org.beetl.core.Function; //import org.beetl.core.Function;
import org.springframework.stereotype.Component; //import org.springframework.stereotype.Component;
//
/** ///**
* // * 忽略大小写的比较
*/ // */
@Component //@Component
public class EqualsIgnoreCaseFunction implements Function { //public class EqualsIgnoreCaseFunction implements Function {
//
@Override // @Override
public Object call(Object[] objects, Context context) { // public Object call(Object[] objects, Context context) {
try{ // try{
if(objects != null && objects.length == 2){ // if(objects != null && objects.length == 2){
String left = objects[0].toString(); // String left = objects[0].toString();
String right = objects[1].toString(); // String right = objects[1].toString();
return left.equalsIgnoreCase(right); // return left.equalsIgnoreCase(right);
} // }
}catch (Exception e){ // }catch (Exception e){
e.printStackTrace(); // e.printStackTrace();
} // }
return false; // return false;
} // }
} //}

@ -137,7 +137,7 @@ public class TeacherOpenCourseQuestionSetting extends BaseEntity {
// 关联的班级列表 // 关联的班级列表
@FetchSql("select \n" + @FetchSql("select \n" +
"@if(equalsIgnoreCase(teacherOpenCourseQuestionSettingId, 'ALL')) { \n" + "@if(strUtil.equalsIgnoreCase(teacherOpenCourseQuestionSettingId, 'ALL')) { \n" +
"'所有班级' \n" + "'所有班级' \n" +
"@} else { \n" + "@} else { \n" +
"group_concat(t.class_name) \n" + "group_concat(t.class_name) \n" +
@ -145,7 +145,7 @@ public class TeacherOpenCourseQuestionSetting extends BaseEntity {
"from school_class t where find_in_set(t.class_id, #teacherOpenCourseQuestionSettingSchoolClassIds#) \n" + "from school_class t where find_in_set(t.class_id, #teacherOpenCourseQuestionSettingSchoolClassIds#) \n" +
"and t.class_status = 1 \n" + "and t.class_status = 1 \n" +
// 像章节练习这块,是不关联班级的,可以理解只要是学生身份,且加入这个课程,就可以做题。这个时候,给默认的占位符 'ALL' 或者 'all' // 像章节练习这块,是不关联班级的,可以理解只要是学生身份,且加入这个课程,就可以做题。这个时候,给默认的占位符 'ALL' 或者 'all'
"@if(equalsIgnoreCase(teacherOpenCourseQuestionSettingId, 'ALL')) { \n" + "@if(strUtil.equalsIgnoreCase(teacherOpenCourseQuestionSettingId, 'ALL')) { \n" +
"and 1 != 1 \n" + "and 1 != 1 \n" +
"@} \n") "@} \n")
private String teacherOpenCourseQuestionSettingSchoolClassNames; private String teacherOpenCourseQuestionSettingSchoolClassNames;

@ -43,7 +43,7 @@ public class TeacherOpenCourseStudentSigninSetting extends BaseEntity{
} }
@FetchSql( @FetchSql(
"@if(equalsIgnoreCase(schoolClassIds, 'ALL')) { \n" + "@if(strUtil.equalsIgnoreCase(schoolClassIds, 'ALL')) { \n" +
"select '所有班级' \n" + "select '所有班级' \n" +
"@} else { \n" + "@} else { \n" +
" select group_concat(class_name) " + " select group_concat(class_name) " +

@ -26,6 +26,14 @@ FN.getCommentLimit= com.ibeetl.admin.core.util.beetl.CommentTimeLimit
FN.split= com.ibeetl.admin.core.util.beetl.SplitFunction FN.split= com.ibeetl.admin.core.util.beetl.SplitFunction
#\u6839\u636E\u64CD\u4F5C\u4EBA\u5458\u7684\u96C6\u56E2\u663E\u793A\u76F8\u5E94\u7684\u4F1A\u5458\u7B49\u7EA7 #\u6839\u636E\u64CD\u4F5C\u4EBA\u5458\u7684\u96C6\u56E2\u663E\u793A\u76F8\u5E94\u7684\u4F1A\u5458\u7B49\u7EA7
FN.rankJurisdiction= com.ibeetl.admin.core.util.beetl.RankJurisdictionFunction FN.rankJurisdiction= com.ibeetl.admin.core.util.beetl.RankJurisdictionFunction
#\u5FFD\u7565\u5927\u5C0F\u5199\u7684\u6BD4\u5BF9 #\u5FFD\u7565\u5927\u5C0F\u5199\u7684\u6BD4\u5BF9\uFF08\u4EA4\u7ED9strUtil\u5DE5\u5177\u5305\u5904\u7406\uFF09
FN.equalsIgnoreCase= com.ibeetl.admin.core.util.beetl.EqualsIgnoreCaseFunction #FN.equalsIgnoreCase= com.ibeetl.admin.core.util.beetl.EqualsIgnoreCaseFunction
##\u6269\u5C55\u7684\u529F\u80FD\u5305
#\u5B57\u7B26\u4E32\u5DE5\u5177\u7C7B
FNP.strUtil = cn.hutool.core.text.CharSequenceUtil
#\u5BF9\u8C61\u5DE5\u5177\u7C7B
FNP.objUtil = cn.hutool.core.util.ObjectUtil
#\u6B63\u5219\u5DE5\u5177\u7C7B
FNP.reUtil = cn.hutool.core.util.ReUtil
FNP.dateUtil =cn.hutool.core.date.DateUtil
Loading…
Cancel
Save