教师关联应用

beetlsql3-dev
Mlxa0324 2 years ago
parent 8a1d020267
commit ae062ccbc9

@ -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<TeacherMergeApplication>{
public PageQuery<TeacherMergeApplication> queryByCondition(PageQuery query);
public PageQuery<TeacherMergeApplication> queryByConditionQuery(PageQuery query);
PageQuery<TeacherMergeApplication> queryByCondition(PageQuery query);
PageQuery<TeacherMergeApplication> queryByConditionQuery(PageQuery query);
@Update
public void deleteTeacherMergeApplicationByIds(String ids);
void deleteTeacherMergeApplicationByIds(String ids);
@Update
public int updateGivenByIds(TeacherMergeApplicationQuery teacherMergeApplicationQuery);
public List<TeacherMergeApplication> getByIds(String ids);
public List<TeacherMergeApplication> getValuesByQuery(TeacherMergeApplicationQuery teacherMergeApplicationQuery);
int updateGivenByIds(TeacherMergeApplicationQuery teacherMergeApplicationQuery);
List<TeacherMergeApplication> getByIds(String ids);
List<TeacherMergeApplication> getValuesByQuery(TeacherMergeApplicationQuery teacherMergeApplicationQuery);
List<TeacherMergeApplication> getValuesByQueryNotWithPermission(TeacherMergeApplicationQuery teacherMergeApplicationQuery);
}

@ -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;
}
}

@ -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 ;
//开课时间

@ -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<TeacherMergeApplication>{
@Resource private TeacherMergeApplicationDao teacherMergeApplicationDao;
@ -59,7 +60,7 @@ public class TeacherMergeApplicationService extends CoreBaseService<TeacherMerge
try {
teacherMergeApplicationDao.deleteTeacherMergeApplicationByIds(ids);
} catch (Exception e) {
throw new PlatformException("批量删除TeacherMergeApplication失败", e);
throw new PlatformException("批量删除教师关联应用失败", e);
}
}
@ -118,13 +119,17 @@ public class TeacherMergeApplicationService extends CoreBaseService<TeacherMerge
}
public List<TeacherMergeApplication> 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<TeacherMergeApplication> getValuesByQuery (TeacherMergeApplicationQuery teacherMergeApplicationQuery){
return teacherMergeApplicationDao.getValuesByQuery(teacherMergeApplicationQuery);
}
public List<TeacherMergeApplication> getValuesByQueryNotWithPermission (TeacherMergeApplicationQuery teacherMergeApplicationQuery){
return teacherMergeApplicationDao.getValuesByQueryNotWithPermission(teacherMergeApplicationQuery);
}
public TeacherMergeApplication getInfo (Long teacherMergeApplicationId){
TeacherMergeApplicationQuery teacherMergeApplicationQuery = new TeacherMergeApplicationQuery();
teacherMergeApplicationQuery.setTeacherMergeApplicationId(teacherMergeApplicationId);

@ -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<PageQuery> 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 JsonResult<TeacherMergeApplication>getInfo(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<List<TeacherMergeApplication>>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<PageQuery> 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<String> 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 JsonResult<TeacherMergeApplication>queryInfo(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<List<TeacherMergeApplication>>getValues(TeacherMergeApplicationQuery param) {
List<TeacherMergeApplication>list = teacherMergeApplicationService.getValuesByQuery(param);
return JsonResult.success(list);

@ -122,6 +122,13 @@ public class TeacherOpenCourseController{
/* 后台接口 */
/**
* -
*
*
* @param condition
* @return
*/
@PostMapping(MODEL + "/list.json")
@Function("teacherOpenCourse.query")
@ResponseBody

@ -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());

@ -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#
@}

@ -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);
});
});

@ -25,4 +25,4 @@ layui.define([ 'form', 'laydate', 'table','teacherMergeApplicationApi'], functio
}
exports('edit',view);
});
});

@ -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});

@ -15,4 +15,4 @@ layui.define([], function(exports) {
};
exports('teacherMergeApplicationApi',api);
});
});

