LIVE_YE 2 өдөр өмнө
parent
commit
b23e0ca3be

+ 1 - 0
ruoyi-admin/src/main/java/com/ruoyi/web/controller/kaoqin/CardReplacementRecordController.java

@@ -109,6 +109,7 @@ public class CardReplacementRecordController extends BaseController
      * @return
      */
     @PostMapping(value = "/putPass")
+    @PreAuthorize("@ss.hasPermi('system:record:putPass')")
     public AjaxResult putPass(@RequestBody CardReplacementRecord cardReplacementRecord)
     {
         return toAjax(cardReplacementRecordService.putPass(cardReplacementRecord));

+ 61 - 6
ruoyi-admin/src/main/java/com/ruoyi/web/controller/kaoqin/KaoQinController.java

@@ -24,6 +24,8 @@ import java.math.RoundingMode;
 import java.util.*;
 import java.util.stream.Collectors;
 
+import static com.ruoyi.common.constant.CacheConstants.WEEK;
+
 /**
  * 实现考勤打卡
  *
@@ -169,15 +171,15 @@ public class KaoQinController extends BaseController {
         //查询传入月请假信息
         RecordLeave recordLeave = new RecordLeave();
         String month = kaoqinRecord.getKaYear()+"-"+kaoqinRecord.getKaMonth();
-        recordLeave.setStartTime(DateUtils.parseDate(month+"-"+"01 00:00:00"));
+        recordLeave.setStartTime(DateUtils.convertStringToDate(month+"-"+"01 00:00:00"));
         String fin = DateUtils.getLastDayOfMonth(Integer.parseInt(kaoqinRecord.getKaYear()), Integer.parseInt(kaoqinRecord.getKaMonth()));
-        recordLeave.setEndTime(DateUtils.parseDate(fin+" 23:59:59"));
+        recordLeave.setEndTime(DateUtils.convertStringToDate(fin+" 23:59:59"));
         recordLeave.setAbsenteeId(String.valueOf(kaoqinRecord.getUserId()));
         List<RecordLeave> recordLeaves = recordLeaveMapper.selectRecordLeaveList(recordLeave);
         //查询传入月出差信息
         BusinessTrip businessTrip = new BusinessTrip();
-        businessTrip.setStartTime(DateUtils.parseDate(month+"-"+"01 00:00:00"));
-        businessTrip.setEndTime(DateUtils.parseDate(fin+" 23:59:59"));
+        businessTrip.setStartTime(DateUtils.convertStringToDate(month+"-"+"01 00:00:00"));
+        businessTrip.setEndTime(DateUtils.convertStringToDate(fin+" 23:59:59"));
         businessTrip.setUserId(kaoqinRecord.getUserId());
         List<BusinessTrip> businessTrips = businessTripMapper.selectBusinessTripListLb(businessTrip);
 
@@ -190,14 +192,14 @@ public class KaoQinController extends BaseController {
                 List<BusinessTrip> businessList = new ArrayList<>();
                 //请假信息
                 for (RecordLeave recordLeaf : recordLeaves) {
-                    if(DateUtils.isDateBetween(DateUtils.parseDate(date), recordLeaf.getStartTime(), recordLeaf.getEndTime())) {
+                    if(DateUtils.isDateBetween(DateUtils.convertStringToDate(date), recordLeaf.getStartTime(), recordLeaf.getEndTime())) {
                         recordList.add(recordLeaf);
                     }
 
                 }
                 //出差信息
                 for (BusinessTrip trip : businessTrips) {
-                    if(DateUtils.isDateBetween(DateUtils.parseDate(date), trip.getStartTime(), trip.getEndTime())) {
+                    if(DateUtils.isDateBetween(DateUtils.convertStringToDate(date), trip.getStartTime(), trip.getEndTime())) {
                         businessList.add(trip);
                     }
 
@@ -596,4 +598,57 @@ public class KaoQinController extends BaseController {
         map.put("qk",qk);
         return map;
     }
+
+    /**
+     * 本周补卡统计
+     */
+    @PreAuthorize("@ss.hasPermi('kaoqin:statistics:weekBk')")
+    @GetMapping("/week/bk")
+    public AjaxResult weekBk() {
+        Map<String, Object> map = new HashMap();
+        //周一到周六的日期
+        List<String> weekDates = DateUtils.getWeekDatesFromMondayToSaturday();
+        List<String> weekName = Arrays.asList(WEEK);
+        //查询本周的补卡信息
+        List<CardReplacementRecord> cardReplacementRecordList = cardReplacementRecordMapper.selectCardReplacementRecordListWeek();
+        Map<String, List<CardReplacementRecord>> cardMap = cardReplacementRecordList.stream().collect(Collectors.groupingBy(CardReplacementRecord::getApplicationDate));
+        List<Integer> nums = new ArrayList<>();
+        for (int i = 0; i < weekDates.size(); i++) {
+            int num = 0;
+            if (cardMap.get(weekDates.get(i))!=null && !cardMap.get(weekDates.get(i)).isEmpty()) {
+                num = cardMap.get(weekDates.get(i)).size();
+            }
+            nums.add(num);
+        }
+        map.put("x",weekName);
+        map.put("y",nums);
+        return AjaxResult.success(map);
+    }
+
+    /**
+     * 本周请假统计
+     */
+    @PreAuthorize("@ss.hasPermi('kaoqin:statistics:weekQj')")
+    @GetMapping("/week/qj")
+    public AjaxResult weekQj() {
+        Map<String, Object> map = new HashMap();
+        //周一到周六的日期
+        List<String> weekDates = DateUtils.getWeekDatesFromMondayToSaturday();
+        List<String> weekName = Arrays.asList(WEEK);
+        //查询本周的请假信息
+        List<RecordLeave> recordLeaves = recordLeaveMapper.selectRecordLeaveListWeek();
+
+        List<Integer> nums = new ArrayList<>();
+        for (int i = 0; i < weekDates.size(); i++) {
+            int num = 0;
+            RecordLeave recordLeave = recordLeaves.get(i);
+            if(DateUtils.isDateBetween(DateUtils.convertStringToDate(weekDates.get(i)), recordLeave.getStartTime(), recordLeave.getEndTime())) {
+                num++;
+            }
+            nums.add(num);
+        }
+        map.put("x",weekName);
+        map.put("y",nums);
+        return AjaxResult.success(map);
+    }
 }

+ 5 - 0
ruoyi-common/src/main/java/com/ruoyi/common/constant/CacheConstants.java

@@ -59,4 +59,9 @@ public class CacheConstants
      * 登录账户密码错误次数 redis key
      */
     public static final String PWD_ERR_CNT_KEY = "pwd_err_cnt:";
+
+    /**
+     * 定时任务违规的字符
+     */
+    public static final String[] WEEK = { "周一", "周二", "周三", "周四", "周五", "周六" };
 }

+ 11 - 0
ruoyi-common/src/main/java/com/ruoyi/common/core/domain/entity/SysUser.java

@@ -52,6 +52,9 @@ public class SysUser extends BaseEntity
     /** 用户头像 */
     private String avatar;
 
+    /** 人脸照片 */
+    private String facePhoto;
+
     /** 密码 */
     private String password;
 
@@ -330,6 +333,14 @@ public class SysUser extends BaseEntity
         this.parameter = parameter;
     }
 
+    public String getFacePhoto() {
+        return facePhoto;
+    }
+
+    public void setFacePhoto(String facePhoto) {
+        this.facePhoto = facePhoto;
+    }
+
     @Override
     public String toString() {
         return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)

+ 44 - 0
ruoyi-common/src/main/java/com/ruoyi/common/utils/DateUtils.java

@@ -5,8 +5,12 @@ import java.text.ParseException;
 import java.text.SimpleDateFormat;
 import java.time.*;
 import java.time.format.DateTimeFormatter;
