Commit 0d7b2ce3 by 14796

设备信息代码

parent c0bb5aa8
package share.system.service.impl; package share.system.service.impl;
import java.util.List; import java.util.List;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import share.common.utils.DateUtils; import share.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import share.common.utils.SecurityUtils;
import share.system.mapper.DeviceMapper; import share.system.mapper.DeviceMapper;
import share.system.domain.Device; import share.system.domain.Device;
import share.system.service.DeviceService; import share.system.service.DeviceService;
...@@ -16,8 +18,7 @@ import share.system.service.DeviceService; ...@@ -16,8 +18,7 @@ import share.system.service.DeviceService;
* @date 2023-11-04 * @date 2023-11-04
*/ */
@Service @Service
public class DeviceServiceImpl extends ServiceImpl<DeviceMapper, Device> implements DeviceService public class DeviceServiceImpl extends ServiceImpl<DeviceMapper, Device> implements DeviceService {
{
@Autowired @Autowired
private DeviceMapper deviceMapper; private DeviceMapper deviceMapper;
...@@ -28,8 +29,7 @@ public class DeviceServiceImpl extends ServiceImpl<DeviceMapper, Device> impleme ...@@ -28,8 +29,7 @@ public class DeviceServiceImpl extends ServiceImpl<DeviceMapper, Device> impleme
* @return 设备信息 * @return 设备信息
*/ */
@Override @Override
public Device selectDeviceById(Long id) public Device selectDeviceById(Long id) {
{
return deviceMapper.selectDeviceById(id); return deviceMapper.selectDeviceById(id);
} }
...@@ -40,8 +40,7 @@ public class DeviceServiceImpl extends ServiceImpl<DeviceMapper, Device> impleme ...@@ -40,8 +40,7 @@ public class DeviceServiceImpl extends ServiceImpl<DeviceMapper, Device> impleme
* @return 设备信息 * @return 设备信息
*/ */
@Override @Override
public List<Device> selectDeviceList(Device device) public List<Device> selectDeviceList(Device device) {
{
return deviceMapper.selectDeviceList(device); return deviceMapper.selectDeviceList(device);
} }
...@@ -52,9 +51,9 @@ public class DeviceServiceImpl extends ServiceImpl<DeviceMapper, Device> impleme ...@@ -52,9 +51,9 @@ public class DeviceServiceImpl extends ServiceImpl<DeviceMapper, Device> impleme
* @return 结果 * @return 结果
*/ */
@Override @Override
public int insertDevice(Device device) public int insertDevice(Device device) {
{
device.setCreateTime(DateUtils.getNowDate()); device.setCreateTime(DateUtils.getNowDate());
device.setCreateBy(SecurityUtils.getUsername());
return deviceMapper.insertDevice(device); return deviceMapper.insertDevice(device);
} }
...@@ -65,8 +64,7 @@ public class DeviceServiceImpl extends ServiceImpl<DeviceMapper, Device> impleme ...@@ -65,8 +64,7 @@ public class DeviceServiceImpl extends ServiceImpl<DeviceMapper, Device> impleme
* @return 结果 * @return 结果
*/ */
@Override @Override
public int updateDevice(Device device) public int updateDevice(Device device) {
{
device.setUpdateTime(DateUtils.getNowDate()); device.setUpdateTime(DateUtils.getNowDate());
return deviceMapper.updateDevice(device); return deviceMapper.updateDevice(device);
} }
...@@ -78,8 +76,7 @@ public class DeviceServiceImpl extends ServiceImpl<DeviceMapper, Device> impleme ...@@ -78,8 +76,7 @@ public class DeviceServiceImpl extends ServiceImpl<DeviceMapper, Device> impleme
* @return 结果 * @return 结果
*/ */
@Override @Override
public int deleteDeviceByIds(Long[] ids) public int deleteDeviceByIds(Long[] ids) {
{
return deviceMapper.deleteDeviceByIds(ids); return deviceMapper.deleteDeviceByIds(ids);
} }
...@@ -90,20 +87,19 @@ public class DeviceServiceImpl extends ServiceImpl<DeviceMapper, Device> impleme ...@@ -90,20 +87,19 @@ public class DeviceServiceImpl extends ServiceImpl<DeviceMapper, Device> impleme
* @return 结果 * @return 结果
*/ */
@Override @Override
public int deleteDeviceById(Long id) public int deleteDeviceById(Long id) {
{
return deviceMapper.deleteDeviceById(id); return deviceMapper.deleteDeviceById(id);
} }
/** /**
* 修改设备信息 * 修改设备信息
* 根据devid * 根据devid
*
* @param device 设备信息 * @param device 设备信息
* @return 结果 * @return 结果
*/ */
@Override @Override
public int updateDeviceByDevId(Device device) public int updateDeviceByDevId(Device device) {
{
device.setUpdateTime(DateUtils.getNowDate()); device.setUpdateTime(DateUtils.getNowDate());
return deviceMapper.updateDeviceByDevId(device); return deviceMapper.updateDeviceByDevId(device);
} }
......
...@@ -27,7 +27,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -27,7 +27,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</resultMap> </resultMap>
<sql id="selectDeviceGatewayVo"> <sql id="selectDeviceGatewayVo">
select id, dev_name, dev_mac, dev_id, dev_psw, dev_ver, dev_type, group, status, mqtt_iP, mqtt_port, mqtt_user, mqtt_paswd, create_by, create_time, update_by, update_time, remark, dev_position from s_device_gateway select id, dev_name, dev_mac, dev_id, dev_psw, dev_ver, dev_type, `group`, status, mqtt_iP, mqtt_port, mqtt_user, mqtt_paswd, create_by, create_time, update_by, update_time, remark, dev_position from s_device_gateway
</sql> </sql>
<select id="selectDeviceGatewayList" parameterType="DeviceGateway" resultMap="DeviceGatewayResult"> <select id="selectDeviceGatewayList" parameterType="DeviceGateway" resultMap="DeviceGatewayResult">
......
...@@ -28,7 +28,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -28,7 +28,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</resultMap> </resultMap>
<sql id="selectDeviceVo"> <sql id="selectDeviceVo">
select id, dev_name, dev_mac, dev_id, dev_psw, dev_ver, dev_type, projt_id, projt_psw, group, status, create_by, create_time, update_by, update_time, remark, dev_position, gateway_id, voltage, signal_value from s_device select id, dev_name, dev_mac, dev_id, dev_psw, dev_ver, dev_type, projt_id, projt_psw, `group`, status, create_by, create_time, update_by, update_time, remark, dev_position, gateway_id, voltage, signal_value from s_device
</sql> </sql>
<select id="selectDeviceList" parameterType="Device" resultMap="DeviceResult"> <select id="selectDeviceList" parameterType="Device" resultMap="DeviceResult">
...@@ -143,7 +143,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -143,7 +143,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="devType != null">dev_type = #{devType},</if> <if test="devType != null">dev_type = #{devType},</if>
<if test="projtId != null">projt_id = #{projtId},</if> <if test="projtId != null">projt_id = #{projtId},</if>
<if test="projtPsw != null">projt_psw = #{projtPsw},</if> <if test="projtPsw != null">projt_psw = #{projtPsw},</if>
<if test="group != null">group = #{group},</if> <if test="group != null"> group = #{group},</if>
<if test="status != null">status = #{status},</if> <if test="status != null">status = #{status},</if>
<if test="createBy != null">create_by = #{createBy},</if> <if test="createBy != null">create_by = #{createBy},</if>
<if test="createTime != null">create_time = #{createTime},</if> <if test="createTime != null">create_time = #{createTime},</if>
......
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