// @Insert("INSERT INTO staff(staffName,staffWorkNumber,phone,email,staffProfessionalArchitectureId,staffGradeId,roleId,isdel,uniqueIdentificationAccount,schoolId)VALUES(#{staffName},#{staffWorkNumber},#{phone},#{email},#{staffProfessionalArchitectureId},#{staffGradeId},#{roleId},0,#{uniqueIdentificationAccount},#{schoolId})")
// void addStaff(Staff staff);
//添加员工
@Insert("INSERT INTO staff(staffName,staffWorkNumber,phone,email,staffProfessionalArchitectureId,staffGradeId,roleId,isdel,uniqueIdentificationAccount,schoolId)VALUES(#{staffName},#{staffWorkNumber},#{phone},#{email},#{staffProfessionalArchitectureId},#{staffGradeId},#{roleId},0,#{uniqueIdentificationAccount},#{schoolId})")
@Insert("INSERT INTO staff(staffName,workNumber,phone,email,staffProfessionalArchitectureId,staffGradeId,roleId,isdel,uniqueIdentificationAccount,schoolId)VALUES(#{staffName},#{workNumber},#{phone},#{email},#{staffProfessionalArchitectureId},#{staffGradeId},#{roleId},0,#{uniqueIdentificationAccount},#{schoolId})")
"insert into staff(staffName,staffWorkNumber,staffGradeId,staffProfessionalArchitectureId,roleId,phone,uniqueIdentificationAccount,email,schoolId,isdel) values ",
"insert into staff(staffName,workNumber,staffGradeId,staffProfessionalArchitectureId,roleId,phone,uniqueIdentificationAccount,email,schoolId,isdel) values ",
"SELECT uniqueIdentificationAccount,studentName,studentNumber,phone,email,roleId,schoolId,professionalId,gradeId,classId from student where isdel = 0 and studentId = #{studentId}",
"SELECT uniqueIdentificationAccount,studentName,workNumber,phone,email,roleId,schoolId,professionalId,gradeId,classId from student where isdel = 0 and studentId = #{studentId}",
@ -63,12 +63,12 @@ public interface StudentMapper {
//查询学生详情
@Select({"<script>",
"SELECT s.uniqueIdentificationAccount,s.studentName,s.studentNumber,s.phone,s.email,s.roleId,s.schoolId,s.professionalId,s.gradeId,s.classId,u.* from student s,user u where s.isdel = 0 and s.studentId = #{studentId} and s.phone = u.phone",
"SELECT s.uniqueIdentificationAccount,s.studentName,s.workNumber,s.phone,s.email,s.roleId,s.schoolId,s.professionalId,s.gradeId,s.classId,u.* from student s,user u where s.isdel = 0 and s.studentId = #{studentId} and s.phone = u.phone",
@Insert("INSERT INTO hr_user_info(userName,uniqueIdentificationAccount,documentType,IDNumber,provinceId,cityId,countries,dateBirth,educationDegree,schoolId,phone,weChatID,email,account,password,creationTime,logInNumber,sex,userAvatars,isdel)"
@ -65,16 +28,24 @@ public interface UserInfoMapper{
@Insert("INSERT INTO hr_user_info(userName,uniqueIdentificationAccount,documentType,IDNumber,provinceId,cityId,countries,dateBirth,educationDegree,schoolId,phone,weChatID,email,account,password,creationTime,logInNumber,sex,userAvatars,isdel)"
@Insert("INSERT INTO staff(workNumber,schoolId,staffProfessionalArchitectureId,staffGradeId,staffProfessionalArchitectureName,staffGradeName,roleId,userId,platformId,isdel)"
"SELECT u.userId,u.userName,s.schoolName,s.provinceId,s.cityId,s.provinceName,s.cityName,u.countries,u.creationTime,u.account,u.logInNumber,u.schoolId,hor.platformId,hor.roleId FROM hr_user_info u,hr_organization_relationship hor,school s WHERE u.userId = hor.userId and u.schoolId = s.schoolId and u.isdel = 0 and hor.isdel = 0",
"SELECT u.userId,u.userName,s.schoolName,s.provinceId,s.cityId,s.provinceName,s.cityName,u.countries,u.creationTime,u.account,u.logInNumber,u.schoolId,u.roleId FROM hr_user_info u,school s WHERE u.schoolId = s.schoolId and u.isdel = 0",
" <if test='countries!=null and countries !=\"\" '>and u.countries = #{countries} </if>",
" <if test='roleId!=null and roleId !=\"\" '>and u.roleId LIKE CONCAT('%',#{roleId},'%')</if>",
" <if test='searchContent!=null and searchContent !=\"\" '> AND CONCAT(u.userName, s.schoolName,u.account) LIKE CONCAT('%',#{searchContent},'%')</if>",
@Update("UPDATE hr_user_info SET roleId = #{roleId} where userId = #{userId}")
voidupdateUserRoleId(IntegeruserId,StringroleId);
//修改个人档案添加功能(删除后添加用户个人档案)
@Insert({"<script>",
@Insert({"<script>",
"INSERT INTO hr_personal_file(personalCareerId,schoolId,schoolName,disciplineId,disciplineName,professionalClassId,professionalClassName,professionalId,professionalName,userId,updatetime) values "+
"Delete from hr_personal_file where userId = #{userId}",
"</script>"})
"</script>"})
voiddeleteUserProfiles(IntegeruserId);
//修改用户组织关系添加功能
@Insert({"<script>",
@Insert({"<script>",
"INSERT INTO hr_organization_relationship(userId,platformId,schoolId,schoolName,roleId,workNumber,oneDepartmentId,oneDepartmentName,twoDepartmentId,twoDepartmentName,professionalId,professionalName,gradeId,gradeName,classId,className,updatetime,customerId) "+
// @Select("SELECT hp.* FROM hr_platform hp,hr_organization_relationship hor WHERE hor.platformId = hp.platformId and hor.userId = #{userId} and hor.isdel = 0 GROUP BY platformId")
@Select("SELECT hp.* FROM hr_platform hp,student stu WHERE stu.platformId = hp.platformId and stu.userId = #{userId} and stu.isdel = 0 GROUP BY platformId")
@Select("SELECT hp.* FROM hr_platform hp,hr_organization_relationship hor WHERE hor.platformId = hp.platformId and hor.userId = #{userId} and hor.isdel = 0 GROUP BY platformId")
List<Platform>queryUserPlatform(IntegeruserId);
//查询用户绑定员工的平台信息
@Select("SELECT hp.* FROM hr_platform hp,staff sta WHERE sta.platformId = hp.platformId and sta.userId = #{userId} and sta.isdel = 0 GROUP BY platformId")
"SELECT sta.*,sch.schoolName from staff sta,school sch where sta.userId = #{userId} and sta.platformId = #{platformId} and sta.schoolId = sch.schoolId",
"SELECT stu.*,sch.schoolName from student stu,school sch where stu.userId = #{userId} and stu.platformId = #{platformId} and stu.schoolId = sch.schoolId",
@Update({"UPDATE user SET logInNumber=logInNumber+1, lastTimeOfLanding=now() WHERE userId=#{userId}"})
@Update({"UPDATE user SET logInNumber=logInNumber+1, lastTimeOfLanding=now() WHERE userId=#{userId}"})
voidupdateLogInNumber(UserMuser);
//更新学生登录次数和最后一次登录时间
@Update({"UPDATE student SET logInNumber=logInNumber+1, lastLoginTime=now() WHERE phone=#{phone}"})
@Update({"UPDATE student SET logInNumber=logInNumber+1, lastLoginTime=now() WHERE phone=#{phone}"})
voidupdateStudentLogInNumber(UserMuser);
//更新员工登录次数和最后一次登录时间
@Update({"UPDATE staff SET logNumber=logNumber+1, lastTimeOfLanding=now() WHERE phone=#{phone}"})
@Update({"UPDATE staff SET logNumber=logNumber+1, lastTimeOfLanding=now() WHERE phone=#{phone}"})
voidupdateStaffLogInNumber(UserMuser);
//查询账号是否存在
@ -231,19 +255,27 @@ public interface UserInfoMapper{
//查询账号是否存在
@Select("SELECT hor.* from hr_organization_relationship hor,hr_user_info hui where hor.isdel = 0 and hui.account = #{account} and hor.userId = hui.userId and hor.schoolId = #{schoolId}")
@Select("SELECT userId,workNumber,schoolId,roleId from hr_organization_relationship where workNumber = #{workNumber} and roleId = #{roleId} and schoolId = #{schoolId}")
@Select("select userId,password,accountRole,logInNumber,workNumber,phone,uniqueIdentificationAccount,schoolId from user "
@ -266,15 +298,15 @@ public interface UserInfoMapper{
voidaddPersonalFile(UserProfilesuserProfiles);
//添加用户组织关系
@Insert({"<script>",
@Insert({"<script>",
"INSERT INTO hr_organization_relationship(userId,platformId,schoolId,schoolName,roleId,workNumber,oneDepartmentId,oneDepartmentName,twoDepartmentId,twoDepartmentName,professionalId,professionalName,gradeId,gradeName,classId,className,updatetime,customerId,creationTime) "+