LiGuang 2 роки тому
батько
коміт
91fa9221ec

+ 1 - 1
jeecg-boot-module-demo/src/main/java/org/jeecg/modules/geke/userShift/mapper/UserShiftMapper.java

@@ -25,7 +25,7 @@ public interface UserShiftMapper extends BaseMapper<UserShift> {
     //根据已有排班人员筛选未排班人员
     List<Map<String,Object>>getUserNot(Page<Map<String,Object>> page,@Param("userids")List<String>userids,@Param("deptids") List<String>deptids,@Param("realname")String realname,@Param("dept")String dept);
 
-  List<Map<String,Object>>getUserByids(@Param("ids")List<String>ids);
+  List<Map<String,Object>>getUserByids(@Param("ids")List<String>ids,@Param("date")String date);
     /**
      * 根据用户id和时间查询用户当天是否排班
      * @param userid

+ 4 - 2
jeecg-boot-module-demo/src/main/java/org/jeecg/modules/geke/userShift/mapper/xml/UserShiftMapper.xml

@@ -91,8 +91,7 @@ order by a.shift_date desc
             and d.id= #{dept}
         </if>
 <if test="date!=null and ''!=date">
-    and ((b.employment_status='30' and date_format(b.term_Date,'%Y-%m')>=date_format(#{date},'%Y-%m')) or	(date_format(#{date},'%Y-%m')>=date_format(b.entry_Date,'%Y-%m') and b.employment_status='10'))
-
+    and ((b.employment_status='30' and date_format(b.term_Date,'%Y-%m')>=date_format(#{date},'%Y-%m') and date_format(#{date},'%Y-%m')>=date_format(b.entry_Date,'%Y-%m')) or	(date_format(#{date},'%Y-%m')>=date_format(b.entry_Date,'%Y-%m') and b.employment_status='10'))
 </if>
 )  a
     </select>
@@ -195,6 +194,9 @@ order by a.shift_date desc
                 #{id}
             </foreach>
         </if>
+        <if test="date!=null and ''!=date">
+            and ((employment_status='30' and date_format(term_Date,'%Y-%m')>=date_format(#{date},'%Y-%m') and date_format(#{date},'%Y-%m')>=date_format(entry_Date,'%Y-%m')) or	(date_format(#{date},'%Y-%m')>=date_format(entry_Date,'%Y-%m') and employment_status='10'))
+        </if>
     </select>
     <select id="listByShiftId" resultType="org.jeecg.modules.geke.userShift.entity.UserShift">
         select a.*from geke_user_shift a

+ 1 - 1
jeecg-boot-module-demo/src/main/java/org/jeecg/modules/geke/userShift/service/impl/UserShiftServiceImpl.java

@@ -213,7 +213,7 @@ public class UserShiftServiceImpl extends ServiceImpl<UserShiftMapper, UserShift
         if (oConvertUtils.isNotEmpty(userid)){
             arr=Arrays.asList(userid.split(","));
         }
-        List<Map<String, Object>> userByids = userShiftMapper.getUserByids(arr);
+        List<Map<String, Object>> userByids = userShiftMapper.getUserByids(arr,date);
         if (!type.equals("2")){
             if (userByids!=null){
                 for (int i = 1; i <= actualMaximum; i++) {