Commit 7d65f99c authored by hanshuai's avatar hanshuai

Merge branch 'V2.0.3' of ssh://103.249.252.28:10022/lcy/education

hanshuai
parent 4288e93d
...@@ -34,7 +34,7 @@ public class BAgencyController extends PaginationController<BAgency> { ...@@ -34,7 +34,7 @@ public class BAgencyController extends PaginationController<BAgency> {
@ApiOperation(value="添加教学单位", notes="添加教学单位") @ApiOperation(value="添加教学单位", notes="添加教学单位")
@ApiImplicitParams({@ApiImplicitParam(name = "code", value = "教学单位编号(1-50)", required = true, dataType = "varchar"), @ApiImplicitParams({@ApiImplicitParam(name = "code", value = "教学单位编号(1-50)", required = true, dataType = "varchar"),
@ApiImplicitParam(name = "name", value = "教学单位名(1-250)", required = true, dataType = "varchar")}) @ApiImplicitParam(name = "name", value = "教学单位名(1-100)", required = true, dataType = "varchar")})
@PostMapping(value = "/add") @PostMapping(value = "/add")
public Result add(@Valid @ApiIgnore BAgency bAgency, BindingResult bindingResult) { public Result add(@Valid @ApiIgnore BAgency bAgency, BindingResult bindingResult) {
PersistModel data = bAgencyServiceImpl.save(bAgency); PersistModel data = bAgencyServiceImpl.save(bAgency);
...@@ -56,10 +56,18 @@ public class BAgencyController extends PaginationController<BAgency> { ...@@ -56,10 +56,18 @@ public class BAgencyController extends PaginationController<BAgency> {
businessId); businessId);
} }
@ApiOperation(value="查询教学单位下是否有用户", notes="查询教学单位下是否有用户")
@GetMapping(value = "/selectBAgencyHaveUser")
public String HaveUserOrNot(@ApiIgnore BAgency bAgency) {
bAgency.setCreateBy(UserUtil.getUserInfoProp(getToken(), UserUtil.USER_ID));
String result = bAgencyServiceImpl.findBAgencyHaveUserOrNot(getPaginationUtility(), bAgency);
return result;
}
@ApiOperation(value="修改教学单位", notes="修改教学单位") @ApiOperation(value="修改教学单位", notes="修改教学单位")
@ApiImplicitParams({@ApiImplicitParam(name = "businessId", value = "businessId", required = true, dataType = "varchar"), @ApiImplicitParams({@ApiImplicitParam(name = "businessId", value = "businessId", required = true, dataType = "varchar"),
@ApiImplicitParam(name = "code", value = "教学单位编号(1-50)", required = true, dataType = "varchar"), @ApiImplicitParam(name = "code", value = "教学单位编号(1-50)", required = true, dataType = "varchar"),
@ApiImplicitParam(name = "name", value = "教学单位名(1-250)", required = true, dataType = "varchar")}) @ApiImplicitParam(name = "name", value = "教学单位名(1-100)", required = true, dataType = "varchar")})
@PutMapping("/update/{businessId:\\w+}") @PutMapping("/update/{businessId:\\w+}")
public Result update(@Valid @ApiIgnore BAgency bAgency, BindingResult bindingResult) { public Result update(@Valid @ApiIgnore BAgency bAgency, BindingResult bindingResult) {
PersistModel data = bAgencyServiceImpl.merge(bAgency); PersistModel data = bAgencyServiceImpl.merge(bAgency);
......
...@@ -60,5 +60,9 @@ public interface BAgencyRepository extends BaseMapper<BAgency> { ...@@ -60,5 +60,9 @@ public interface BAgencyRepository extends BaseMapper<BAgency> {
@Select("select * from b_agency where code = #{code} and del_flag = 0 and flag = 1") @Select("select * from b_agency where code = #{code} and del_flag = 0 and flag = 1")
@ResultMap(value = "BaseResultMap" ) @ResultMap(value = "BaseResultMap" )
List<BAgency> queryBAgencysByCode(String code); List<BAgency> queryBAgencysByCode(String code);
@Select("select * from b_agency where business_id = #{businessId} and del_flag = 0 and flag = 1")
@ResultMap(value = "BaseResultMap" )
BAgency selectOneBagency(String businessId);
} }
...@@ -29,7 +29,7 @@ public class BAgency extends IdEntity<BAgency> { ...@@ -29,7 +29,7 @@ public class BAgency extends IdEntity<BAgency> {
private String code; private String code;
/*代理商名*/ /*代理商名*/
@Length(min = 1, max = 256, message = "长度最小为1,最大为250") @Length(min = 1, max = 100, message = "长度最小为1,最大为250")
@NotBlank @NotBlank
private String name; private String name;
...@@ -39,5 +39,12 @@ public class BAgency extends IdEntity<BAgency> { ...@@ -39,5 +39,12 @@ public class BAgency extends IdEntity<BAgency> {
public BAgency(String code) { public BAgency(String code) {
this.code = code; this.code = code;
} }
// public BAgency(String businessId, String del_flag, String flag){
// this.businessId = businessId;
// this.delFlag = del_flag;
// this.flag = flag;
// }
} }
...@@ -48,6 +48,16 @@ public interface BAgencyService { ...@@ -48,6 +48,16 @@ public interface BAgencyService {
BAgency bAgency); BAgency bAgency);
/**
* 查询教学单位下是否有用户
* @param paginationUtility
* @param bAgency
* @return
*/
String findBAgencyHaveUserOrNot(PageUtil paginationUtility,
BAgency bAgency);
List<BAgency> queryMoreByPagination(PageUtil paginationUtility, List<BAgency> queryMoreByPagination(PageUtil paginationUtility,
BAgency bAgency); BAgency bAgency);
......
...@@ -4,11 +4,17 @@ import lombok.extern.slf4j.Slf4j; ...@@ -4,11 +4,17 @@ import lombok.extern.slf4j.Slf4j;
import org.rcisoft.business.bagency.dao.BAgencyRepository; import org.rcisoft.business.bagency.dao.BAgencyRepository;
import org.rcisoft.business.bagency.entity.BAgency; import org.rcisoft.business.bagency.entity.BAgency;
import org.rcisoft.business.bagency.service.BAgencyService; import org.rcisoft.business.bagency.service.BAgencyService;
import org.rcisoft.business.bcompany.dao.BCompanyRepository;
import org.rcisoft.business.bcompany.entity.BCompany;
import org.rcisoft.business.bteacher.dao.BTeacherRepository;
import org.rcisoft.business.bteacher.entity.BTeacher;
import org.rcisoft.core.aop.PageUtil; import org.rcisoft.core.aop.PageUtil;
import org.rcisoft.core.exception.ServiceException; import org.rcisoft.core.exception.ServiceException;
import org.rcisoft.core.model.PersistModel; import org.rcisoft.core.model.PersistModel;
import org.rcisoft.core.result.ResultServiceEnums; import org.rcisoft.core.result.ResultServiceEnums;
import org.rcisoft.core.util.UserUtil; import org.rcisoft.core.util.UserUtil;
import org.rcisoft.sys.user.dao.SysUserMapper;
import org.rcisoft.sys.user.entity.SysUser;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Isolation; import org.springframework.transaction.annotation.Isolation;
...@@ -28,6 +34,15 @@ public class BAgencyServiceImpl implements BAgencyService { ...@@ -28,6 +34,15 @@ public class BAgencyServiceImpl implements BAgencyService {
@Autowired @Autowired
private BAgencyRepository bAgencyRepository; private BAgencyRepository bAgencyRepository;
@Autowired
private BTeacherRepository bTeacherRepository;
@Autowired
private BCompanyRepository bCompanyRepository;
@Autowired
private SysUserMapper sysUserMapper;
/** /**
* 保存 bAgency * 保存 bAgency
...@@ -49,6 +64,16 @@ public class BAgencyServiceImpl implements BAgencyService { ...@@ -49,6 +64,16 @@ public class BAgencyServiceImpl implements BAgencyService {
return new PersistModel(line); return new PersistModel(line);
} }
public String findBAgencyHaveUserOrNot(PageUtil paginationUtility, BAgency bAgency){
List<BAgency> teacherAgency = bAgencyRepository.queryTeacherAgency(bAgency.getBusinessId());
List<BAgency> companyAgency = bAgencyRepository.queryCompanyAgency(bAgency.getBusinessId());
if(teacherAgency.size()>0||companyAgency.size()>0){
return "教学单位下存在用户";
}
return "教学单位下不存在用户";
}
/** /**
* 逻辑删除 * 逻辑删除
* @param bAgency * @param bAgency
...@@ -57,12 +82,30 @@ public class BAgencyServiceImpl implements BAgencyService { ...@@ -57,12 +82,30 @@ public class BAgencyServiceImpl implements BAgencyService {
@Transactional(propagation = Propagation.REQUIRED,isolation = Isolation.DEFAULT) @Transactional(propagation = Propagation.REQUIRED,isolation = Isolation.DEFAULT)
@Override @Override
public PersistModel remove(BAgency bAgency){ public PersistModel remove(BAgency bAgency){
//先查询该教学单位是否被使用 //利用教学单位code删除所对应的teacher和company的字段
List<BAgency> teacherAgency = bAgencyRepository.queryTeacherAgency(bAgency.getBusinessId()); BAgency bagency = bAgencyRepository.selectOneBagency(bAgency.getBusinessId());
List<BAgency> companyAgency = bAgencyRepository.queryCompanyAgency(bAgency.getBusinessId()); String code = bagency.getCode();
if(teacherAgency.size()>0||companyAgency.size()>0){ BTeacher bTeacher = new BTeacher();
throw new ServiceException(ResultServiceEnums.AGENCY_IS_USED); BCompany bCompany = new BCompany();
} bTeacher.setAgencyCode(code);
bCompany.setAgencyCode(code);
//根据agency_code查询b_teacher
List<BTeacher> teacherList = bTeacherRepository.selectByAgencyCode(bTeacher);
//根据agency_code查询b_company
List<BCompany> companyList = bCompanyRepository.selectByAgencyCode(bCompany);
//删除b_teacher
bTeacherRepository.batchDeleteBycode(teacherList);
//删除b_company
bCompanyRepository.batchDeleteBycode(companyList);
//根据code查询s_user
List<SysUser> usersByTeacher = sysUserMapper.selectByTeacherCode(teacherList);
List<SysUser> usersByCompany = sysUserMapper.selectByCompanyCode(companyList);
//删除s_user
sysUserMapper.batchDeleteByTeacherCode(teacherList);
sysUserMapper.batchDeleteByCompanyCode(companyList);
//删除s_r_user_role
sysUserMapper.deleteTeacherUserRole(usersByTeacher);
sysUserMapper.deleteCompanyUserRole(usersByCompany);
UserUtil.setCurrentMergeOperation(bAgency); UserUtil.setCurrentMergeOperation(bAgency);
bAgency.setDeleted(); bAgency.setDeleted();
int line = bAgencyRepository.logicalDelete(bAgency); int line = bAgencyRepository.logicalDelete(bAgency);
......
...@@ -37,6 +37,7 @@ public class BArrangeController extends PaginationController<BArrange> { ...@@ -37,6 +37,7 @@ public class BArrangeController extends PaginationController<BArrange> {
//@ApiImplicitParams({@ApiImplicitParam(name = "businessId", value = "businessId", required = false, dataType = "varchar")}) //@ApiImplicitParams({@ApiImplicitParam(name = "businessId", value = "businessId", required = false, dataType = "varchar")})
@PostMapping(value = "/add") @PostMapping(value = "/add")
public Result add(String json) { public Result add(String json) {
System.out.println(json);
return Result.builder(bArrangeServiceImpl.save(json), return Result.builder(bArrangeServiceImpl.save(json),
MessageConstant.MESSAGE_ALERT_SUCCESS, MessageConstant.MESSAGE_ALERT_SUCCESS,
MessageConstant.MESSAGE_ALERT_ERROR, MessageConstant.MESSAGE_ALERT_ERROR,
......
...@@ -115,12 +115,18 @@ public class BArrangeServiceImpl implements BArrangeService { ...@@ -115,12 +115,18 @@ public class BArrangeServiceImpl implements BArrangeService {
List<BSubtask> subtaskList = new ArrayList<>(); List<BSubtask> subtaskList = new ArrayList<>();
JSONObject jsonObject = JSONObject.fromObject(json); JSONObject jsonObject = JSONObject.fromObject(json);
JSONObject arrange = jsonObject.getJSONObject("arrange"); JSONObject arrange = jsonObject.getJSONObject("arrange");
// if (arrange.isEmpty()){
// throw new ServiceException(ResultServiceEnums.PARAMETER_ERROR);
// }
bArrange.setDescription(arrange.getString("desc")); bArrange.setDescription(arrange.getString("desc"));
bArrange.setTermCode(arrange.getString("termCode")); bArrange.setTermCode(arrange.getString("termCode"));
bArrange.setStatus("0"); bArrange.setStatus("0");
UserUtil.setCurrentPersistOperation(bArrange); UserUtil.setCurrentPersistOperation(bArrange);
int line = bArrangeRepository.insertSelective(bArrange); int line = bArrangeRepository.insertSelective(bArrange);
JSONArray childList = arrange.getJSONArray("childList"); JSONArray childList = arrange.getJSONArray("childList");
// if (childList.isEmpty()){
// throw new ServiceException(ResultServiceEnums.PARAMETER_ERROR);
// }
for(int i = 0; i < childList.size() ; i++){ for(int i = 0; i < childList.size() ; i++){
JSONObject subtask = childList.getJSONObject(i); JSONObject subtask = childList.getJSONObject(i);
BSubtask bSubtask = new BSubtask(); BSubtask bSubtask = new BSubtask();
......
...@@ -3,6 +3,7 @@ package org.rcisoft.business.bcompany.dao; ...@@ -3,6 +3,7 @@ package org.rcisoft.business.bcompany.dao;
import org.apache.ibatis.annotations.ResultMap; import org.apache.ibatis.annotations.ResultMap;
import org.apache.ibatis.annotations.Select; import org.apache.ibatis.annotations.Select;
import org.rcisoft.business.bcompany.entity.BCompany; import org.rcisoft.business.bcompany.entity.BCompany;
import org.rcisoft.business.bteacher.entity.BTeacher;
import org.rcisoft.core.base.BaseMapper; import org.rcisoft.core.base.BaseMapper;
import org.springframework.stereotype.Repository; import org.springframework.stereotype.Repository;
...@@ -30,4 +31,10 @@ public interface BCompanyRepository extends BaseMapper<BCompany>{ ...@@ -30,4 +31,10 @@ public interface BCompanyRepository extends BaseMapper<BCompany>{
@Select("select agency_code from b_company where code = #{username}") @Select("select agency_code from b_company where code = #{username}")
String queryAgencyCodeByCode(String username); String queryAgencyCodeByCode(String username);
@Select("SELECT * from b_company where agency_code = #{agencyCode} and del_flag = 0 and flag = 1")
@ResultMap(value = "BaseResultMap" )
List<BCompany> selectByAgencyCode(BCompany bCompany);
int batchDeleteBycode(List<BCompany> companyList);
} }
...@@ -43,7 +43,7 @@ public class BEduClassController extends PaginationController<BEduClass> { ...@@ -43,7 +43,7 @@ public class BEduClassController extends PaginationController<BEduClass> {
@ApiImplicitParam(name = "agencyId", value = "企业ID", required = false, dataType = "varchar"), @ApiImplicitParam(name = "agencyId", value = "企业ID", required = false, dataType = "varchar"),
@ApiImplicitParam(name = "type", value = "班级类型", required = false, dataType = "varchar"), @ApiImplicitParam(name = "type", value = "班级类型", required = false, dataType = "varchar"),
@ApiImplicitParam(name = "classesId", value = "教学班code串", required = false, dataType = "varchar")}) @ApiImplicitParam(name = "classesId", value = "教学班code串", required = false, dataType = "varchar")})
@PostMapping(value = "/add") @PostMapping(value = "/add")
@PreAuthorize("hasRole('ROLE_1001')") @PreAuthorize("hasRole('ROLE_1001')")
public Result add(BEduClass bEduClass) { public Result add(BEduClass bEduClass) {
bEduClass.setToken(getToken()); bEduClass.setToken(getToken());
......
...@@ -22,6 +22,7 @@ public interface BGradeRepository extends BaseMapper<BGrade> { ...@@ -22,6 +22,7 @@ public interface BGradeRepository extends BaseMapper<BGrade> {
@Select("<script>select * from b_grade where 1=1 " @Select("<script>select * from b_grade where 1=1 "
+ "<if test=\"delFlag !=null and delFlag != '' \">and del_flag = #{delFlag} </if> " + "<if test=\"delFlag !=null and delFlag != '' \">and del_flag = #{delFlag} </if> "
+ "<if test=\"flag !=null and flag != '' \">and flag = #{flag} </if> " + "<if test=\"flag !=null and flag != '' \">and flag = #{flag} </if> "
+ "order by code desc"
+ "</script>") + "</script>")
@ResultMap(value = "BaseResultMap" ) @ResultMap(value = "BaseResultMap" )
List<BGrade> queryBGrades(BGrade bGrade); List<BGrade> queryBGrades(BGrade bGrade);
...@@ -29,7 +30,7 @@ public interface BGradeRepository extends BaseMapper<BGrade> { ...@@ -29,7 +30,7 @@ public interface BGradeRepository extends BaseMapper<BGrade> {
/** /**
查询是否有本年的年级 查询是否有本年的年级
*/ */
@Select("<script>select * from b_grade where code = #{nowYear} </script>") @Select("<script>select * from b_grade where code = #{nowYear} order by create_date desc</script>")
@ResultMap(value = "BaseResultMap" ) @ResultMap(value = "BaseResultMap" )
List<BGrade> queryBGradeByNowYear(String nowYear); List<BGrade> queryBGradeByNowYear(String nowYear);
......
...@@ -26,6 +26,7 @@ public interface BRoomsRepository extends BaseMapper<BRooms> { ...@@ -26,6 +26,7 @@ public interface BRoomsRepository extends BaseMapper<BRooms> {
+ "<if test=\"code !=null and code != '' \">and code like concat(concat(\"%\",#{code}),\"%\") </if> " + "<if test=\"code !=null and code != '' \">and code like concat(concat(\"%\",#{code}),\"%\") </if> "
+ "<if test=\"category !=null and category != '' \">and category = #{category} </if> " + "<if test=\"category !=null and category != '' \">and category = #{category} </if> "
+ "<if test=\"flag !=null and flag != '' \">and flag = #{flag} </if> " + "<if test=\"flag !=null and flag != '' \">and flag = #{flag} </if> "
+ "order by create_date desc"
+ "</script>") + "</script>")
@ResultMap(value = "BaseResultMap" ) @ResultMap(value = "BaseResultMap" )
List<BRooms> queryBRoomss(BRooms bRooms); List<BRooms> queryBRoomss(BRooms bRooms);
......
...@@ -33,7 +33,9 @@ public interface BStudentRepository extends BaseMapper<BStudent> { ...@@ -33,7 +33,9 @@ public interface BStudentRepository extends BaseMapper<BStudent> {
"LEFT JOIN b_grade bg ON b.grade_code = bg.`code`\n" + "LEFT JOIN b_grade bg ON b.grade_code = bg.`code`\n" +
"where b.del_flag != 1 and b.flag = 1 "+ "where b.del_flag != 1 and b.flag = 1 "+
"<if test=\"name!=null and name != ''\">and u.`name` like CONCAT('%',#{name},'%') </if>"+ "<if test=\"name!=null and name != ''\">and u.`name` like CONCAT('%',#{name},'%') </if>"+
"<if test=\"code!=null and code != ''\">and b.`code` like CONCAT('%',#{code},'%') </if></script>") "<if test=\"code!=null and code != ''\">and b.`code` like CONCAT('%',#{code},'%') </if>" +
"order by b.grade_code desc" +
"</script>")
@ResultMap(value = "BaseResultMap" ) @ResultMap(value = "BaseResultMap" )
List<BStudent> queryBStudents(BStudent param); List<BStudent> queryBStudents(BStudent param);
...@@ -44,7 +46,7 @@ public interface BStudentRepository extends BaseMapper<BStudent> { ...@@ -44,7 +46,7 @@ public interface BStudentRepository extends BaseMapper<BStudent> {
"LEFT JOIN b_student t3 ON t2.student_code = t3.`code`\n" + "LEFT JOIN b_student t3 ON t2.student_code = t3.`code`\n" +
"LEFT JOIN s_user t4 ON t3.`code` = t4.login_name\n" + "LEFT JOIN s_user t4 ON t3.`code` = t4.login_name\n" +
"WHERE\n" + "WHERE\n" +
"\tt2.class_code = #{classCode} and t3.del_flag != 1 and t3.flag = 1</script>") "\tt2.class_code = #{classCode} and t3.del_flag != 1 and t3.flag = 1 order by t3.grade_code desc</script>")
@ResultMap(value = "BaseResultMap" ) @ResultMap(value = "BaseResultMap" )
List<BStudent> queryStudentByClassCode(@Param("classCode") String classCode); List<BStudent> queryStudentByClassCode(@Param("classCode") String classCode);
......
package org.rcisoft.business.bteacher.dao; package org.rcisoft.business.bteacher.dao;
import org.apache.ibatis.annotations.Insert; import org.apache.ibatis.annotations.*;
import org.apache.ibatis.annotations.ResultMap;
import org.apache.ibatis.annotations.Select;
import org.rcisoft.business.bteacher.entity.BTeacher; import org.rcisoft.business.bteacher.entity.BTeacher;
import org.rcisoft.core.base.BaseMapper; import org.rcisoft.core.base.BaseMapper;
import org.springframework.stereotype.Repository; import org.springframework.stereotype.Repository;
...@@ -75,5 +73,13 @@ public interface BTeacherRepository extends BaseMapper<BTeacher> { ...@@ -75,5 +73,13 @@ public interface BTeacherRepository extends BaseMapper<BTeacher> {
"left JOIN s_user on b_schedule_dto.teacher_code = s_user.login_name where sub_agency_id = #{subAgencyId} GROUP BY `name` ") "left JOIN s_user on b_schedule_dto.teacher_code = s_user.login_name where sub_agency_id = #{subAgencyId} GROUP BY `name` ")
@ResultMap(value = "SmallBaseResultMap" ) @ResultMap(value = "SmallBaseResultMap" )
List<BTeacher> selectTeacherBySubAgencyId(String subAgencyId); List<BTeacher> selectTeacherBySubAgencyId(String subAgencyId);
@Select("SELECT * from b_teacher where agency_code = #{agencyCode} and del_flag = 0 and flag = 1")
@ResultMap(value = "BaseResultMap" )
List<BTeacher> selectByAgencyCode(BTeacher bTeacher);
int batchDeleteBycode(List<BTeacher> teacherList);
} }
...@@ -172,9 +172,10 @@ public enum ResultServiceEnums { ...@@ -172,9 +172,10 @@ public enum ResultServiceEnums {
EXCEL_IMPORT_DATA_HAS_NULL(92,"第一行存在空数据"), EXCEL_IMPORT_DATA_HAS_NULL(92,"第一行存在空数据"),
STARTDATE_AFTER_ENDDATE(93,"开始时间比结束时间晚"), STARTDATE_AFTER_ENDDATE(93,"结束时间应晚于开始时间"),
STARTDATE_EQUAL_ENDDATE(94,"开始时间等于结束时间"), STARTDATE_EQUAL_ENDDATE(94,"开始时间等于结束时间"),
; ;
private Integer code; private Integer code;
......
...@@ -3,6 +3,8 @@ package org.rcisoft.sys.user.dao; ...@@ -3,6 +3,8 @@ package org.rcisoft.sys.user.dao;
import org.apache.ibatis.annotations.*; import org.apache.ibatis.annotations.*;
import org.rcisoft.business.bagency.entity.BAgency; import org.rcisoft.business.bagency.entity.BAgency;
import org.rcisoft.business.bcompany.entity.BCompany;
import org.rcisoft.business.bteacher.entity.BTeacher;
import org.rcisoft.core.base.BaseMapper; import org.rcisoft.core.base.BaseMapper;
import org.rcisoft.sys.user.entity.SysUser; import org.rcisoft.sys.user.entity.SysUser;
import org.rcisoft.sys.user.entity.UserRole; import org.rcisoft.sys.user.entity.UserRole;
...@@ -95,4 +97,17 @@ public interface SysUserMapper extends BaseMapper<SysUser> { ...@@ -95,4 +97,17 @@ public interface SysUserMapper extends BaseMapper<SysUser> {
@Select("select business_id from s_user where login_name = #{0} and del_flag = 0") @Select("select business_id from s_user where login_name = #{0} and del_flag = 0")
String selectByLoginName(String loginName); String selectByLoginName(String loginName);
List<SysUser> selectByTeacherCode(List<BTeacher> teacherList);
List<SysUser> selectByCompanyCode(List<BCompany> companyList);
int batchDeleteByTeacherCode(List<BTeacher> teacherList);
int batchDeleteByCompanyCode(List<BCompany> bCompanyList);
int deleteTeacherUserRole(List<SysUser> userTeacherList);
int deleteCompanyUserRole(List<SysUser> userCompanyList);
} }
...@@ -11,7 +11,7 @@ server: ...@@ -11,7 +11,7 @@ server:
# org.springframework.web: DEBUG # org.springframework.web: DEBUG
druid: druid:
url: jdbc:mysql://192.168.1.125:13318/edu_db?useUnicode=true&characterEncoding=UTF-8&zeroDateTimeBehavior=convertToNull&allowMultiQueries=true&useSSL=false url: jdbc:mysql://192.168.1.125:13318/new_edu_db?useUnicode=true&characterEncoding=UTF-8&zeroDateTimeBehavior=convertToNull&allowMultiQueries=true&useSSL=false
username: root username: root
password: 123456 password: 123456
initial-size: 1 initial-size: 1
......
...@@ -13,4 +13,11 @@ ...@@ -13,4 +13,11 @@
<result column="agency_code" jdbcType="INTEGER" property="agencyCode"/> <result column="agency_code" jdbcType="INTEGER" property="agencyCode"/>
</resultMap> </resultMap>
<delete id="batchDeleteBycode" parameterType="java.util.List">
update b_company set del_flag = 1 where business_id IN
<foreach collection="list" item="item"
separator="," open="(" close=")">
#{item.businessId}
</foreach>
</delete>
</mapper> </mapper>
\ No newline at end of file
...@@ -22,4 +22,12 @@ ...@@ -22,4 +22,12 @@
<result column="teacher_code" jdbcType="VARCHAR" property="code"/> <result column="teacher_code" jdbcType="VARCHAR" property="code"/>
<result column="name" jdbcType="VARCHAR" property="name" /> <result column="name" jdbcType="VARCHAR" property="name" />
</resultMap> </resultMap>
<delete id="batchDeleteBycode" parameterType="java.util.List">
update b_teacher set del_flag = 1 where business_id IN
<foreach collection="list" item="item"
separator="," open="(" close=")">
#{item.businessId}
</foreach>
</delete>
</mapper> </mapper>
\ No newline at end of file
...@@ -18,4 +18,52 @@ ...@@ -18,4 +18,52 @@
<result column="update_date" property="updateDate" jdbcType="TIMESTAMP" /> <result column="update_date" property="updateDate" jdbcType="TIMESTAMP" />
<result column="create_date" property="createDate" jdbcType="TIMESTAMP" /> <result column="create_date" property="createDate" jdbcType="TIMESTAMP" />
</resultMap> </resultMap>
<select id="selectByTeacherCode" parameterType="java.util.List" resultMap="BaseResultMap">
SELECT business_id FROM s_user where del_flag = 0 and flag = 1 and login_name IN
<foreach collection="list" item="item"
separator="," open="(" close=")">
#{item.code}
</foreach>
</select>
<select id="selectByCompanyCode" parameterType="java.util.List" resultMap="BaseResultMap">
SELECT business_id FROM s_user where del_flag = 0 and flag = 1 and login_name IN
<foreach collection="list" item="item"
separator="," open="(" close=")">
#{item.code}
</foreach>
</select>
<delete id="batchDeleteByTeacherCode" parameterType="java.util.List">
update s_user set del_flag = 1 where login_name IN
<foreach collection="list" item="item"
separator="," open="(" close=")">
#{item.code}
</foreach>
</delete>
<delete id="batchDeleteByCompanyCode" parameterType="java.util.List">
update s_user set del_flag = 1 where login_name IN
<foreach collection="list" item="item"
separator="," open="(" close=")">
#{item.code}
</foreach>
</delete>
<delete id="deleteTeacherUserRole" parameterType="java.util.List">
delete FROM s_r_user_role WHERE user_id IN
<foreach collection="list" item="item"
separator="," open="(" close=")">
#{item.businessId}
</foreach>
</delete>
<delete id="deleteCompanyUserRole" parameterType="java.util.List">
delete FROM s_r_user_role WHERE user_id IN
<foreach collection="list" item="item"
separator="," open="(" close=")">
#{item.businessId}
</foreach>
</delete>
</mapper> </mapper>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment