From ae062ccbc951f2d89a9b314d32eae4ce3addcdd2 Mon Sep 17 00:00:00 2001 From: Mlxa0324 Date: Thu, 20 Oct 2022 10:49:38 +0800 Subject: [PATCH] =?UTF-8?q?=E6=95=99=E5=B8=88=E5=85=B3=E8=81=94=E5=BA=94?= =?UTF-8?q?=E7=94=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../jlw/dao/TeacherMergeApplicationDao.java | 17 +- .../jlw/entity/TeacherMergeApplication.java | 60 ++- .../ibeetl/jlw/entity/TeacherOpenCourse.java | 8 +- .../TeacherMergeApplicationService.java | 13 +- .../TeacherMergeApplicationController.java | 34 +- .../jlw/web/TeacherOpenCourseController.java | 7 + .../query/TeacherMergeApplicationQuery.java | 15 +- .../sql/jlw/teacherMergeApplication.md | 449 ++++++++++-------- .../js/jlw/teacherMergeApplication/del.js | 4 +- .../js/jlw/teacherMergeApplication/edit.js | 2 +- .../js/jlw/teacherMergeApplication/index.js | 26 +- .../teacherMergeApplicationApi.js | 2 +- .../jlw/teacherMergeApplication/add.html | 20 +- .../jlw/teacherMergeApplication/edit.html | 20 +- .../jlw/teacherMergeApplication/index.html | 8 +- 15 files changed, 413 insertions(+), 272 deletions(-) diff --git a/web/src/main/java/com/ibeetl/jlw/dao/TeacherMergeApplicationDao.java b/web/src/main/java/com/ibeetl/jlw/dao/TeacherMergeApplicationDao.java index 3f845e6f..cad919b3 100644 --- a/web/src/main/java/com/ibeetl/jlw/dao/TeacherMergeApplicationDao.java +++ b/web/src/main/java/com/ibeetl/jlw/dao/TeacherMergeApplicationDao.java @@ -6,22 +6,21 @@ import org.beetl.sql.core.engine.PageQuery; import org.beetl.sql.mapper.BaseMapper; import org.beetl.sql.mapper.annotation.SqlResource; import org.beetl.sql.mapper.annotation.Update; -import org.springframework.stereotype.Repository; import java.util.List; - /** - * TeacherMergeApplication Dao + * 教师关联应用 Dao */ @SqlResource("jlw.teacherMergeApplication") public interface TeacherMergeApplicationDao extends BaseMapper{ - public PageQuery queryByCondition(PageQuery query); - public PageQuery queryByConditionQuery(PageQuery query); + PageQuery queryByCondition(PageQuery query); + PageQuery queryByConditionQuery(PageQuery query); @Update - public void deleteTeacherMergeApplicationByIds(String ids); + void deleteTeacherMergeApplicationByIds(String ids); @Update - public int updateGivenByIds(TeacherMergeApplicationQuery teacherMergeApplicationQuery); - public List getByIds(String ids); - public List getValuesByQuery(TeacherMergeApplicationQuery teacherMergeApplicationQuery); + int updateGivenByIds(TeacherMergeApplicationQuery teacherMergeApplicationQuery); + List getByIds(String ids); + List getValuesByQuery(TeacherMergeApplicationQuery teacherMergeApplicationQuery); + List getValuesByQueryNotWithPermission(TeacherMergeApplicationQuery teacherMergeApplicationQuery); } diff --git a/web/src/main/java/com/ibeetl/jlw/entity/TeacherMergeApplication.java b/web/src/main/java/com/ibeetl/jlw/entity/TeacherMergeApplication.java index 76d6332f..4faa266e 100644 --- a/web/src/main/java/com/ibeetl/jlw/entity/TeacherMergeApplication.java +++ b/web/src/main/java/com/ibeetl/jlw/entity/TeacherMergeApplication.java @@ -1,17 +1,20 @@ package com.ibeetl.jlw.entity; +import com.ibeetl.admin.core.annotation.Dict; import com.ibeetl.admin.core.entity.BaseEntity; import com.ibeetl.admin.core.util.ValidateConfig; import org.beetl.sql.annotation.entity.AssignID; -import org.beetl.sql.annotation.entity.SeqID; +import org.beetl.sql.fetch.annotation.Fetch; +import org.beetl.sql.fetch.annotation.FetchOne; import javax.validation.constraints.NotNull; import java.util.Date; -/* +/* * 教师-关联-我的应用 -* gen by Spring Boot2 Admin 2022-09-04 +* gen by Spring Boot2 Admin 2022-10-20 */ +@Fetch public class TeacherMergeApplication extends BaseEntity{ //教师-应用关联ID @@ -20,32 +23,41 @@ public class TeacherMergeApplication extends BaseEntity{ @AssignID(value = "maskAutoID",param = "com.ibeetl.jlw.entity.TeacherMergeApplication") private Long teacherMergeApplicationId ; - + //教师ID + @Dict(type="teacher.teacher_name.1=1") private Long teacherId ; - + //应用ID + @Dict(type="resources_application.resources_application_name.1=1") private Long applicationId ; + @FetchOne("applicationId") + private ResourcesApplication resourcesApplication; + + //排序 + + private Integer orderIndex ; + //组织ID private Long orgId ; - + //用户ID private Long userId ; - + //创建时间 private Date createTime ; - + public TeacherMergeApplication(){ } /**教师-应用关联ID - *@return + *@return */ public Long getTeacherMergeApplicationId(){ return teacherMergeApplicationId; @@ -58,7 +70,7 @@ public class TeacherMergeApplication extends BaseEntity{ } /**教师ID - *@return + *@return */ public Long getTeacherId(){ return teacherId; @@ -71,7 +83,7 @@ public class TeacherMergeApplication extends BaseEntity{ } /**应用ID - *@return + *@return */ public Long getApplicationId(){ return applicationId; @@ -83,8 +95,21 @@ public class TeacherMergeApplication extends BaseEntity{ this.applicationId = applicationId; } + /**排序 + *@return + */ + public Integer getOrderIndex(){ + return orderIndex; + } + /**排序 + *@param orderIndex + */ + public void setOrderIndex(Integer orderIndex){ + this.orderIndex = orderIndex; + } + /**组织ID - *@return + *@return */ public Long getOrgId(){ return orgId; @@ -97,7 +122,7 @@ public class TeacherMergeApplication extends BaseEntity{ } /**用户ID - *@return + *@return */ public Long getUserId(){ return userId; @@ -110,7 +135,7 @@ public class TeacherMergeApplication extends BaseEntity{ } /**创建时间 - *@return + *@return */ public Date getCreateTime(){ return createTime; @@ -123,4 +148,11 @@ public class TeacherMergeApplication extends BaseEntity{ } + public ResourcesApplication getResourcesApplication() { + return resourcesApplication; + } + + public void setResourcesApplication(ResourcesApplication resourcesApplication) { + this.resourcesApplication = resourcesApplication; + } } diff --git a/web/src/main/java/com/ibeetl/jlw/entity/TeacherOpenCourse.java b/web/src/main/java/com/ibeetl/jlw/entity/TeacherOpenCourse.java index f45108e6..d7c2f7c3 100644 --- a/web/src/main/java/com/ibeetl/jlw/entity/TeacherOpenCourse.java +++ b/web/src/main/java/com/ibeetl/jlw/entity/TeacherOpenCourse.java @@ -42,14 +42,18 @@ public class TeacherOpenCourse extends BaseEntity{ private Integer teacherOpenCourseStatus ; //教师ID(外表)可以直接使用。 + @Dict(type="teacher.teacher_name.teacher_status=1") @FetchSql("select teacher_id from teacher_open_course_merge_teacher t " + - "where t.teacher_open_course_id = #teacherOpenCourseId# and t.teacher_open_course_merge_teacher_status = 1") + "where t.teacher_open_course_id = #teacherOpenCourseId# and t.teacher_open_course_merge_teacher_status = 1 " + + "order by teacher_id limit 1 ") private Long teacherId ; // 开课授权码(外表)可以直接使用。 + @FetchSql("select teacher_open_course_merge_teacher_auth_code from teacher_open_course_merge_teacher t " + - "where t.teacher_open_course_id = #teacherOpenCourseId# and t.teacher_open_course_merge_teacher_status = 1") + "where t.teacher_open_course_id = #teacherOpenCourseId# and t.teacher_open_course_merge_teacher_status = 1 " + + "order by teacher_id limit 1 ") private String teacherOpenCourseMergeTeacherAuthCode ; //开课时间 diff --git a/web/src/main/java/com/ibeetl/jlw/service/TeacherMergeApplicationService.java b/web/src/main/java/com/ibeetl/jlw/service/TeacherMergeApplicationService.java index c22b11ce..1c43d1ce 100644 --- a/web/src/main/java/com/ibeetl/jlw/service/TeacherMergeApplicationService.java +++ b/web/src/main/java/com/ibeetl/jlw/service/TeacherMergeApplicationService.java @@ -15,19 +15,20 @@ import org.beetl.sql.core.SqlId; import org.beetl.sql.core.engine.PageQuery; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; +import org.springframework.validation.annotation.Validated; import javax.annotation.Resource; import java.util.ArrayList; import java.util.List; - /** - * TeacherMergeApplication Service + * 教师关联应用 Service * 当分布式ID开启后请勿使用insert(*,true) */ @Service @Transactional +@Validated public class TeacherMergeApplicationService extends CoreBaseService{ @Resource private TeacherMergeApplicationDao teacherMergeApplicationDao; @@ -59,7 +60,7 @@ public class TeacherMergeApplicationService extends CoreBaseService getValues (Object paras){ - return sqlManager.select(SqlId.of("jlw.teacherMergeApplication.getTeacherMergeApplicationValues"),TeacherMergeApplication.class,paras); + return sqlManager.select(SqlId.of("jlw.teacherMergeApplication.getTeacherMergeApplicationValues"), TeacherMergeApplication.class, paras); } public List getValuesByQuery (TeacherMergeApplicationQuery teacherMergeApplicationQuery){ return teacherMergeApplicationDao.getValuesByQuery(teacherMergeApplicationQuery); } + public List getValuesByQueryNotWithPermission (TeacherMergeApplicationQuery teacherMergeApplicationQuery){ + return teacherMergeApplicationDao.getValuesByQueryNotWithPermission(teacherMergeApplicationQuery); + } + public TeacherMergeApplication getInfo (Long teacherMergeApplicationId){ TeacherMergeApplicationQuery teacherMergeApplicationQuery = new TeacherMergeApplicationQuery(); teacherMergeApplicationQuery.setTeacherMergeApplicationId(teacherMergeApplicationId); diff --git a/web/src/main/java/com/ibeetl/jlw/web/TeacherMergeApplicationController.java b/web/src/main/java/com/ibeetl/jlw/web/TeacherMergeApplicationController.java index 42b38a81..1d10237e 100644 --- a/web/src/main/java/com/ibeetl/jlw/web/TeacherMergeApplicationController.java +++ b/web/src/main/java/com/ibeetl/jlw/web/TeacherMergeApplicationController.java @@ -13,23 +13,24 @@ import org.apache.commons.lang3.StringUtils; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.beetl.sql.core.engine.PageQuery; -import org.springframework.stereotype.Controller; import org.springframework.validation.BindingResult; import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.ResponseBody; +import org.springframework.web.bind.annotation.RestController; import org.springframework.web.servlet.ModelAndView; import javax.annotation.Resource; import java.util.List; /** - * TeacherMergeApplication 教师-关联-我的应用 接口 + * 教师关联应用 教师-关联-我的应用 接口 * 切记不要对非线程安全的静态变量进行写操作 */ -@Controller +@RestController +@Validated public class TeacherMergeApplicationController{ private final Log log = LogFactory.getLog(this.getClass()); @@ -39,13 +40,11 @@ public class TeacherMergeApplicationController{ @Resource private TeacherMergeApplicationService teacherMergeApplicationService; - @Resource - FileService fileService; + @Resource FileService fileService; /* 前端接口 */ @PostMapping(API + "/getPageList.do") - @ResponseBody public JsonResult getPageList(TeacherMergeApplicationQuery condition,@SCoreUser CoreUser coreUser){ if(null == coreUser){ return JsonResult.failMessage("请登录后再操作"); @@ -58,7 +57,6 @@ public class TeacherMergeApplicationController{ @GetMapping(API + "/getInfo.do") - @ResponseBody public JsonResultgetInfo(TeacherMergeApplicationQuery param,@SCoreUser CoreUser coreUser) { if(null == coreUser){ return JsonResult.failMessage("请登录后再操作"); @@ -70,7 +68,6 @@ public class TeacherMergeApplicationController{ @GetMapping(API + "/getList.do") - @ResponseBody public JsonResult>getList(TeacherMergeApplicationQuery param,@SCoreUser CoreUser coreUser) { if(null == coreUser){ return JsonResult.failMessage("请登录后再操作"); @@ -85,7 +82,6 @@ public class TeacherMergeApplicationController{ @GetMapping(MODEL + "/index.do") @Function("teacherMergeApplication.query") - @ResponseBody public ModelAndView index() { ModelAndView view = new ModelAndView("/jlw/teacherMergeApplication/index.html") ; view.addObject("search", TeacherMergeApplicationQuery.class.getName()); @@ -94,7 +90,6 @@ public class TeacherMergeApplicationController{ @GetMapping(MODEL + "/edit.do") @Function("teacherMergeApplication.edit") - @ResponseBody public ModelAndView edit(Long teacherMergeApplicationId) { ModelAndView view = new ModelAndView("/jlw/teacherMergeApplication/edit.html"); TeacherMergeApplication teacherMergeApplication = teacherMergeApplicationService.queryById(teacherMergeApplicationId); @@ -104,7 +99,6 @@ public class TeacherMergeApplicationController{ @GetMapping(MODEL + "/add.do") @Function("teacherMergeApplication.add") - @ResponseBody public ModelAndView add(Long teacherMergeApplicationId) { ModelAndView view = new ModelAndView("/jlw/teacherMergeApplication/add.html"); if(null != teacherMergeApplicationId){ @@ -120,7 +114,6 @@ public class TeacherMergeApplicationController{ @PostMapping(MODEL + "/list.json") @Function("teacherMergeApplication.query") - @ResponseBody public JsonResult list(TeacherMergeApplicationQuery condition){ PageQuery page = condition.getPageQuery(); teacherMergeApplicationService.queryByCondition(page); @@ -129,13 +122,12 @@ public class TeacherMergeApplicationController{ @PostMapping(MODEL + "/addAll.json") @Function("teacherMergeApplication.add") - @ResponseBody public JsonResult addAll(TeacherMergeApplicationQuery teacherMergeApplicationQuery,@SCoreUser CoreUser coreUser){ if(null == coreUser){ return JsonResult.failMessage("请登录后再操作"); }else{ - teacherMergeApplicationQuery.setUserId(coreUser.getId()); - teacherMergeApplicationQuery.setOrgId(coreUser.getOrgId()); + teacherMergeApplicationQuery.setUserId(coreUser.getId()); + teacherMergeApplicationQuery.setOrgId(coreUser.getOrgId()); String msg = teacherMergeApplicationService.addAll(teacherMergeApplicationQuery); if (StringUtils.isBlank(msg)) { return JsonResult.success(); @@ -147,26 +139,24 @@ public class TeacherMergeApplicationController{ @PostMapping(MODEL + "/add.json") @Function("teacherMergeApplication.add") - @ResponseBody public JsonResult add(@Validated(ValidateConfig.ADD.class) TeacherMergeApplicationQuery teacherMergeApplicationQuery, BindingResult result,@SCoreUser CoreUser coreUser){ if(result.hasErrors()){ return JsonResult.failMessage(result); }else{ - teacherMergeApplicationQuery.setUserId(coreUser.getId()); - teacherMergeApplicationQuery.setOrgId(coreUser.getOrgId()); + teacherMergeApplicationQuery.setUserId(coreUser.getId()); + teacherMergeApplicationQuery.setOrgId(coreUser.getOrgId()); return teacherMergeApplicationService.add(teacherMergeApplicationQuery); } } @PostMapping(MODEL + "/edit.json") @Function("teacherMergeApplication.edit") - @ResponseBody public JsonResult update(@Validated(ValidateConfig.UPDATE.class) TeacherMergeApplicationQuery teacherMergeApplicationQuery, BindingResult result) { if(result.hasErrors()){ return JsonResult.failMessage(result); }else { - teacherMergeApplicationQuery.setUserId(null); - teacherMergeApplicationQuery.setOrgId(null); + teacherMergeApplicationQuery.setUserId(null); + teacherMergeApplicationQuery.setOrgId(null); String msg = teacherMergeApplicationService.edit(teacherMergeApplicationQuery); if (StringUtils.isBlank(msg)) { return JsonResult.success(); @@ -179,7 +169,6 @@ public class TeacherMergeApplicationController{ @GetMapping(MODEL + "/view.json") @Function("teacherMergeApplication.query") - @ResponseBody public JsonResultqueryInfo(Long teacherMergeApplicationId) { TeacherMergeApplication teacherMergeApplication = teacherMergeApplicationService.queryById( teacherMergeApplicationId); return JsonResult.success(teacherMergeApplication); @@ -187,7 +176,6 @@ public class TeacherMergeApplicationController{ @GetMapping(MODEL + "/getValues.json") @Function("teacherMergeApplication.query") - @ResponseBody public JsonResult>getValues(TeacherMergeApplicationQuery param) { Listlist = teacherMergeApplicationService.getValuesByQuery(param); return JsonResult.success(list); diff --git a/web/src/main/java/com/ibeetl/jlw/web/TeacherOpenCourseController.java b/web/src/main/java/com/ibeetl/jlw/web/TeacherOpenCourseController.java index 24ea9abe..1bcae0ad 100644 --- a/web/src/main/java/com/ibeetl/jlw/web/TeacherOpenCourseController.java +++ b/web/src/main/java/com/ibeetl/jlw/web/TeacherOpenCourseController.java @@ -122,6 +122,13 @@ public class TeacherOpenCourseController{ /* 后台接口 */ + /** + * 教师端-我的课程 + * 等其他条件查询 + * + * @param condition + * @return + */ @PostMapping(MODEL + "/list.json") @Function("teacherOpenCourse.query") @ResponseBody diff --git a/web/src/main/java/com/ibeetl/jlw/web/query/TeacherMergeApplicationQuery.java b/web/src/main/java/com/ibeetl/jlw/web/query/TeacherMergeApplicationQuery.java index 242590ee..36127d02 100644 --- a/web/src/main/java/com/ibeetl/jlw/web/query/TeacherMergeApplicationQuery.java +++ b/web/src/main/java/com/ibeetl/jlw/web/query/TeacherMergeApplicationQuery.java @@ -9,16 +9,18 @@ import javax.validation.constraints.NotNull; import java.util.Date; /** - *TeacherMergeApplication查询 + *教师关联应用查询 */ public class TeacherMergeApplicationQuery extends PageParam { @NotNull(message = "ID不能为空", groups =ValidateConfig.UPDATE.class) @Query(name = "教师-应用关联ID", display = false) private Long teacherMergeApplicationId; - @Query(name = "教师ID", display = true) + @Query(name = "教师ID", display = true,type=Query.TYPE_DICT,dict="teacher.teacher_name.1=1") private Long teacherId; - @Query(name = "应用ID", display = true) + @Query(name = "应用ID", display = true,type=Query.TYPE_DICT,dict="resources_application.resources_application_name.1=1") private Long applicationId; + @Query(name = "排序", display = false) + private Integer orderIndex; @Query(name = "组织ID", display = false) private Long orgId; @Query(name = "用户ID", display = false) @@ -54,6 +56,12 @@ public class TeacherMergeApplicationQuery extends PageParam { public void setApplicationId(Long applicationId ){ this.applicationId = applicationId; } + public Integer getOrderIndex(){ + return orderIndex; + } + public void setOrderIndex(Integer orderIndex ){ + this.orderIndex = orderIndex; + } public Long getOrgId(){ return orgId; } @@ -78,6 +86,7 @@ public class TeacherMergeApplicationQuery extends PageParam { pojo.setTeacherMergeApplicationId(this.getTeacherMergeApplicationId()); pojo.setTeacherId(this.getTeacherId()); pojo.setApplicationId(this.getApplicationId()); + pojo.setOrderIndex(this.getOrderIndex()); pojo.setOrgId(this.getOrgId()); pojo.setUserId(this.getUserId()); pojo.setCreateTime(this.getCreateTime()); diff --git a/web/src/main/resources/sql/jlw/teacherMergeApplication.md b/web/src/main/resources/sql/jlw/teacherMergeApplication.md index 44561a4e..ec04d65c 100644 --- a/web/src/main/resources/sql/jlw/teacherMergeApplication.md +++ b/web/src/main/resources/sql/jlw/teacherMergeApplication.md @@ -2,109 +2,115 @@ queryByCondition === * 根据不为空的参数进行分页查询 - select - @pageTag(){ - t.* - @} - from teacher_merge_application t - where 1=1 - @//数据权限,该sql语句功能点,如果不考虑数据权限,可以删除此行 - and #function("teacherMergeApplication.query")# - @if(!isEmpty(teacherMergeApplicationId)){ - and t.teacher_merge_application_id =#teacherMergeApplicationId# - @} - @if(!isEmpty(teacherMergeApplicationIdPlural)){ - and find_in_set(t.teacher_merge_application_id,#teacherMergeApplicationIdPlural#) - @} - @if(!isEmpty(teacherId)){ - and t.teacher_id =#teacherId# - @} - @if(!isEmpty(teacherIdPlural)){ - and find_in_set(t.teacher_id,#teacherIdPlural#) - @} - @if(!isEmpty(applicationId)){ - and t.application_id =#applicationId# - @} - @if(!isEmpty(applicationIdPlural)){ - and find_in_set(t.application_id,#applicationIdPlural#) - @} - @if(!isEmpty(orgId)){ - and t.org_id =#orgId# - @} - @if(!isEmpty(orgIdPlural)){ - and find_in_set(t.org_id,#orgIdPlural#) - @} - @if(!isEmpty(userId)){ - and t.user_id =#userId# - @} - @if(!isEmpty(userIdPlural)){ - and find_in_set(t.user_id,#userIdPlural#) - @} - @if(!isEmpty(createTime)){ - and t.create_time =#createTime# - @} - - + select + @pageTag(){ + t.* + @} + from teacher_merge_application t + where 1=1 + @//数据权限,该sql语句功能点,如果不考虑数据权限,可以删除此行 + and #function("teacherMergeApplication.query")# + @if(!isEmpty(teacherMergeApplicationId)){ + and t.teacher_merge_application_id =#teacherMergeApplicationId# + @} + @if(!isEmpty(teacherMergeApplicationIdPlural)){ + and find_in_set(t.teacher_merge_application_id,#teacherMergeApplicationIdPlural#) + @} + @if(!isEmpty(teacherId)){ + and t.teacher_id =#teacherId# + @} + @if(!isEmpty(teacherIdPlural)){ + and find_in_set(t.teacher_id,#teacherIdPlural#) + @} + @if(!isEmpty(applicationId)){ + and t.application_id =#applicationId# + @} + @if(!isEmpty(applicationIdPlural)){ + and find_in_set(t.application_id,#applicationIdPlural#) + @} + @if(!isEmpty(orderIndex)){ + and t.order_index =#orderIndex# + @} + @if(!isEmpty(orgId)){ + and t.org_id =#orgId# + @} + @if(!isEmpty(orgIdPlural)){ + and find_in_set(t.org_id,#orgIdPlural#) + @} + @if(!isEmpty(userId)){ + and t.user_id =#userId# + @} + @if(!isEmpty(userIdPlural)){ + and find_in_set(t.user_id,#userIdPlural#) + @} + @if(!isEmpty(createTime)){ + and t.create_time =#createTime# + @} + + queryByConditionQuery === * 根据不为空的参数进行分页查询(无权限) - select - @pageTag(){ - t.* - @} - from teacher_merge_application t - where 1=1 - @if(!isEmpty(teacherMergeApplicationId)){ - and t.teacher_merge_application_id =#teacherMergeApplicationId# - @} - @if(!isEmpty(teacherMergeApplicationIdPlural)){ - and find_in_set(t.teacher_merge_application_id,#teacherMergeApplicationIdPlural#) - @} - @if(!isEmpty(teacherId)){ - and t.teacher_id =#teacherId# - @} - @if(!isEmpty(teacherIdPlural)){ - and find_in_set(t.teacher_id,#teacherIdPlural#) - @} - @if(!isEmpty(applicationId)){ - and t.application_id =#applicationId# - @} - @if(!isEmpty(applicationIdPlural)){ - and find_in_set(t.application_id,#applicationIdPlural#) - @} - @if(!isEmpty(orgId)){ - and t.org_id =#orgId# - @} - @if(!isEmpty(orgIdPlural)){ - and find_in_set(t.org_id,#orgIdPlural#) - @} - @if(!isEmpty(userId)){ - and t.user_id =#userId# - @} - @if(!isEmpty(userIdPlural)){ - and find_in_set(t.user_id,#userIdPlural#) - @} - @if(!isEmpty(createTime)){ - and t.create_time =#createTime# - @} - - - + select + @pageTag(){ + t.* + @} + from teacher_merge_application t + where 1=1 + @if(!isEmpty(teacherMergeApplicationId)){ + and t.teacher_merge_application_id =#teacherMergeApplicationId# + @} + @if(!isEmpty(teacherMergeApplicationIdPlural)){ + and find_in_set(t.teacher_merge_application_id,#teacherMergeApplicationIdPlural#) + @} + @if(!isEmpty(teacherId)){ + and t.teacher_id =#teacherId# + @} + @if(!isEmpty(teacherIdPlural)){ + and find_in_set(t.teacher_id,#teacherIdPlural#) + @} + @if(!isEmpty(applicationId)){ + and t.application_id =#applicationId# + @} + @if(!isEmpty(applicationIdPlural)){ + and find_in_set(t.application_id,#applicationIdPlural#) + @} + @if(!isEmpty(orderIndex)){ + and t.order_index =#orderIndex# + @} + @if(!isEmpty(orgId)){ + and t.org_id =#orgId# + @} + @if(!isEmpty(orgIdPlural)){ + and find_in_set(t.org_id,#orgIdPlural#) + @} + @if(!isEmpty(userId)){ + and t.user_id =#userId# + @} + @if(!isEmpty(userIdPlural)){ + and find_in_set(t.user_id,#userIdPlural#) + @} + @if(!isEmpty(createTime)){ + and t.create_time =#createTime# + @} + + + deleteTeacherMergeApplicationByIds === * 批量删除 - delete from teacher_merge_application where find_in_set(teacher_merge_application_id,#ids#) - + delete from teacher_merge_application where find_in_set(teacher_merge_application_id,#ids#) + getByIds === - select * from teacher_merge_application where find_in_set(teacher_merge_application_id,#ids#) +select * from teacher_merge_application where find_in_set(teacher_merge_application_id,#ids#) updateGivenByIds @@ -112,117 +118,176 @@ updateGivenByIds * 批量更新指定字段,无论此字段是否有值 - update teacher_merge_application - set - @if(contain("teacherId",_given)){ - @if(isEmpty(teacherId)){ - teacher_id = null , - @}else{ - teacher_id = #teacherId# , - @} - @} - @if(contain("applicationId",_given)){ - @if(isEmpty(applicationId)){ - application_id = null , - @}else{ - application_id = #applicationId# , - @} - @} - @if(contain("orgId",_given)){ - @if(isEmpty(orgId)){ - org_id = null , - @}else{ - org_id = #orgId# , - @} - @} - @if(contain("userId",_given)){ - @if(isEmpty(userId)){ - user_id = null , - @}else{ - user_id = #userId# , - @} - @} - @if(contain("createTime",_given)){ - @if(isEmpty(createTime)){ - create_time = null , - @}else{ - create_time = #createTime# , - @} - @} - teacher_merge_application_id = teacher_merge_application_id - where find_in_set(teacher_merge_application_id,#teacherMergeApplicationIdPlural#) - - - + update teacher_merge_application + set + @if(contain("teacherId",_given)){ + @if(isEmpty(teacherId)){ + teacher_id = null , + @}else{ + teacher_id = #teacherId# , + @} + @} + @if(contain("applicationId",_given)){ + @if(isEmpty(applicationId)){ + application_id = null , + @}else{ + application_id = #applicationId# , + @} + @} + @if(contain("orderIndex",_given)){ + @if(isEmpty(orderIndex)){ + order_index = null , + @}else{ + order_index = #orderIndex# , + @} + @} + @if(contain("orgId",_given)){ + @if(isEmpty(orgId)){ + org_id = null , + @}else{ + org_id = #orgId# , + @} + @} + @if(contain("userId",_given)){ + @if(isEmpty(userId)){ + user_id = null , + @}else{ + user_id = #userId# , + @} + @} + @if(contain("createTime",_given)){ + @if(isEmpty(createTime)){ + create_time = null , + @}else{ + create_time = #createTime# , + @} + @} + teacher_merge_application_id = teacher_merge_application_id + where find_in_set(teacher_merge_application_id,#teacherMergeApplicationIdPlural#) + + + getTeacherMergeApplicationValues === * 根据不为空的参数进行查询 - select t.* - from teacher_merge_application t - where 1=1 - @if(!isEmpty(teacherMergeApplicationId)){ - and t.teacher_merge_application_id =#teacherMergeApplicationId# - @} - @if(!isEmpty(teacherId)){ - and t.teacher_id =#teacherId# - @} - @if(!isEmpty(applicationId)){ - and t.application_id =#applicationId# - @} - @if(!isEmpty(orgId)){ - and t.org_id =#orgId# - @} - @if(!isEmpty(userId)){ - and t.user_id =#userId# - @} - @if(!isEmpty(createTime)){ - and t.create_time =#createTime# - @} - - + select t.* + from teacher_merge_application t + where 1=1 + @if(!isEmpty(teacherMergeApplicationId)){ + and t.teacher_merge_application_id =#teacherMergeApplicationId# + @} + @if(!isEmpty(teacherId)){ + and t.teacher_id =#teacherId# + @} + @if(!isEmpty(applicationId)){ + and t.application_id =#applicationId# + @} + @if(!isEmpty(orderIndex)){ + and t.order_index =#orderIndex# + @} + @if(!isEmpty(orgId)){ + and t.org_id =#orgId# + @} + @if(!isEmpty(userId)){ + and t.user_id =#userId# + @} + @if(!isEmpty(createTime)){ + and t.create_time =#createTime# + @} + + getValuesByQuery === * 根据不为空的参数进行查询 - select t.* - from teacher_merge_application t - where 1=1 and #function("teacherMergeApplication.query")# - @if(!isEmpty(teacherMergeApplicationId)){ - and t.teacher_merge_application_id =#teacherMergeApplicationId# - @} - @if(!isEmpty(teacherMergeApplicationIdPlural)){ - and find_in_set(t.teacher_merge_application_id,#teacherMergeApplicationIdPlural#) - @} - @if(!isEmpty(teacherId)){ - and t.teacher_id =#teacherId# - @} - @if(!isEmpty(teacherIdPlural)){ - and find_in_set(t.teacher_id,#teacherIdPlural#) - @} - @if(!isEmpty(applicationId)){ - and t.application_id =#applicationId# - @} - @if(!isEmpty(applicationIdPlural)){ - and find_in_set(t.application_id,#applicationIdPlural#) - @} - @if(!isEmpty(orgId)){ - and t.org_id =#orgId# - @} - @if(!isEmpty(orgIdPlural)){ - and find_in_set(t.org_id,#orgIdPlural#) - @} - @if(!isEmpty(userId)){ - and t.user_id =#userId# - @} - @if(!isEmpty(userIdPlural)){ - and find_in_set(t.user_id,#userIdPlural#) - @} - @if(!isEmpty(createTime)){ - and t.create_time =#createTime# - @} - - - + select t.* + from teacher_merge_application t + where 1=1 and #function("teacherMergeApplication.query")# + @if(!isEmpty(teacherMergeApplicationId)){ + and t.teacher_merge_application_id =#teacherMergeApplicationId# + @} + @if(!isEmpty(teacherMergeApplicationIdPlural)){ + and find_in_set(t.teacher_merge_application_id,#teacherMergeApplicationIdPlural#) + @} + @if(!isEmpty(teacherId)){ + and t.teacher_id =#teacherId# + @} + @if(!isEmpty(teacherIdPlural)){ + and find_in_set(t.teacher_id,#teacherIdPlural#) + @} + @if(!isEmpty(applicationId)){ + and t.application_id =#applicationId# + @} + @if(!isEmpty(applicationIdPlural)){ + and find_in_set(t.application_id,#applicationIdPlural#) + @} + @if(!isEmpty(orderIndex)){ + and t.order_index =#orderIndex# + @} + @if(!isEmpty(orgId)){ + and t.org_id =#orgId# + @} + @if(!isEmpty(orgIdPlural)){ + and find_in_set(t.org_id,#orgIdPlural#) + @} + @if(!isEmpty(userId)){ + and t.user_id =#userId# + @} + @if(!isEmpty(userIdPlural)){ + and find_in_set(t.user_id,#userIdPlural#) + @} + @if(!isEmpty(createTime)){ + and t.create_time =#createTime# + @} + + +getValuesByQueryNotWithPermission +=== + +* 根据不为空的参数进行查询(不包含权限) + + select t.* + from teacher_merge_application t + where 1=1 + @if(!isEmpty(teacherMergeApplicationId)){ + and t.teacher_merge_application_id =#teacherMergeApplicationId# + @} + @if(!isEmpty(teacherMergeApplicationIdPlural)){ + and find_in_set(t.teacher_merge_application_id,#teacherMergeApplicationIdPlural#) + @} + @if(!isEmpty(teacherId)){ + and t.teacher_id =#teacherId# + @} + @if(!isEmpty(teacherIdPlural)){ + and find_in_set(t.teacher_id,#teacherIdPlural#) + @} + @if(!isEmpty(applicationId)){ + and t.application_id =#applicationId# + @} + @if(!isEmpty(applicationIdPlural)){ + and find_in_set(t.application_id,#applicationIdPlural#) + @} + @if(!isEmpty(orderIndex)){ + and t.order_index =#orderIndex# + @} + @if(!isEmpty(orgId)){ + and t.org_id =#orgId# + @} + @if(!isEmpty(orgIdPlural)){ + and find_in_set(t.org_id,#orgIdPlural#) + @} + @if(!isEmpty(userId)){ + and t.user_id =#userId# + @} + @if(!isEmpty(userIdPlural)){ + and find_in_set(t.user_id,#userIdPlural#) + @} + @if(!isEmpty(createTime)){ + and t.create_time =#createTime# + @} + + + diff --git a/web/src/main/resources/static/js/jlw/teacherMergeApplication/del.js b/web/src/main/resources/static/js/jlw/teacherMergeApplication/del.js index 0581feb9..44e1d30f 100644 --- a/web/src/main/resources/static/js/jlw/teacherMergeApplication/del.js +++ b/web/src/main/resources/static/js/jlw/teacherMergeApplication/del.js @@ -9,7 +9,7 @@ layui.define(['table', 'teacherMergeApplicationApi'], function(exports) { if(data==null){ return ; } - Common.openConfirm("确认要删除这些TeacherMergeApplication?",function(){ + Common.openConfirm("确认要删除这些教师关联应用?",function(){ var ids =Common.concatBatchId(data,"teacherMergeApplicationId"); teacherMergeApplicationApi.del(ids,function(){ Common.info("删除成功"); @@ -20,4 +20,4 @@ layui.define(['table', 'teacherMergeApplicationApi'], function(exports) { } exports('del',view); -}); +}); \ No newline at end of file diff --git a/web/src/main/resources/static/js/jlw/teacherMergeApplication/edit.js b/web/src/main/resources/static/js/jlw/teacherMergeApplication/edit.js index 5731426d..84ad8c8b 100644 --- a/web/src/main/resources/static/js/jlw/teacherMergeApplication/edit.js +++ b/web/src/main/resources/static/js/jlw/teacherMergeApplication/edit.js @@ -25,4 +25,4 @@ layui.define([ 'form', 'laydate', 'table','teacherMergeApplicationApi'], functio } exports('edit',view); -}); +}); \ No newline at end of file diff --git a/web/src/main/resources/static/js/jlw/teacherMergeApplication/index.js b/web/src/main/resources/static/js/jlw/teacherMergeApplication/index.js index 4a83c99a..be069690 100644 --- a/web/src/main/resources/static/js/jlw/teacherMergeApplication/index.js +++ b/web/src/main/resources/static/js/jlw/teacherMergeApplication/index.js @@ -5,11 +5,13 @@ layui.define([ 'form', 'laydate', 'table' ], function(exports) { var teacherMergeApplicationTable = null; var view ={ init:function(){ + var that = this this.initTable(); this.initSearchForm(); this.initToolBar(); window.dataReload = function(){ Lib.doSearchForm($("#searchForm"),teacherMergeApplicationTable) + that.initToolBar(); } }, initTable:function(){ @@ -40,18 +42,25 @@ layui.define([ 'form', 'laydate', 'table' ], function(exports) { width : 60, }, { - field : 'teacherId', + field : 'teacherIdText', //数据字典类型为 teacher.teacher_name.1=1 title : '教师ID', align:"center", hideField :false, - hide:$.isEmpty(sx_['teacherId'])?false:sx_['teacherId'], + hide:$.isEmpty(sx_['teacherIdText'])?false:sx_['teacherIdText'], }, { - field : 'applicationId', + field : 'applicationIdText', //数据字典类型为 resources_application.resources_application_name.1=1 title : '应用ID', align:"center", hideField :false, - hide:$.isEmpty(sx_['applicationId'])?false:sx_['applicationId'], + hide:$.isEmpty(sx_['applicationIdText'])?false:sx_['applicationIdText'], + }, + { + field : 'orderIndex', + title : '排序', + align:"center", + hideField :false, + hide:$.isEmpty(sx_['orderIndex'])?false:sx_['orderIndex'], }, { field : 'orgId', @@ -104,7 +113,7 @@ layui.define([ 'form', 'laydate', 'table' ], function(exports) { toolbar = { add: function () { var url = "/jlw/teacherMergeApplication/add.do"; - Common.openDlg(url,"TeacherMergeApplication管理>新增"); + Common.openDlg(url,"教师关联应用管理>新增"); }, edit: function () { var data = Common.getOneFromTable(table,"teacherMergeApplicationTable"); @@ -112,7 +121,7 @@ layui.define([ 'form', 'laydate', 'table' ], function(exports) { return ; } var url = "/jlw/teacherMergeApplication/add.do?teacherMergeApplicationId="+data.teacherMergeApplicationId; - Common.openDlg(url,"TeacherMergeApplication管理>"+data.teacherMergeApplicationId+">编辑"); + Common.openDlg(url,"教师关联应用管理>"+data.teacherMergeApplicationId+">编辑"); }, del: function () { layui.use(['del'], function(){ @@ -122,10 +131,12 @@ layui.define([ 'form', 'laydate', 'table' ], function(exports) { }, search: function () { Lib.doSearchForm($("#searchForm"), teacherMergeApplicationTable, 1); + view.initToolBar() }, refresh: function () { searchForm.reset(); Lib.doSearchForm($("#searchForm"), teacherMergeApplicationTable, 1); + view.initToolBar() }, } //触发事件 @@ -133,11 +144,12 @@ layui.define([ 'form', 'laydate', 'table' ], function(exports) { var type = $(this).data('type'); toolbar[type] ? toolbar[type].call(this) : ''; }); + }, initTableTool: table.on('tool(teacherMergeApplicationTable)', function (obj) { var data = obj.data; if (obj.event === 'edit') { var url = "/jlw/teacherMergeApplication/add.do?teacherMergeApplicationId="+data.teacherMergeApplicationId; - Common.openDlg(url,"TeacherMergeApplication管理>"+data.teacherMergeApplicationId+">编辑"); + Common.openDlg(url,"教师关联应用管理>"+data.teacherMergeApplicationId+">编辑"); }else if(obj.event === "del"){ layer.confirm('是否确定删除该信息?', function (index) { var ret = Common.postAjax("/jlw/teacherMergeApplication/delete.json",{ids:data.teacherMergeApplicationId}); diff --git a/web/src/main/resources/static/js/jlw/teacherMergeApplication/teacherMergeApplicationApi.js b/web/src/main/resources/static/js/jlw/teacherMergeApplication/teacherMergeApplicationApi.js index a1675e4f..d501464c 100644 --- a/web/src/main/resources/static/js/jlw/teacherMergeApplication/teacherMergeApplicationApi.js +++ b/web/src/main/resources/static/js/jlw/teacherMergeApplication/teacherMergeApplicationApi.js @@ -15,4 +15,4 @@ layui.define([], function(exports) { }; exports('teacherMergeApplicationApi',api); -}); +}); \ No newline at end of file diff --git a/web/src/main/resources/templates/jlw/teacherMergeApplication/add.html b/web/src/main/resources/templates/jlw/teacherMergeApplication/add.html index f8276a12..60b01125 100644 --- a/web/src/main/resources/templates/jlw/teacherMergeApplication/add.html +++ b/web/src/main/resources/templates/jlw/teacherMergeApplication/add.html @@ -6,13 +6,15 @@
- +
- +
@@ -20,21 +22,27 @@
- +
- +
- +
- +
+
+ +
+ +
+
diff --git a/web/src/main/resources/templates/jlw/teacherMergeApplication/edit.html b/web/src/main/resources/templates/jlw/teacherMergeApplication/edit.html index 0dc8b049..aae3c048 100644 --- a/web/src/main/resources/templates/jlw/teacherMergeApplication/edit.html +++ b/web/src/main/resources/templates/jlw/teacherMergeApplication/edit.html @@ -6,13 +6,15 @@
- +
- +
@@ -20,21 +22,27 @@
- +
- +
- +
- +
+
+ +
+ +
+
diff --git a/web/src/main/resources/templates/jlw/teacherMergeApplication/index.html b/web/src/main/resources/templates/jlw/teacherMergeApplication/index.html index 8cf45266..bb0c926d 100644 --- a/web/src/main/resources/templates/jlw/teacherMergeApplication/index.html +++ b/web/src/main/resources/templates/jlw/teacherMergeApplication/index.html @@ -7,11 +7,15 @@