+import java.time.format.DateTimeParseException;
+import java.time.temporal.TemporalAdjusters;
+import java.util.ArrayList;
 import java.util.Calendar;
 import java.util.Date;
+import java.util.List;
 
 import org.apache.commons.lang3.time.DateFormatUtils;
 
@@ -117,6 +121,26 @@ public class DateUtils extends org.apache.commons.lang3.time.DateUtils {
         }
     }
 
+    /**
+     * 将字符串转换为Date对象(支持多种格式)
+     * @param dateString 日期字符串
+     * @return 对应的Date对象,解析失败返回null
+     */
+    public static Date convertStringToDate(String dateString) {
+        // 定义可能的日期格式(按优先级排序)
+
+        for (String pattern : parsePatterns) {
+            try {
+                DateTimeFormatter formatter = DateTimeFormatter.ofPattern(pattern);
+                LocalDate localDate = LocalDate.parse(dateString, formatter);
+                return Date.from(localDate.atStartOfDay(ZoneId.systemDefault()).toInstant());
+            } catch (DateTimeParseException e) {
+                // 尝试下一个格式
+            }
+        }
+        return null; // 所有格式都尝试失败
+    }
+
     /**
      * 获取服务器启动时间
      */
@@ -297,4 +321,24 @@ public class DateUtils extends org.apache.commons.lang3.time.DateUtils {
         return monthPadded;
     }
 
+    /**
+     * 获取本周周一至周六的日期字符串列表(格式:yyyy-MM-dd)
+     * @return 包含6个日期字符串的List
+     */
+    public static List<String> getWeekDatesFromMondayToSaturday() {
+        List<String> dates = new ArrayList<>(6);
+        DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd");
+
+        // 获取本周周一(如果今天是周一则返回今天)
+        LocalDate monday = LocalDate.now()
+                .with(TemporalAdjusters.previousOrSame(DayOfWeek.MONDAY));
+
+        // 添加周一到周六的日期字符串
+        for (int i = 0; i < 6; i++) {
+            dates.add(monday.plusDays(i).format(formatter));
+        }
+
+        return dates;
+    }
+
 }

+ 3 - 0
ruoyi-system/src/main/java/com/ruoyi/system/domain/BusinessTrip.java

@@ -8,6 +8,7 @@ import org.apache.commons.lang3.builder.ToStringBuilder;
 import org.apache.commons.lang3.builder.ToStringStyle;
 import com.ruoyi.common.annotation.Excel;
 import com.ruoyi.common.core.domain.BaseEntity;
