// @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,staffWorkNumber,phone,email,staffProfessionalArchitectureId,staffGradeId,roleId,isdel,uniqueIdentificationAccount,schoolId)VALUES(#{staffName},#{staffWorkNumber},#{phone},#{email},#{staffProfessionalArchitectureId},#{staffGradeId},#{roleId},0,#{uniqueIdentificationAccount},#{schoolId})")
voidaddStaff(Staffstaff);
voidaddStaff(Staffstaff);
@Select({"<script>",
@Select({"<script>",
"SELECT sta.uniqueIdentificationAccount,sta.staffId,sta.staffName,sta.staffWorkNumber,sta.phone,sta.email,sta.logNumber,sta.lastTimeOfLanding,sta.staffGradeId,sta.staffProfessionalArchitectureId,sta.roleId,gra.staffGradeName,pro.staffProfessionalArchitectureName from staff sta,staff_grade gra,staff_professional_architecture pro where sta.isdel = 0 and sta.staffGradeId = gra.staffGradeId and pro.staffProfessionalArchitectureId = sta.staffProfessionalArchitectureId and sta.roleId != 1 and sta.roleId !=2 and sta.schoolId = #{schoolId}",
"SELECT hui.userName,hor.workNumber,hor.oneDepartmentId,hor.twoDepartmentId,hor.roleId,hui.logInNumber as logInNumber,hui.lastLoginTime as lastTimeOfLanding FROM hr_user_info hui,hr_organization_relationship hor WHERE hui.userId = hor.userId and hor.roleId != 1 and hor.roleId !=4 and hor.schoolId = #{schoolId}",
// " <if test='nameAndNumber!=null'> and sta.staffName like CONCAT('%',#{nameAndNumber},'%') or sta.staffWorkNumber like CONCAT('%',#{nameAndNumber},'%') GROUP BY sta.staffId</if>",
" <if test='searchContent!=null'> and hui.userName like CONCAT('%',#{searchContent},'%') or hor.workNumber like CONCAT('%',#{searchContent},'%')</if>",
" <if test='nameAndNumber!=null'> and sta.staffName like CONCAT('%',#{nameAndNumber},'%')</if>",
@ -32,13 +32,13 @@ public interface UserInfoMapper {
voidaddUser(UserInfouser);
voidaddUser(UserInfouser);
@Select({"<script>",
@Select({"<script>",
"SELECT s.schoolName,s.provinceId,s.cityId,s.provinceName,s.cityName,u.userId,u.userName,u.countries,u.creationTime,u.account,u.logInNumber,hor.schoolId,hor.platformId,hor.roleId FROM hr_user_info u,hr_organization_relationship hor,school s WHERE u.userId = hor.userId and hor.schoolId = s.schoolId and s.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,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",
" <if test='countries!=null and countries !=\"\" '>and u.countries = #{countries} </if>",
" <if test='countries!=null and countries !=\"\" '>and u.countries = #{countries} </if>",
// " <if test='searchContent!=null and searchContent !=\"\" '> AND CONCAT(u.name, s.schoolName) LIKE CONCAT('%',#{searchContent},'%')</if>",
" <if test='searchContent!=null and searchContent !=\"\" '> AND CONCAT(u.userName, s.schoolName,u.account) LIKE CONCAT('%',#{searchContent},'%')</if>",
"INSERT INTO hr_personal_file(personalCareerId,schoolId,schoolName,disciplineId,disciplineName,professionalClassId,professionalClassName,professionalId,professionalName,userId,updatetime) values "+
"INSERT INTO hr_organization_relationship(userId,platformId,schoolId,schoolName,roleId,workNumber,oneDepartmentId,oneDepartmentName,twoDepartmentId,twoDepartmentName,professionalId,professionalName,gradeId,gradeName,classId,className,updatetime,customerId) "+
@ -118,13 +96,29 @@ public interface UserInfoMapper {
voidupdateStudent(Studentstudent);
voidupdateStudent(Studentstudent);
//登陆
//登陆
@Select("SELECT hui.account,hui.cityId,hui.countries,hui.creationTime,hui.dateBirth,hui.documentType,hui.educationDegree,hui.email,hui.iDNumber,hui.logInNumber,hui.phone,hui.provinceId,hui.schoolId,hui.sex,hui.uniqueIdentificationAccount,hui.userAvatars,hui.userId,hui.userName,hui.weChatID from hr_user_info hui where hui.isdel=0 and hui.account = #{account} and hui.password = #{password}")
@Select("SELECT hui.schoolId,hui.account,hui.cityId,hui.countries,hui.creationTime,hui.dateBirth,hui.documentType,hui.educationDegree,hui.email,hui.iDNumber,hui.logInNumber,hui.phone,hui.provinceId,hui.sex,hui.uniqueIdentificationAccount,hui.userAvatars,hui.userId,hui.userName,hui.weChatID from hr_user_info hui where hui.isdel=0 and hui.userId = #{userId} ")
UserInfologins(UserInfouserInfo);
UserInfologins(UserInfouserInfo);
//登陆账号密码
@Select("SELECT hui.schoolId,hui.account,hui.cityId,hui.countries,hui.creationTime,hui.dateBirth,hui.documentType,hui.educationDegree,hui.email,hui.iDNumber,hui.logInNumber,hui.phone,hui.provinceId,hui.sex,hui.uniqueIdentificationAccount,hui.userAvatars,hui.userId,hui.userName,hui.weChatID from hr_user_info hui where hui.isdel=0 and hui.account = #{account} and password = #{password} ")
UserInfologinsAP(UserInfouserInfo);
//查询用户角色
@Select("SELECT userId,roleId from hr_organization_relationship where userId = #{userId} and schoolId = #{schoolId}")
@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 u.* from user u where isdel=0 and phone = #{phone}")
@Select("SELECT u.* from user u where isdel=0 and phone = #{phone}")
List<UserM>queryPhone(Stringphone);
List<UserM>queryPhone(Stringphone);
@ -141,6 +135,18 @@ public interface UserInfoMapper {
"SELECT customerId,customerName,schoolId FROM customer where isdel = 0",
"SELECT customerId,customerName,schoolId FROM customer where isdel = 0",
@ -174,22 +180,30 @@ public interface UserInfoMapper {
@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);
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);
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);
voidupdateStaffLogInNumber(UserMuser);
//查询账号是否存在
//查询账号是否存在
@Select("SELECT userId,account from user where isdel = 0 and account = #{account}")
@Select("SELECT userId,account from hr_user_info where isdel = 0 and account = #{account}")
List<UserInfo>queryAccountIsExist(Stringaccount);
List<UserInfo>queryAccountIsExist(Stringaccount);
//查询学号、工号是否存在
//查询学号、工号是否存在
@Select("SELECT userId,workNumber,schoolId,roleId from hr_organization_relationship where workNumber = #{workNumber} and roleId = #{roleId} and 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 "
@Select("select userId,password,accountRole,logInNumber,workNumber,phone,uniqueIdentificationAccount,schoolId from user "
+" where isdel=0 and password=#{password} and (phone=#{userAccount} or workNumber=#{userAccount} or uniqueIdentificationAccount=#{userAccount})")
+" where isdel=0 and password=#{password} and (phone=#{userAccount} or workNumber=#{userAccount} or uniqueIdentificationAccount=#{userAccount})")
@ -204,22 +218,22 @@ public interface UserInfoMapper {
*/
*/
@Insert({
@Insert({
"<script>",
"<script>",
"insert into hr_personal_file(personalCareerId,schoolId,disciplineId,professionalClassId,professionalId,userId) values ",
"insert into hr_personal_file(personalCareerId,schoolId,disciplineId,professionalClassId,professionalId,userId,schoolName,disciplineName,professionalClassName,professionalName) values ",
@Insert("INSERT INTO student(account,userId,studentName,roleId,studentNumber,phone,email,professionalId,gradeId,classId,professionalName,gradeName,className,uniqueIdentificationAccount,schoolId,isdel)"
@Insert("INSERT INTO staff(account,userId,staffName,roleId,staffWorkNumber,phone,email,staffGradeId,staffProfessionalArchitectureId,staffProfessionalArchitectureName,staffGradeName,uniqueIdentificationAccount,schoolId,isdel)"
"INSERT INTO hr_organization_relationship(userId,platformId,schoolId,schoolName,roleId,workNumber,oneDepartmentId,oneDepartmentName,twoDepartmentId,twoDepartmentName,professionalId,professionalName,gradeId,gradeName,classId,className,updatetime,customerId) "+