zhoulisky il y a 9 mois
Parent
commit
f973a8defb

+ 10 - 4
kd-service/kd-scientific/src/main/java/org/sky/scientific/mapper/TechnicianMapper.java

@@ -21,20 +21,26 @@ import java.util.List;
 public interface TechnicianMapper extends BaseMapper<TechnicianEntity> {
 public interface TechnicianMapper extends BaseMapper<TechnicianEntity> {
 
 
 	/**
 	/**
-	 * 自定义分页
+	 * 分页-按月
 	 *
 	 *
 	 * @param page       分页参数
 	 * @param page       分页参数
 	 * @param technician 查询参数
 	 * @param technician 查询参数
 	 * @return List<TechnicianVO>
 	 * @return List<TechnicianVO>
 	 */
 	 */
-	List<TechnicianVO> selectTechnicianPage(IPage page, @Param("technician") TechnicianDTO technician);
+	List<TechnicianVO> selectTechnicianPage(IPage<TechnicianVO> page, @Param("ew") TechnicianDTO technician);
+
+	/**
+	 * 分页-按年
+	 * @param page
+	 * @param technician
+	 * @return
+	 */
+	List<TechnicianVO> selectByYear(IPage<TechnicianVO> page,@Param("ew") TechnicianDTO technician);
 
 
 	TechnicianEntity selectByUnicodeAndYearAndMonth(@Param("unicode") String unicode, @Param("yearAndMonth") String yearAndMonth);
 	TechnicianEntity selectByUnicodeAndYearAndMonth(@Param("unicode") String unicode, @Param("yearAndMonth") String yearAndMonth);
 
 
 	String getUnicodeByNumberAndIdentityCard(@Param("number") String number, @Param("idCard") String idCard);
 	String getUnicodeByNumberAndIdentityCard(@Param("number") String number, @Param("idCard") String idCard);
 
 
-	List<TechnicianVO> selectByYear(@Param("technician") TechnicianDTO technician);
-
 	List<TechnicianEntity> selectByDateInterval(IPage page, @Param("param") HashMap<String,String> param);
 	List<TechnicianEntity> selectByDateInterval(IPage page, @Param("param") HashMap<String,String> param);
 
 
 	String getNameById(@Param("technicianId") Long technicianId);
 	String getNameById(@Param("technicianId") Long technicianId);

+ 32 - 32
kd-service/kd-scientific/src/main/java/org/sky/scientific/mapper/TechnicianMapper.xml

@@ -54,26 +54,26 @@
             parameterType="org.sky.scientific.pojo.dto.TechnicianDTO">
             parameterType="org.sky.scientific.pojo.dto.TechnicianDTO">
         select *
         select *
         from kd_technician
         from kd_technician
-        where is_deleted = 0 and year_and_month = #{technician.yearAndMonth}
-        <if test="technician.name!=null and technician.name!=''">and name like concat(concat('%', #{technician.name}),
+        where is_deleted = 0 and year_and_month = #{ew.yearAndMonth}
+        <if test="ew.name!=null and ew.name!=''">and name like concat(concat('%', #{ew.name}),
             '%')
             '%')
         </if>
         </if>
-        <if test="technician.number!=null and technician.number!=''">and number like concat(concat('%',#{technician.number}), '%')
+        <if test="ew.number!=null and ew.number!=''">and number like concat(concat('%',#{ew.number}), '%')
         </if>
         </if>
-        <if test="technician.idCard!=null and technician.idCard!=''">and id_card like concat(concat('%', #{technician.idCard}), '%')
+        <if test="ew.idCard!=null and ew.idCard!=''">and id_card like concat(concat('%', #{ew.idCard}), '%')
         </if>
         </if>
-        <if test="technician.department!=null and technician.department!=''">and department like concat(concat('%',#{technician.department}), '%')
+        <if test="ew.department!=null and ew.department!=''">and department like concat(concat('%',#{ew.department}), '%')
         </if>
         </if>
-        <if test="technician.post!=null and technician.post!=''">and post like concat(concat('%', #{technician.post}),'%')</if>
-        <if test="technician.postLocation!=null and technician.postLocation!=''">and post_location like concat(concat('%', #{technician.postLocation}), '%')</if>
-        <if test="technician.nature!=null and technician.nature!=''">and nature = #{technician.nature}</if>
-        <if test="technician.education!=null and technician.education!=''">and education = #{technician.education}</if>
-        <if test="technician.degree!=null and technician.degree!=''">and degree = #{technician.degree}</if>
-        <if test="technician.rank!=null and technician.rank!=''">and rank = #{technician.rank}</if>
-        <if test="technician.personnelType!=null and technician.personnelType!=''">and personnel_type = #{technician.personnelType}</if>
-        <if test="technician.situation !=null and technician.situation!=''">and situation = #{technician.situation}</if>
-        <if test="technician.practicingRequirement !=null and technician.practicingRequirement!=''">and practicing_requirement like concat(concat('%', #{technician.practicingRequirement}), '%')</if>
-        <if test="technician.hireDateMin!=null and technician.hireDateMax!=''">and hire_Date between #{technician.hireDateMin} and #{technician.hireDateMax}</if>
+        <if test="ew.post!=null and ew.post!=''">and post like concat(concat('%', #{ew.post}),'%')</if>
+        <if test="ew.postLocation!=null and ew.postLocation!=''">and post_location like concat(concat('%', #{ew.postLocation}), '%')</if>
+        <if test="ew.nature!=null and ew.nature!=''">and nature = #{ew.nature}</if>
+        <if test="ew.education!=null and ew.education!=''">and education = #{ew.education}</if>
+        <if test="ew.degree!=null and ew.degree!=''">and degree = #{ew.degree}</if>
+        <if test="ew.rank!=null and ew.rank!=''">and rank = #{ew.rank}</if>
+        <if test="ew.personnelType!=null and ew.personnelType!=''">and personnel_type = #{ew.personnelType}</if>
+        <if test="ew.situation !=null and ew.situation!=''">and situation = #{ew.situation}</if>
+        <if test="ew.practicingRequirement !=null and ew.practicingRequirement!=''">and practicing_requirement like concat(concat('%', #{ew.practicingRequirement}), '%')</if>
+        <if test="ew.hireDateMin!=null and ew.hireDateMax!=''">and hire_Date between #{ew.hireDateMin} and #{ew.hireDateMax}</if>
         order by year_and_month asc, id asc
         order by year_and_month asc, id asc
     </select>
     </select>
 
 
@@ -84,24 +84,24 @@
         (
         (
             SELECT unicode,MAX(year_and_month) as maxMonth
             SELECT unicode,MAX(year_and_month) as maxMonth
             from kd_technician
             from kd_technician
-            where left(year_and_month,4) = #{technician.yearAndMonth}
+            where left(year_and_month,4) = #{ew.yearAndMonth}
             GROUP BY unicode
             GROUP BY unicode
         ) s on t1.year_and_month = s.maxMonth and t1.unicode=s.unicode
         ) s on t1.year_and_month = s.maxMonth and t1.unicode=s.unicode
-        where left(t1.year_and_month,4) = #{technician.yearAndMonth}
-        <if test="technician.name!=null and technician.name!=''">and name like concat(concat('%', #{technician.name}),'%')</if>
-        <if test="technician.number!=null and technician.number!=''">and number like concat(concat('%',#{technician.number}), '%')</if>
-        <if test="technician.idCard!=null and technician.idCard!=''">and id_card like concat(concat('%', #{technician.idCard}), '%')</if>
-        <if test="technician.department!=null and technician.department!=''">and department like concat(concat('%',#{technician.department}), '%')</if>
-        <if test="technician.post!=null and technician.post!=''">and post like concat(concat('%', #{technician.post}),'%')</if>
-        <if test="technician.postLocation!=null and technician.postLocation!=''">and post_location like concat(concat('%', #{technician.postLocation}), '%')</if>
-        <if test="technician.nature!=null and technician.nature!=''">and nature = #{technician.nature}</if>
-        <if test="technician.education!=null and technician.education!=''">and education = #{technician.education}</if>
-        <if test="technician.degree!=null and technician.degree!=''">and degree = #{technician.degree}</if>
-        <if test="technician.rank!=null and technician.rank!=''">and rank = #{technician.rank}</if>
-        <if test="technician.personnelType!=null and technician.personnelType!=''">and personnel_type = #{technician.personnelType}</if>
-        <if test="technician.situation !=null and technician.situation!=''">and situation = #{technician.situation}</if>
-        <if test="technician.practicingRequirement !=null and technician.practicingRequirement!=''">and practicing_requirement like concat(concat('%', #{technician.practicingRequirement}), '%')</if>
-        <if test="technician.hireDateMin!=null and technician.hireDateMax!=''">and hire_Date between #{technician.hireDateMin} and #{technician.hireDateMax}</if>
+        where left(t1.year_and_month,4) = #{ew.yearAndMonth}
+        <if test="ew.name!=null and ew.name!=''">and name like concat(concat('%', #{ew.name}),'%')</if>
+        <if test="ew.number!=null and ew.number!=''">and number like concat(concat('%',#{ew.number}), '%')</if>
+        <if test="ew.idCard!=null and ew.idCard!=''">and id_card like concat(concat('%', #{ew.idCard}), '%')</if>
+        <if test="ew.department!=null and ew.department!=''">and department like concat(concat('%',#{ew.department}), '%')</if>
+        <if test="ew.post!=null and ew.post!=''">and post like concat(concat('%', #{ew.post}),'%')</if>
+        <if test="ew.postLocation!=null and ew.postLocation!=''">and post_location like concat(concat('%', #{ew.postLocation}), '%')</if>
+        <if test="ew.nature!=null and ew.nature!=''">and nature = #{ew.nature}</if>
+        <if test="ew.education!=null and ew.education!=''">and education = #{ew.education}</if>
+        <if test="ew.degree!=null and ew.degree!=''">and degree = #{ew.degree}</if>
+        <if test="ew.rank!=null and ew.rank!=''">and rank = #{ew.rank}</if>
+        <if test="ew.personnelType!=null and ew.personnelType!=''">and personnel_type = #{ew.personnelType}</if>
+        <if test="ew.situation !=null and ew.situation!=''">and situation = #{ew.situation}</if>
+        <if test="ew.practicingRequirement !=null and ew.practicingRequirement!=''">and practicing_requirement like concat(concat('%', #{ew.practicingRequirement}), '%')</if>
+        <if test="ew.hireDateMin!=null and ew.hireDateMax!=''">and hire_Date between #{ew.hireDateMin} and #{ew.hireDateMax}</if>
     </select>
     </select>
 
 
     <select id="selectByDateInterval" resultMap="ResultMap" parameterType="java.util.Map">
     <select id="selectByDateInterval" resultMap="ResultMap" parameterType="java.util.Map">
@@ -156,7 +156,7 @@
         <if test="ew.degree !=null and ew.degree!=''">and t.degree = #{ew.degree}</if>
         <if test="ew.degree !=null and ew.degree!=''">and t.degree = #{ew.degree}</if>
         <if test="ew.rank !=null and ew.rank!=''">and t.rank like concat('%',#{ew.rank}, '%')</if>
         <if test="ew.rank !=null and ew.rank!=''">and t.rank like concat('%',#{ew.rank}, '%')</if>
         <if test="ew.practicingRequirement !=null and ew.practicingRequirement!=''">and t.practicing_requirement like concat('%',#{ew.practicingRequirement}, '%')</if>
         <if test="ew.practicingRequirement !=null and ew.practicingRequirement!=''">and t.practicing_requirement like concat('%',#{ew.practicingRequirement}, '%')</if>
-        <if test="ew.hireStartDate!=null and ew.hireEndDate!=''">and hire_Date between #{ew.hireStartDate} and #{ew.hireEndDate}</if>
+        <if test="ew.hireDateMin!=null and ew.hireDateMax!=''">and hire_Date between #{ew.hireDateMin} and #{ew.hireDateMax}</if>
         GROUP BY h.unicode
         GROUP BY h.unicode
         HAVING workDaysByYear > 18
         HAVING workDaysByYear > 18
     </select>
     </select>

+ 1 - 1
kd-service/kd-scientific/src/main/java/org/sky/scientific/service/impl/TechnicianServiceImpl.java

@@ -98,7 +98,7 @@ public class TechnicianServiceImpl extends BaseServiceImpl<TechnicianMapper, Tec
 		}
 		}
 		List<TechnicianVO> voList = null;
 		List<TechnicianVO> voList = null;
 		if (technician.getYearAndMonth().length() == 4) {
 		if (technician.getYearAndMonth().length() == 4) {
-			voList = baseMapper.selectByYear(technician);
+			voList = baseMapper.selectByYear(page,technician);
 		} else if (technician.getYearAndMonth().length() == 6) {
 		} else if (technician.getYearAndMonth().length() == 6) {
 			voList = baseMapper.selectTechnicianPage(page, technician);
 			voList = baseMapper.selectTechnicianPage(page, technician);
 		} else {
 		} else {