+import org.springframework.format.annotation.DateTimeFormat;
 
 /**
  * 出差记录信息对象 business_trip
@@ -40,11 +41,13 @@ public class BusinessTrip extends BaseEntity
 
     /** 开始时间 */
     @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
     @Excel(name = "开始时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
     private Date startTime;
 
     /** 结束时间 */
     @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
     @Excel(name = "结束时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
     private Date endTime;
 

+ 3 - 0
ruoyi-system/src/main/java/com/ruoyi/system/domain/RecordLeave.java

@@ -8,6 +8,7 @@ import org.apache.commons.lang3.builder.ToStringBuilder;
 import org.apache.commons.lang3.builder.ToStringStyle;
 import com.ruoyi.common.annotation.Excel;
 import com.ruoyi.common.core.domain.BaseEntity;
+import org.springframework.format.annotation.DateTimeFormat;
 
 /**
  * 请假记录信息对象 record_leave
@@ -28,11 +29,13 @@ public class RecordLeave extends BaseEntity
 
     /** 请假开始时间 */
     @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
     @Excel(name = "请假开始时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
     private Date startTime;
 
     /** 请假结束时间 */
     @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
     @Excel(name = "请假结束时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
     private Date endTime;
 

+ 2 - 0
ruoyi-system/src/main/java/com/ruoyi/system/mapper/CardReplacementRecordMapper.java

@@ -58,4 +58,6 @@ public interface CardReplacementRecordMapper
      * @return 结果
      */
     public int deleteCardReplacementRecordByIds(Long[] ids);
+
+    List<CardReplacementRecord> selectCardReplacementRecordListWeek();
 }

+ 1 - 0
ruoyi-system/src/main/java/com/ruoyi/system/mapper/RecordLeaveMapper.java

@@ -60,4 +60,5 @@ public interface RecordLeaveMapper
      */
     public int deleteRecordLeaveByIds(Long[] ids);
 
+    List<RecordLeave> selectRecordLeaveListWeek();
 }

+ 16 - 6
ruoyi-system/src/main/java/com/ruoyi/system/service/impl/BusinessTripServiceImpl.java

@@ -49,7 +49,14 @@ public class BusinessTripServiceImpl implements IBusinessTripService
     @Override
     public BusinessTrip selectBusinessTripById(Long id)
     {
-        return businessTripMapper.selectBusinessTripById(id);
+        BusinessTrip businessTrip = businessTripMapper.selectBusinessTripById(id);
+
+        BusinessUser businessUser = new BusinessUser();
+        businessUser.setBusinessId(id);
+        List<BusinessUser> businessUsers = businessUserMapper.selectBusinessUserList(businessUser);
+        businessTrip.setBusinessUserList(businessUsers);
+
+        return businessTrip;
     }
 
     /**
@@ -99,11 +106,13 @@ public class BusinessTripServiceImpl implements IBusinessTripService
             for (int i = 0; i < businessUserList.size(); i++) {
                 BusinessUser businessUser = businessUserList.get(i);
 
-                sb.append(businessUser.getAbsenteeName()).append("、");
-                if(i == businessUserList.size() - 1){
+                if(i==0){
                     sb.append(businessUser.getAbsenteeName());
+                }else{
+                    sb.append("、").append(businessUser.getAbsenteeName());
                 }
 
+
                 businessUser.setBusinessId(businessTrip.getId());
                 //查询人员部门信息
                 SysUser sysUser = userMapper.selectUserById(businessUser.getAbsenteeId());
@@ -153,9 +162,10 @@ public class BusinessTripServiceImpl implements IBusinessTripService
             for (int i = 0; i < businessUserList.size(); i++) {
                 BusinessUser businessUser = businessUserList.get(i);
 
-                sb.append(businessUser.getAbsenteeName()).append("、");
-                if(i == businessUserList.size() - 1){
+                if(i==0){
                     sb.append(businessUser.getAbsenteeName());
+                }else{
+                    sb.append("、").append(businessUser.getAbsenteeName());
                 }
 
                 businessUser.setBusinessId(businessTrip.getId());
@@ -163,6 +173,7 @@ public class BusinessTripServiceImpl implements IBusinessTripService
                 SysUser sysUser = userMapper.selectUserById(businessUser.getAbsenteeId());
                 businessUser.setDeptId(sysUser.getDeptId());
                 businessUser.setDeptName(sysUser.getDept().getDeptName());
+                businessUser.setType("2");
                 businessUser.setSubmitTime(DateUtils.getNowDate());
                 businessUserMapper.insertBusinessUser(businessUser);
             }
@@ -170,7 +181,6 @@ public class BusinessTripServiceImpl implements IBusinessTripService
 
             //将随行人员放入主表
             businessTrip.setAbsenteeName(sb.toString());
-            businessTripMapper.updateBusinessTrip(businessTrip);
         }
 
         return businessTripMapper.updateBusinessTrip(businessTrip);

+ 5 - 1
ruoyi-system/src/main/resources/mapper/system/CardReplacementRecordMapper.xml

@@ -49,7 +49,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <include refid="selectCardReplacementRecordVo"/>
         where id = #{id}
     </select>
-        
+    <select id="selectCardReplacementRecordListWeek" parameterType="CardReplacementRecord" resultMap="CardReplacementRecordResult">
+        <include refid="selectCardReplacementRecordVo"/>
+        WHERE WEEK(application_date, 1) = WEEK(CURDATE(), 1);
+    </select>
+
     <insert id="insertCardReplacementRecord" parameterType="CardReplacementRecord" useGeneratedKeys="true" keyProperty="id">
         insert into card_replacement_record
         <trim prefix="(" suffix=")" suffixOverrides=",">

+ 8 - 1
ruoyi-system/src/main/resources/mapper/system/RecordLeaveMapper.xml

@@ -57,7 +57,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <include refid="selectRecordLeaveVo"/>
         where id = #{id}
     </select>
-        
+
+    <select id="selectRecordLeaveListWeek" parameterType="RecordLeave" resultMap="RecordLeaveResult">
+        <include refid="selectRecordLeaveVo"/>
+        WHERE
+        start_time &lt; DATE_ADD(DATE_SUB(CURDATE(),INTERVAL WEEKDAY(CURDATE()) DAY),INTERVAL 7 DAY)
+        AND end_time &gt;= DATE_SUB(CURDATE(),INTERVAL WEEKDAY(CURDATE()) DAY)
+    </select>
+
     <insert id="insertRecordLeave" parameterType="RecordLeave" useGeneratedKeys="true" keyProperty="id">
         insert into record_leave
         <trim prefix="(" suffix=")" suffixOverrides=",">

+ 10 - 6
ruoyi-system/src/main/resources/mapper/system/SysUserMapper.xml

@@ -13,6 +13,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <result property="phonenumber"  column="phonenumber"  />
         <result property="sex"          column="sex"          />
         <result property="avatar"       column="avatar"       />
+		<result property="facePhoto"       column="face_photo"       />
         <result property="password"     column="password"     />
         <result property="status"       column="status"       />
         <result property="delFlag"      column="del_flag"     />
@@ -50,7 +51,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     </resultMap>
 	
 	<sql id="selectUserVo">
-        select u.user_id, u.dept_id, u.user_name, u.nick_name, u.email, u.avatar, u.phonenumber, u.password, u.sex, u.status, u.del_flag, u.login_ip, u.login_date, u.create_by, u.create_time, u.remark, 
+        select u.user_id, u.dept_id, u.user_name, u.nick_name, u.email, u.avatar,u.face_photo, u.phonenumber, u.password, u.sex, u.status, u.del_flag, u.login_ip, u.login_date, u.create_by, u.create_time, u.remark,
         d.dept_id, d.parent_id, d.ancestors, d.dept_name, d.order_num, d.leader, d.status as dept_status,
         r.role_id, r.role_name, r.role_key, r.role_sort, r.data_scope, r.status as role_status
         from sys_user u
@@ -60,7 +61,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     </sql>
     
     <select id="selectUserList" parameterType="SysUser" resultMap="SysUserResult">
-		select u.user_id, u.dept_id, u.nick_name, u.user_name, u.email, u.avatar, u.phonenumber, u.sex, u.status, u.del_flag, u.login_ip, u.login_date, u.create_by, u.create_time, u.remark, d.dept_name, d.leader from sys_user u
+		select u.user_id, u.dept_id, u.nick_name, u.user_name, u.email, u.avatar,u.face_photo, u.phonenumber, u.sex, u.status, u.del_flag, u.login_ip, u.login_date, u.create_by, u.create_time, u.remark, d.dept_name, d.leader from sys_user u
 		left join sys_dept d on u.dept_id = d.dept_id
 		where u.del_flag = '0'
 		<if test="userId != null and userId != 0">
@@ -95,7 +96,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 	</select>
 	
 	<select id="selectAllocatedList" parameterType="SysUser" resultMap="SysUserResult">
-	    select distinct u.user_id, u.dept_id, u.user_name, u.nick_name, u.email, u.phonenumber, u.status, u.create_time
+	    select distinct u.user_id, u.dept_id, u.user_name, u.nick_name, u.face_photo,u.email, u.phonenumber, u.status, u.create_time
 	    from sys_user u
 			 left join sys_dept d on u.dept_id = d.dept_id
 			 left join sys_user_role ur on u.user_id = ur.user_id
@@ -112,7 +113,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 	</select>
 	
 	<select id="selectUnallocatedList" parameterType="SysUser" resultMap="SysUserResult">
-	    select distinct u.user_id, u.dept_id, u.user_name, u.nick_name, u.email, u.phonenumber, u.status, u.create_time
+	    select distinct u.user_id, u.dept_id, u.user_name, u.nick_name, u.face_photo,u.email, u.phonenumber, u.status, u.create_time
 	    from sys_user u
 			 left join sys_dept d on u.dept_id = d.dept_id
 			 left join sys_user_role ur on u.user_id = ur.user_id
@@ -168,6 +169,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
  			<if test="nickName != null and nickName != ''">nick_name,</if>
  			<if test="email != null and email != ''">email,</if>
  			<if test="avatar != null and avatar != ''">avatar,</if>
+			<if test="facePhoto != null and facePhoto != ''">face_photo,</if>
  			<if test="phonenumber != null and phonenumber != ''">phonenumber,</if>
  			<if test="sex != null and sex != ''">sex,</if>
  			<if test="password != null and password != ''">password,</if>
@@ -182,6 +184,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
  			<if test="nickName != null and nickName != ''">#{nickName},</if>
  			<if test="email != null and email != ''">#{email},</if>
  			<if test="avatar != null and avatar != ''">#{avatar},</if>
+			<if test="facePhoto != null and facePhoto != ''">#{facePhoto},</if>
  			<if test="phonenumber != null and phonenumber != ''">#{phonenumber},</if>
  			<if test="sex != null and sex != ''">#{sex},</if>
  			<if test="password != null and password != ''">#{password},</if>
@@ -202,6 +205,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
  			<if test="phonenumber != null ">phonenumber = #{phonenumber},</if>
  			<if test="sex != null and sex != ''">sex = #{sex},</if>
  			<if test="avatar != null and avatar != ''">avatar = #{avatar},</if>
+			<if test="facePhoto != null and facePhoto != ''">face_photo= #{facePhoto},</if>
  			<if test="password != null and password != ''">password = #{password},</if>
 			<if test="applyFor != null and applyFor != ''">apply_for = #{applyFor},</if>
  			<if test="status != null and status != ''">status = #{status},</if>
@@ -245,7 +249,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 
 
 	<select id="allocationList" parameterType="SysUser" resultMap="SysUserResult">
-		select u.user_id, u.dept_id, u.nick_name, u.user_name, u.email, u.avatar, u.phonenumber, u.sex, u.status, u.del_flag, u.login_ip, u.login_date, u.create_by, u.create_time, u.remark, d.dept_name, d.leader
+		select u.user_id, u.dept_id, u.nick_name, u.user_name,u.face_photo, u.email, u.avatar, u.phonenumber, u.sex, u.status, u.del_flag, u.login_ip, u.login_date, u.create_by, u.create_time, u.remark, d.dept_name, d.leader
 		from sys_user u
 		where u.del_flag = '0'
 		  and (u.dept_id = 0 or u.dept_id is null)
@@ -274,7 +278,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 	</select>
 
 	<select id="selectUserListNoDept" parameterType="SysUser" resultMap="SysUserResult">
-		select u.user_id, u.dept_id, u.nick_name, u.user_name, u.email, u.avatar, u.phonenumber, u.sex, u.status, u.del_flag, u.login_ip, u.login_date, u.create_by, u.create_time, u.remark, d.dept_name, d.leader, d.ancestors from sys_user u
+		select u.user_id, u.dept_id, u.nick_name, u.user_name, u.email, u.avatar,u.face_photo, u.phonenumber, u.sex, u.status, u.del_flag, u.login_ip, u.login_date, u.create_by, u.create_time, u.remark, d.dept_name, d.leader, d.ancestors from sys_user u
 		left join sys_dept d on u.dept_id = d.dept_id
 		where u.del_flag = '0'
 		  and u.dept_id !=0 and u.dept_id !='' and u.dept_id is not null