@ -6,13 +6,15 @@
<div class="layui-inline">
<label class="layui-form-label">教师ID</label>
<div class="layui-input-inline">
<input type="text" id="teacherId" name="teacherId" value="${teacherMergeApplication.teacherId}" class="layui-input" >
<layui:simpleDictSelect style='layui-input-inline' type="teacher.teacher_name.1=1"
id="teacherId" name="teacherId" value="${teacherMergeApplication.teacherId}" layVerify="" />
</div>
</div>
<div class="layui-inline">
<label class="layui-form-label">应用ID</label>
<div class="layui-input-inline">
<input type="text" id="applicationId" name="applicationId" value="${teacherMergeApplication.applicationId}" class="layui-input" >
<layui:simpleDictSelect style='layui-input-inline' type="resources_application.resources_application_name.1=1"
id="applicationId" name="applicationId" value="${teacherMergeApplication.applicationId}" layVerify="" />
</div>
</div>
</div>
@ -20,21 +22,27 @@
<div class="layui-row">
<div class="layui-form-item">
<div class="layui-inline">
<label class="layui-form-label">组织ID</label>
<label class="layui-form-label">排序</label>
<div class="layui-input-inline">
<input type="text" id="orgId" name="orgId" value="${teacherMergeApplication.orgId}" class="layui-input" >
<input type="text" id="orderIndex" name="orderIndex" value="${teacherMergeApplication.orderIndex}" class="layui-input" >
</div>
</div>
<div class="layui-inline">
<label class="layui-form-label">用户ID</label>
<label class="layui-form-label">组织ID</label>
<div class="layui-input-inline">
<input type="text" id="userId" name="userId" value="${teacherMergeApplication.userId}" class="layui-input" >
<input type="text" id="orgId" name="orgId" value="${teacherMergeApplication.orgId}" class="layui-input" >
</div>
</div>
</div>
</div>
<div class="layui-row">
<div class="layui-form-item">
<div class="layui-inline">
<label class="layui-form-label">用户ID</label>
<div class="layui-input-inline">
<input type="text" id="userId" name="userId" value="${teacherMergeApplication.userId}" class="layui-input" >
</div>
</div>
<div class="layui-inline">
<label class="layui-form-label">创建时间</label>
<div class="layui-input-inline">

@ -6,13 +6,15 @@
<div class="layui-inline">
<label class="layui-form-label">教师ID</label>
<div class="layui-input-inline">
<input type="text" id="teacherId" name="teacherId" value="${teacherMergeApplication.teacherId}" class="layui-input" >
<layui:simpleDictSelect style='layui-input-inline' type="teacher.teacher_name.1=1"
id="teacherId" name="teacherId" value="${teacherMergeApplication.teacherId}" layVerify="" />
</div>
</div>
<div class="layui-inline">
<label class="layui-form-label">应用ID</label>
<div class="layui-input-inline">
<input type="text" id="applicationId" name="applicationId" value="${teacherMergeApplication.applicationId}" class="layui-input" >
<layui:simpleDictSelect style='layui-input-inline' type="resources_application.resources_application_name.1=1"
id="applicationId" name="applicationId" value="${teacherMergeApplication.applicationId}" layVerify="" />
</div>
</div>
</div>
@ -20,21 +22,27 @@
<div class="layui-row">
<div class="layui-form-item">
<div class="layui-inline">
<label class="layui-form-label">组织ID</label>
<label class="layui-form-label">排序</label>
<div class="layui-input-inline">
<input type="text" id="orgId" name="orgId" value="${teacherMergeApplication.orgId}" class="layui-input" >
<input type="text" id="orderIndex" name="orderIndex" value="${teacherMergeApplication.orderIndex}" class="layui-input" >
</div>
</div>
<div class="layui-inline">
<label class="layui-form-label">用户ID</label>
<label class="layui-form-label">组织ID</label>
<div class="layui-input-inline">
<input type="text" id="userId" name="userId" value="${teacherMergeApplication.userId}" class="layui-input" >
<input type="text" id="orgId" name="orgId" value="${teacherMergeApplication.orgId}" class="layui-input" >
</div>
</div>
</div>
</div>
<div class="layui-row">
<div class="layui-form-item">
<div class="layui-inline">
<label class="layui-form-label">用户ID</label>
<div class="layui-input-inline">
<input type="text" id="userId" name="userId" value="${teacherMergeApplication.userId}" class="layui-input" >
</div>
</div>
<div class="layui-inline">
<label class="layui-form-label">创建时间</label>
<div class="layui-input-inline">

@ -7,11 +7,15 @@
<script type="text/html" id="toolbar_teacherMergeApplication">
<div class="layui-btn-container">
<div class="layui-btn-group" >
<!-- <layui:accessButton function="teacherMergeApplication.query" id="searchFormSearch" action="search"><i class="layui-icon">&#xe615;</i>搜索</layui:accessButton>-->
<!--# if(core.searchIsShow(search)) {-->
<layui:accessButton function="teacherMergeApplication.query" id="searchFormSearch" action="search"><i class="layui-icon">&#xe615;</i>搜索</layui:accessButton>
<!--# }-->
<layui:accessButton function="teacherMergeApplication.add" action="add">添加</layui:accessButton>
<layui:accessButton function="teacherMergeApplication.edit" action="edit">修改</layui:accessButton>
<layui:accessButton function="teacherMergeApplication.del" action="del">删除</layui:accessButton>
<!-- <layui:accessButton function="teacherMergeApplication.query" action="refresh"><i class="layui-icon">&#xe669;</i>刷新</layui:accessButton>-->
<!--# if(!isEmpty(search)) {-->
<layui:accessButton function="teacherMergeApplication.query" action="refresh"><i class="layui-icon">&#xe669;</i>刷新</layui:accessButton>
<!--# }-->
</div>
</div>
</script>

Loading…
Cancel
Save