Commit 69815ecf authored by 罗可心's avatar 罗可心 😕 Committed by 王琮

导入员工修复,通道管理查询与导出功能修复

parent c2f339b6
......@@ -8,6 +8,8 @@ import lombok.*;
import org.rcisoft.core.entity.CyIdIncreEntity;
import org.springframework.data.annotation.Transient;
import java.util.Date;
/**
* Created with cy on 2022年12月23日 下午2:04:50.
*/
......@@ -16,7 +18,10 @@ import org.springframework.data.annotation.Transient;
public class DoorDeviceInfo extends CyIdIncreEntity<DoorDeviceInfo> {
//id
private Integer id;
//设备所在地址中文
/**
* 设备所在地址中文(前端显示:所在位置)
*/
@Excel(name = "通道名称",orderNum = "1", width = 30)
private String deviceAddressLabel;
//排序
......@@ -58,16 +63,19 @@ public class DoorDeviceInfo extends CyIdIncreEntity<DoorDeviceInfo> {
private String endTime;
/**
* @desc 设备imei码
* @desc 设备imei码(前端显示:门磁设备编号)
* @column device_imei
* @default
*/
@Excel(name = "门磁设备编号",orderNum = "2", width = 20)
private String deviceImei;
/**
* @desc 设备名称
* @desc 设备名称(前端显示:通道名称)
* @column device_name
* @default
*/
@Excel(name = "通道名称",orderNum = "3", width = 20)
private String deviceName;
/**
* @desc 设备所在地址
......@@ -76,16 +84,18 @@ public class DoorDeviceInfo extends CyIdIncreEntity<DoorDeviceInfo> {
*/
private String deviceAddress;
/**
* @desc 设备所在区域
* @desc 设备所在区域(前端显示:所在楼层)
* @column device_area
* @default
*/
@Excel(name = "所在楼层",orderNum = "4", width = 20)
private String deviceArea;
/**
* @desc 设备所在点位
* @column device_point
* @default
*/
@Excel(name = "所在点位",orderNum = "5", width = 20)
private String devicePoint;
......@@ -96,5 +106,23 @@ public class DoorDeviceInfo extends CyIdIncreEntity<DoorDeviceInfo> {
*/
private Long linkVideoId;
/**
* 上报时间
*/
@Excel(name = "设备上报时间", format ="yyyy/MM/dd HH:mm:ss",orderNum = "6", width = 20)
private Date reportTime;
/**
* 抓拍图像
*/
private String capturePic;
/**
* 设备上班数据内容 (告警原因)
*/
@Excel(name = "告警原因",orderNum = "7", width = 20)
private String dataVal;
}
......@@ -69,4 +69,7 @@ public class ExportUserDTO extends CyIdIncreEntity<SysUser> {
//班次中文
private String nltBzLabel;
//是否显示考勤 默认0 (0-是,1-否)
private String attendanceShow;
}
......@@ -157,6 +157,12 @@ public class SysUser extends CyIdIncreEntity<SysUser> {
@Excel(name = "用户性别", orderNum = "6", width = 20)
private String sex;
/**
* @desc 是否显示考勤(0是 1否)
* @column attendance_show
* @default 0
*/
private String attendanceShow;
/**
......
......@@ -395,6 +395,8 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserRepositorys, SysUser>
ArrayList<SysUser> list = new ArrayList<>();
for (int i = 0; i < sysUserList.size(); i++) {
String deptId = sysUserList.get(i).getDeptId();
// 清空部门id 到处的数据有部门id
sysUserList.get(i).setDeptId("");
//根据部门id查询部门表
List<SysDept> sysDepts = sysDeptRepositorys.queryDeptById(deptId);
if (sysDepts.size() != 0) {
......@@ -592,6 +594,8 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserRepositorys, SysUser>
sysUser.setUserType("0");
//身份
sysUser.setIdentity("1");
// 是否显示考勤 默认(0-是)
sysUser.setAttendanceShow("0");
sysUser.setUsername(sysUser.getPhone());
sysUser.setCreateDate(new Date());
SysUser user = new SysUser();
......
......@@ -3,29 +3,68 @@
<mapper namespace="org.rcisoft.sys.doordeviceinfo.dao.DoorDeviceInfoRepository">
<resultMap id="BaseResultMap" type="org.rcisoft.sys.doordeviceinfo.entity.DoorDeviceInfo">
<id column="business_id" jdbcType="BIGINT" property="businessId"/>
<result column="device_imei" jdbcType="VARCHAR" property="deviceImei"/>
<result column="device_name" jdbcType="VARCHAR" property="deviceName"/>
<result column="device_address" jdbcType="VARCHAR" property="deviceAddress"/>
<result column="device_address_label" jdbcType="VARCHAR" property="deviceAddressLabel"/>
<result column="device_area" jdbcType="VARCHAR" property="deviceArea"/>
<result column="device_point" jdbcType="VARCHAR" property="devicePoint"/>
<result column="remark" jdbcType="VARCHAR" property="remarks"/>
<result column="link_video_id" jdbcType="BIGINT" property="linkVideoId"/>
<result column="del_flag" jdbcType="CHAR" property="delFlag"/>
<result column="report_time" jdbcType="TIMESTAMP" property="reportTime"/>
<result column="capture_pic" jdbcType="VARCHAR" property="capturePic"/>
<result column="data_val" jdbcType="VARCHAR" property="dataVal"/>
</resultMap>
<!--<cache type="${corePackag!}.util.RedisCache"/>-->
<!-- todo 导出-->
<select id="queryDoorDeviceInfos" resultMap="BaseResultMap">
select *
from door_device_info
where 1 = 1
SELECT drd.business_id AS id,
drd.report_time report_time,
drd.capture_pic capture_pic,
drd.data_val data_val,
ddi.device_address_label device_address_label,
ddi.*,drd.*
FROM door_report_data drd
LEFT JOIN door_device_info ddi ON ddi.business_id = drd.device_id
WHERE ddi.del_flag = 0
<if test="entity.flag !=null and entity.flag != '' ">
and ddi.flag = #{entity.flag}
</if>
<if test="entity.beginTime != null and entity.beginTime !='' "><!-- 开始时间检索 -->
and date_format(ddi.create_date,'%Y-%m-%d') &gt;= date_format(#{entity.beginTime},'%Y-%m-%d')
</if>
<if test="entity.endTime != null and entity.endTime !='' "><!-- 结束时间检索 -->
and date_format(ddi.create_date,'%Y-%m-%d') &lt;= date_format(#{entity.endTime},'%Y-%m-%d')
</if>
<if test="entity.deviceAddressLabel != null and entity.deviceAddressLabel != ''">
and ddi.device_address_label like concat('%', #{entity.deviceAddressLabel}, '%' )
</if>
<if test="entity.dataType !=null and entity.dataType != '' ">
and drd.data_type = #{entity.dataType}
</if>
<if test="entity.abnormal !=null and entity.abnormal != '' ">
and drd.abnormal = #{entity.abnormal}
</if>
<if test="entity.px == '1'.toString() "><!-- 排序-->
order BY drd.report_time desc
</if>
<if test="entity.px == '2'.toString() "><!-- 排序-->
ORDER BY ddi.device_address_label
</if>
</select>
<!-- todo 条件查询-->
<select id="queryDoorDeviceInfosPaged" resultMap="BaseResultMap">
SELECT drd.business_id AS id,ddi.*,drd.*
FROM door_device_info ddi
LEFT JOIN door_report_data drd ON ddi.business_id = drd.device_id
LEFT JOIN sys_dict_data sdd ON ddi.device_address = sdd.dict_value
SELECT drd.business_id AS id,
drd.report_time report_time,
drd.capture_pic capture_pic,
drd.data_val data_val,
ddi.device_address_label device_address_label,
ddi.*,drd.*
FROM door_report_data drd
LEFT JOIN door_device_info ddi ON ddi.business_id = drd.device_id
WHERE ddi.del_flag = 0
<if test="entity.flag !=null and entity.flag != '' ">
and ddi.flag = #{entity.flag}
......@@ -36,8 +75,8 @@
<if test="entity.endTime != null and entity.endTime !='' "><!-- 结束时间检索 -->
and date_format(ddi.create_date,'%Y-%m-%d') &lt;= date_format(#{entity.endTime},'%Y-%m-%d')
</if>
<if test="entity.deviceAddress !=null and entity.deviceAddress != '' ">
and ddi.device_address = #{entity.deviceAddress}
<if test="entity.deviceAddressLabel != null and entity.deviceAddressLabel != ''">
and ddi.device_address_label like concat('%', #{entity.deviceAddressLabel}, '%' )
</if>
<if test="entity.dataType !=null and entity.dataType != '' ">
and drd.data_type = #{entity.dataType}
......@@ -46,10 +85,10 @@
and drd.abnormal = #{entity.abnormal}
</if>
<if test="entity.px == '1'.toString() "><!-- 排序-->
order BY ddi.create_date desc
order BY drd.report_time desc
</if>
<if test="entity.px == '2'.toString() "><!-- 排序-->
ORDER BY sdd.dict_sort desc
ORDER BY ddi.device_address_label
</if>
</select>
......
......@@ -109,8 +109,10 @@
</resultMap>
<!--<cache type="${corePackag!}.util.RedisCache"/>-->
<select id="querySysUsers" resultMap="BaseResultMap">
select *
select distinct sdd.dict_sort,su.*
from sys_user su
LEFT JOIN sys_dict_data sdd
ON su.position = sdd.dict_value
where su.del_flag = 0
and su.user_type = 0
and (su.identity = 2 or su.identity = 1)
......@@ -140,13 +142,13 @@
</if>
<if test="entity.px == '1'.toString() "><!-- 排序-->
order BY su.create_date desc
order BY su.create_date desc , su.business_id
</if>
<if test="entity.px == '2'.toString() "><!-- 排序-->
order BY sdd.dict_sort desc
order BY sdd.dict_sort desc , su.business_id
</if>
<if test="entity.px == '3'.toString() "><!-- 排序-->
order BY F_GET_PYJM(su.name)
order BY F_GET_PYJM(su.name) , su.business_id
</if>
</select>
......@@ -198,13 +200,13 @@
</if>
<if test="entity.px == '1'.toString() "><!-- 排序-->
order BY su.create_date desc
order BY su.create_date desc, su.business_id
</if>
<if test="entity.px == '2'.toString() "><!-- 排序-->
order BY sdd.dict_sort desc
order BY sdd.dict_sort desc, su.business_id
</if>
<if test="entity.px == '3'.toString() "><!-- 排序-->
order BY F_GET_PYJM(su.name)
order BY F_GET_PYJM(su.name), su.business_id
</if>
</select>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment