yonge 5 роки тому
батько
коміт
b709872a66

+ 12 - 9
mec-biz/src/main/resources/config/mybatis/EmployeeInfoMapper.xml

@@ -160,37 +160,40 @@
 	<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 find_in_set(#{subjectId},subject_id_list_)
+	            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="status != null">
-	            AND status_ = #{status,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler}
+	            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_,group_concat(s.name_),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_
         <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>