Explorar o código

Merge branch 'master' of http://git.dayaedu.com/yonge/mec

zouxuan %!s(int64=5) %!d(string=hai) anos
pai
achega
cffacd0bea

+ 54 - 40
mec-biz/src/main/java/com/ym/mec/biz/dal/entity/EmployeeInfo.java

@@ -4,8 +4,8 @@ import io.swagger.annotations.ApiModelProperty;
 
 import org.apache.commons.lang3.builder.ToStringBuilder;
 
-import com.ym.mec.biz.dal.enums.JobNatureEnum;
 import com.ym.mec.biz.dal.enums.JobTypeEnum;
+import com.ym.mec.biz.dal.enums.StaffStatusEnum;
 
 /**
  * 对应数据库表(employee_info):
@@ -31,7 +31,7 @@ public class EmployeeInfo {
 	private Integer age;
 
 	@ApiModelProperty(value = "性别", required = false)
-	private boolean gender;
+	private Boolean gender;
 
 	@ApiModelProperty(value = "出生年月日", required = false)
 	private java.util.Date birthdate;
@@ -55,10 +55,12 @@ public class EmployeeInfo {
 	private String educationalBackground;
 
 	@ApiModelProperty(value = "声部", required = false)
-	private Integer subjectId;
+	private String subjectIdList;
+	
+	private String subjectName;
 
-	@ApiModelProperty(value = "是否评估", required = false)
-	private boolean isInterviewed;
+	@ApiModelProperty(value = "评估结果", required = false)
+	private String assessmentResult;
 
 	@ApiModelProperty(value = "其他综合情况", required = false)
 	private String otherComment;
@@ -68,15 +70,17 @@ public class EmployeeInfo {
 
 	@ApiModelProperty(value = "分部", required = false)
 	private Integer organId;
+	
+	private String organName;
 
 	@ApiModelProperty(value = "职位", required = false)
 	private JobTypeEnum position;
 
-	@ApiModelProperty(value = "工作性质(全职/兼职)", required = false)
-	private JobNatureEnum jobNature;
+	@ApiModelProperty(value = "人员状态", required = false)
+	private StaffStatusEnum status;
 
 	@ApiModelProperty(value = "是否是试用期", required = false)
-	private boolean isProbationPeriod;
+	private Boolean isProbationPeriod;
 
 	@ApiModelProperty(value = "银行卡号", required = false)
 	private String bankCardNo;
@@ -89,6 +93,8 @@ public class EmployeeInfo {
 
 	@ApiModelProperty(value = "操作人编号", required = false)
 	private Integer operatorId;
+	
+	private String operatorName;
 
 	@ApiModelProperty(value = "信息来源", required = false)
 	private String sourceFrom;
@@ -147,11 +153,11 @@ public class EmployeeInfo {
 		return this.age;
 	}
 
-	public void setGender(boolean gender) {
+	public void setGender(Boolean gender) {
 		this.gender = gender;
 	}
 
-	public boolean isGender() {
+	public Boolean getGender() {
 		return this.gender;
 	}
 
@@ -211,20 +217,20 @@ public class EmployeeInfo {
 		return this.educationalBackground;
 	}
 
-	public void setSubjectId(Integer subjectId) {
-		this.subjectId = subjectId;
+	public String getSubjectIdList() {
+		return subjectIdList;
 	}
 
-	public Integer getSubjectId() {
-		return this.subjectId;
+	public void setSubjectIdList(String subjectIdList) {
+		this.subjectIdList = subjectIdList;
 	}
 
-	public void setIsInterviewed(boolean isInterviewed) {
-		this.isInterviewed = isInterviewed;
+	public String getAssessmentResult() {
+		return assessmentResult;
 	}
 
-	public boolean isIsInterviewed() {
-		return this.isInterviewed;
+	public void setAssessmentResult(String assessmentResult) {
+		this.assessmentResult = assessmentResult;
 	}
 
 	public void setOtherComment(String otherComment) {
@@ -243,14 +249,6 @@ public class EmployeeInfo {
 		return this.entryDate;
 	}
 
-	public boolean isInterviewed() {
-		return isInterviewed;
-	}
-
-	public void setInterviewed(boolean isInterviewed) {
-		this.isInterviewed = isInterviewed;
-	}
-
 	public Integer getOrganId() {
 		return organId;
 	}
@@ -259,14 +257,6 @@ public class EmployeeInfo {
 		this.organId = organId;
 	}
 
-	public boolean isProbationPeriod() {
-		return isProbationPeriod;
-	}
-
-	public void setProbationPeriod(boolean isProbationPeriod) {
-		this.isProbationPeriod = isProbationPeriod;
-	}
-
 	public void setPosition(JobTypeEnum position) {
 		this.position = position;
 	}
@@ -275,19 +265,19 @@ public class EmployeeInfo {
 		return this.position;
 	}
 
-	public void setJobNature(JobNatureEnum jobNature) {
-		this.jobNature = jobNature;
+	public StaffStatusEnum getStatus() {
+		return status;
 	}
 
-	public JobNatureEnum getJobNature() {
-		return this.jobNature;
+	public void setStatus(StaffStatusEnum status) {
+		this.status = status;
 	}
 
-	public void setIsProbationPeriod(boolean isProbationPeriod) {
+	public void setIsProbationPeriod(Boolean isProbationPeriod) {
 		this.isProbationPeriod = isProbationPeriod;
 	}
 
-	public boolean isIsProbationPeriod() {
+	public boolean getIsProbationPeriod() {
 		return this.isProbationPeriod;
 	}
 
@@ -347,6 +337,30 @@ public class EmployeeInfo {
 		this.sourceFrom = sourceFrom;
 	}
 
+	public String getSubjectName() {
+		return subjectName;
+	}
+
+	public void setSubjectName(String subjectName) {
+		this.subjectName = subjectName;
+	}
+
+	public String getOrganName() {
+		return organName;
+	}
+
+	public void setOrganName(String organName) {
+		this.organName = organName;
+	}
+
+	public String getOperatorName() {
+		return operatorName;
+	}
+
+	public void setOperatorName(String operatorName) {
+		this.operatorName = operatorName;
+	}
+
 	@Override
 	public String toString() {
 		return ToStringBuilder.reflectionToString(this);

+ 24 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/enums/StaffStatusEnum.java

@@ -0,0 +1,24 @@
+package com.ym.mec.biz.dal.enums;
+
+import com.ym.mec.common.enums.BaseEnum;
+
+public enum StaffStatusEnum implements BaseEnum<String, StaffStatusEnum> {
+
+	NOT_EMPLOYED("未录用"), INTERVIEWING("面试中"), RESERVE("储备"), PART_TIME("兼职"), FULL_TIME("全职"), DIMISSION("离职");
+
+	private String desc;
+
+	StaffStatusEnum(String desc) {
+		this.desc = desc;
+	}
+
+	public String getDesc() {
+		return desc;
+	}
+
+	@Override
+	public String getCode() {
+		return this.name();
+	}
+
+}

+ 7 - 7
mec-biz/src/main/java/com/ym/mec/biz/dal/page/EmployeeInfoQueryInfo.java

@@ -2,8 +2,8 @@ package com.ym.mec.biz.dal.page;
 
 import io.swagger.annotations.ApiModelProperty;
 
-import com.ym.mec.biz.dal.enums.JobNatureEnum;
 import com.ym.mec.biz.dal.enums.JobTypeEnum;
+import com.ym.mec.biz.dal.enums.StaffStatusEnum;
 import com.ym.mec.common.page.QueryInfo;
 
 public class EmployeeInfoQueryInfo extends QueryInfo {
@@ -23,8 +23,8 @@ public class EmployeeInfoQueryInfo extends QueryInfo {
 	@ApiModelProperty(value = "职位", required = false)
 	private JobTypeEnum position;
 
-	@ApiModelProperty(value = "工作性质(全职/兼职)", required = false)
-	private JobNatureEnum jobNature;
+	@ApiModelProperty(value = "状态", required = false)
+	private StaffStatusEnum status;
 
 	public String getUserNameOrIdOrMobile() {
 		return userNameOrIdOrMobile;
@@ -58,12 +58,12 @@ public class EmployeeInfoQueryInfo extends QueryInfo {
 		this.position = position;
 	}
 
-	public JobNatureEnum getJobNature() {
-		return jobNature;
+	public StaffStatusEnum getStatus() {
+		return status;
 	}
 
-	public void setJobNature(JobNatureEnum jobNature) {
-		this.jobNature = jobNature;
+	public void setStatus(StaffStatusEnum status) {
+		this.status = status;
 	}
 
 	public String getSourceFrom() {

+ 28 - 21
mec-biz/src/main/resources/config/mybatis/EmployeeInfoMapper.xml

@@ -18,12 +18,12 @@
 		<result column="live_city_" property="liveCity" />
 		<result column="intention_city_" property="intentionCity" />
 		<result column="educational_background_" property="educationalBackground" />
-		<result column="subject_id_" property="subjectId" />
-		<result column="is_interviewed_" property="isInterviewed" />
+		<result column="subject_id_list_" property="subjectIdList" />
+		<result column="assessment_result_" property="assessmentResult" />
 		<result column="other_comment_" property="otherComment" />
 		<result column="entry_date_" property="entryDate" />
 		<result column="position_" property="position" typeHandler="com.ym.mec.common.dal.CustomEnumTypeHandler" />
-		<result column="job_nature_" property="jobNature" typeHandler="com.ym.mec.common.dal.CustomEnumTypeHandler" />
+		<result column="status_" property="status" typeHandler="com.ym.mec.common.dal.CustomEnumTypeHandler" />
 		<result column="is_probation_period_" property="isProbationPeriod" />
 		<result column="bank_card_no_" property="bankCardNo" />
 		<result column="bank_address_" property="bankAddress" />
@@ -33,6 +33,9 @@
 		<result column="source_from_" property="sourceFrom" />
 		<result column="create_time_" property="createTime" />
 		<result column="update_time_" property="updateTime" />
+		<result column="organName" property="organName" />
+		<result column="subjectName" property="subjectName" />
+		<result column="operatorName" property="operatorName" />
 	</resultMap>
 
 	<!-- 根据主键查询一条记录 -->
@@ -53,8 +56,8 @@
 		<!-- <selectKey resultClass="int" keyProperty="id" > SELECT SEQ_WSDEFINITION_ID.nextval 
 			AS ID FROM DUAL </selectKey> -->
 		INSERT INTO employee_info
-		(id_,real_name_,mobile_no_,wechat_no_,id_card_,age_,gender_,birthdate_,emergency_contact_name_,emergency_contact_relation_,emergency_contact_phone_,live_city_,intention_city_,educational_background_,subject_id_,is_interviewed_,other_comment_,entry_date_,organ_id_,position_,job_nature_,is_probation_period_,bank_card_no_,bank_address_,resignation_date_,operator_id_,source_from_,create_time_,update_time_)
-		VALUES(#{id},#{realName},#{mobileNo},#{wechatNo},#{idCard},#{age},#{gender},#{birthdate},#{emergencyContactName},#{emergencyContactRelation},#{emergencyContactPhone},#{liveCity},#{intentionCity},#{educationalBackground},#{subjectId},#{isInterviewed},#{otherComment},#{entryDate},#{organId},#{position,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},#{jobNature,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},#{isProbationPeriod},#{bankCardNo},#{bankAddress},#{resignationDate},#{operatorId},#{sourceFrom},#{createTime},#{updateTime})
+		(id_,real_name_,mobile_no_,wechat_no_,id_card_,age_,gender_,birthdate_,emergency_contact_name_,emergency_contact_relation_,emergency_contact_phone_,live_city_,intention_city_,educational_background_,subject_id_list_,assessment_result_,other_comment_,entry_date_,organ_id_,position_,status_,is_probation_period_,bank_card_no_,bank_address_,resignation_date_,operator_id_,source_from_,create_time_,update_time_)
+		VALUES(#{id},#{realName},#{mobileNo},#{wechatNo},#{idCard},#{age},#{gender},#{birthdate},#{emergencyContactName},#{emergencyContactRelation},#{emergencyContactPhone},#{liveCity},#{intentionCity},#{educationalBackground},#{subjectIdList},#{assessmentResult},#{otherComment},#{entryDate},#{organId},#{position,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},#{status,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},#{isProbationPeriod},#{bankCardNo},#{bankAddress},#{resignationDate},#{operatorId},#{sourceFrom},#{createTime},#{updateTime})
 	</insert>
 
 	<!-- 根据主键查询一条记录 -->
@@ -64,8 +67,8 @@
 			<if test="isProbationPeriod != null">
 				is_probation_period_ = #{isProbationPeriod},
 			</if>
-			<if test="subjectId != null">
-				subject_id_ = #{subjectId},
+			<if test="subjectIdList != null">
+				subject_id_list_ = #{subjectIdList},
 			</if>
 			<if test="gender != null">
 				gender_ = #{gender},
@@ -76,8 +79,8 @@
 			<if test="otherComment != null">
 				other_comment_ = #{otherComment},
 			</if>
-			<if test="jobNature != null">
-				job_nature_ = #{jobNature,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},
+			<if test="status != null">
+				status_ = #{status,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},
 			</if>
 			<if test="educationalBackground != null">
 				educational_background_ = #{educationalBackground},
@@ -124,8 +127,8 @@
 			<if test="wechatNo != null">
 				wechat_no_ = #{wechatNo},
 			</if>
-			<if test="isInterviewed != null">
-				is_interviewed_ = #{isInterviewed},
+			<if test="assessmentResult != null">
+				assessment_result_ = #{assessmentResult},
 			</if>
 			<if test="mobileNo != null">
 				mobile_no_ = #{mobileNo},
@@ -160,37 +163,41 @@
 	<sql id="queryPageMap">
 		<where>
 			<if test="organId != null">
-            	AND organ_id_ = #{organId}
+            	AND ei.organ_id_ = #{organId}
 	        </if>
 	        <if test="userNameOrIdOrMobile != null">
-	            AND (real_name_ LIKE CONCAT('%',#{userNameOrIdOrMobile},'%') OR mobile_no_ LIKE CONCAT('%',#{userNameOrIdOrMobile},'%') OR id_ = #{userNameOrIdOrMobile})
+	            AND (ei.real_name_ LIKE CONCAT('%',#{userNameOrIdOrMobile},'%') OR ei.mobile_no_ LIKE CONCAT('%',#{userNameOrIdOrMobile},'%') OR ei.id_ = #{userNameOrIdOrMobile})
 	        </if>
 	        <if test="subjectId != null">
-	            AND subject_id_ = #{subjectId}
+	            AND find_in_set(#{subjectId},ei.subject_id_list_)
 	        </if>
 	        <if test="sourceFrom != null">
-	            AND source_from_ = #{sourceFrom}
+	            AND ei.source_from_ = #{sourceFrom}
 	        </if>
 	        <if test="position != null">
-	            AND position_ = #{position,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler}
+	            AND ei.position_ = #{position,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler}
 	        </if>
-	        <if test="jobNature != null">
-	            AND job_nature_ = #{jobNature,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler}
+	        <if test="status != null">
+	            AND ei.status_ = #{status,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler}
 	        </if>
 		</where>
     </sql>
 
 	<!-- 分页查询 -->
 	<select id="queryPage" resultMap="EmployeeInfo" parameterType="map">
-		SELECT * FROM employee_info 
+		SELECT o.name_ organName,group_concat(s.name_) subjectName,u.real_name_ operatorName,ei.* FROM employee_info ei
+		left join subject s on find_in_set(s.id_,ei.subject_id_list_)
+		left join organization o on o.id_ = ei.organ_id_
+		left join sys_user u on u.id_ = ei.operator_id_
         <include refid="queryPageMap"/>
-		ORDER BY id_
+        GROUP BY ei.id_
+		ORDER BY ei.update_time_
 		<include refid="global.limit" />
 	</select>
 
 	<!-- 查询当前表的总记录数 -->
 	<select id="queryCount" resultType="int">
-		SELECT COUNT(*) FROM employee_info
+		SELECT COUNT(ei.id_) FROM employee_info ei
         <include refid="queryPageMap"/>
 	</select>
 </mapper>