2023-05-12 16:02:05 完成用户所属策略下拉列表接口!

master
魔神煜修罗皇 2 years ago
parent b58b530a62
commit 0eb66b5b9c
  1. 6
      psdc-business/src/main/java/com/psdc/entity/PsdcDevice.java
  2. 5
      psdc-business/src/main/java/com/psdc/service/impl/PsdcDeviceServiceImpl.java
  3. 15
      psdc-business/src/main/resources/mapper/business/PsdcDeviceMapper.xml

@ -20,11 +20,15 @@ public class PsdcDevice {
/** 设备id */
@Excel(name = "设备Id", cellType = Excel.ColumnType.NUMERIC)
private Integer deviceId ;
/** 父设备Id */
private Integer parentId;
/** 用户id */
private Integer userId ;
/** 用户名称 */
@Excel(name = "用户名称")
private String userName ;
/** 设备是否可控 */
private Integer isControl;
/** 设备类型:1-监测设备,2-运行设备 */
private Integer deviceType ;
@ -49,6 +53,8 @@ public class PsdcDevice {
/** 启用时间 */
@Excel(name = "启用时间")
private String startTime ;
/** 设备模型 */
private String deviceModel;
/** 设备状态:1-未激活,2-禁用,3-在线,4-离线 */
private Integer deviceStatus ;

@ -49,12 +49,7 @@ public class PsdcDeviceServiceImpl implements IPsdcDeviceService {
/**
* 根据用户id查询设备列表
<<<<<<< HEAD
* @return 设备列表
=======
*
* @return
>>>>>>> e7257650302fdf30d685bfae8df3cc0405bb51f6
*/
public List<PsdcDevice> queryByUserId() {
return psdcDeviceMapper.queryByUserId(SecurityUtils.getUserId());

@ -3,10 +3,13 @@
<mapper namespace="com.psdc.mapper.PsdcDeviceMapper">
<resultMap type="com.psdc.entity.PsdcDevice" id="PsdcDeviceMap">
<result property="deviceId" column="device_id" />
<result property="parentId" column="parent_id" />
<result property="userId" column="user_id" />
<result property="deviceType" column="device_type" />
<result property="deviceModel" column="device_model" />
<result property="deviceSn" column="device_sn" />
<result property="deviceName" column="device_name" />
<result property="isControl" column="is_control" />
<result property="hardVersion" column="hard_version" />
<result property="softVersion" column="soft_version" />
<result property="deviceAddress" column="device_address" />
@ -37,7 +40,7 @@
<!-- 通过ID查询单条数据 -->
<select id="queryById" resultMap="PsdcDeviceMap">
select device_id,
select device_id, parent_id, device_model, is_control,
user_id,
device_type,
device_sn,
@ -70,7 +73,7 @@
</select>
<select id="queryByUserId" resultMap="PsdcDeviceMap">
select device_id,
select device_id, parent_id, device_model, is_control,
user_id,
device_type,
device_sn,
@ -93,7 +96,7 @@
<!--分页查询指定行数据-->
<select id="queryAllByLimit" resultMap="PsdcDeviceMap">
select
device_id,user_id,device_type,device_sn,device_name,hard_version,soft_version,device_address,start_time,device_status,device_runstatus,photo_url,create_by,create_time,update_by,update_time
device_id, parent_id, device_model, is_control, user_id, device_type,device_sn,device_name,hard_version,soft_version,device_address,start_time,device_status,device_runstatus,photo_url,create_by,create_time,update_by,update_time
from psdc_device
<where>
<if test="deviceId != null and deviceId != ''">
@ -205,16 +208,16 @@
<!--新增数据-->
<insert id="insert">
insert into psdc_device(user_id, device_type, device_sn, device_name, hard_version, soft_version,
insert into psdc_device(user_id, device_type, parent_id, device_model, is_control, device_sn, device_name, hard_version, soft_version,
device_address, start_time, device_status, device_runstatus, photo_url, create_by,
create_time, update_by, update_time)
values (#{userId}, #{deviceType}, #{deviceSn}, #{deviceName}, #{hardVersion}, #{softVersion}, #{deviceAddress},
values (#{userId}, #{deviceType}, #{deviceModel},#{parentId},#{isControl, #{deviceSn}, #{deviceName}, #{hardVersion}, #{softVersion}, #{deviceAddress},
#{startTime}, #{deviceStatus}, #{deviceRunstatus}, #{photoUrl}, #{createBy}, #{createTime}, #{updateBy},
#{updateTime})
</insert>
<insert id="saveDevicesData" parameterType="com.psdc.entity.PsdcDevice" useGeneratedKeys="true">
Insert into psdc_device(user_id, device_type, device_sn, device_name, hard_version, soft_version,
Insert into psdc_device(user_id, device_type, device_sn, parent_id, device_model, is_control, device_name, hard_version, soft_version,
device_address, start_time, device_status, device_runstatus, photo_url, create_by,
create_time, update_by, update_time)
Values

Loading…
Cancel
Save