refactor(transaction): 在服务层方法中添加事务注解
- 在多个服务类的创建、更新和删除方法中添加 @Transactional 注解 - 优化数据库操作,确保数据一致性 - 主要涉及设备、产品、参数、属性、事件和服务等模块
This commit is contained in:
parent
b431bf1c08
commit
616d640228
@ -22,6 +22,7 @@ import com.zsc.edu.gateway.modules.iot.product.repo.ProductRepository;
|
|||||||
import jakarta.annotation.Resource;
|
import jakarta.annotation.Resource;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
import org.springframework.util.StringUtils;
|
import org.springframework.util.StringUtils;
|
||||||
|
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
@ -46,6 +47,7 @@ public class DeviceServiceImpl extends ServiceImpl<DeviceRepository, Device> imp
|
|||||||
* 新建设备
|
* 新建设备
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
|
@Transactional
|
||||||
public Device create(DeviceDto dto) {
|
public Device create(DeviceDto dto) {
|
||||||
if (baseMapper.findByName(dto.getName()) != null) {
|
if (baseMapper.findByName(dto.getName()) != null) {
|
||||||
throw new ConstraintException("该设备已存在!");
|
throw new ConstraintException("该设备已存在!");
|
||||||
@ -60,6 +62,7 @@ public class DeviceServiceImpl extends ServiceImpl<DeviceRepository, Device> imp
|
|||||||
* 批量新增
|
* 批量新增
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
|
@Transactional
|
||||||
public List<Device> batchCreate(BatchDeviceDto dto) {
|
public List<Device> batchCreate(BatchDeviceDto dto) {
|
||||||
if (dto.getNum() == null || dto.getNum() <= 0) {
|
if (dto.getNum() == null || dto.getNum() <= 0) {
|
||||||
throw new ConstraintException("设备数量必须大于0!");
|
throw new ConstraintException("设备数量必须大于0!");
|
||||||
@ -118,6 +121,7 @@ public class DeviceServiceImpl extends ServiceImpl<DeviceRepository, Device> imp
|
|||||||
* 更新设备
|
* 更新设备
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
|
@Transactional
|
||||||
public Device update(DeviceDto dto, Long id) {
|
public Device update(DeviceDto dto, Long id) {
|
||||||
Device device = baseMapper.selectById(id);
|
Device device = baseMapper.selectById(id);
|
||||||
if (Objects.equals(device.getName(), dto.getName())) {
|
if (Objects.equals(device.getName(), dto.getName())) {
|
||||||
|
@ -11,6 +11,7 @@ import com.zsc.edu.gateway.modules.iot.tsl.entity.Param;
|
|||||||
import com.zsc.edu.gateway.modules.iot.tsl.service.ParamService;
|
import com.zsc.edu.gateway.modules.iot.tsl.service.ParamService;
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -26,6 +27,7 @@ public class ProductServiceImpl extends ServiceImpl<ProductRepository, Product>
|
|||||||
* 新建产品
|
* 新建产品
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
|
@Transactional
|
||||||
public Product create(ProductDto dto) {
|
public Product create(ProductDto dto) {
|
||||||
if (baseMapper.findByName(dto.getName()) != null) {
|
if (baseMapper.findByName(dto.getName()) != null) {
|
||||||
throw new ConstraintException("该设备已存在!");
|
throw new ConstraintException("该设备已存在!");
|
||||||
@ -34,7 +36,6 @@ public class ProductServiceImpl extends ServiceImpl<ProductRepository, Product>
|
|||||||
throw new ConstraintException("设备名称不能为空!");
|
throw new ConstraintException("设备名称不能为空!");
|
||||||
}
|
}
|
||||||
Product product = mapper.toEntity(dto);
|
Product product = mapper.toEntity(dto);
|
||||||
product.setId(null);
|
|
||||||
save(product);
|
save(product);
|
||||||
if (dto.getParams() != null) {
|
if (dto.getParams() != null) {
|
||||||
paramService.create(dto.getParams(), product.getId(), Param.ForeignType.PRODUCT);
|
paramService.create(dto.getParams(), product.getId(), Param.ForeignType.PRODUCT);
|
||||||
@ -45,6 +46,7 @@ public class ProductServiceImpl extends ServiceImpl<ProductRepository, Product>
|
|||||||
* 更新产品
|
* 更新产品
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
|
@Transactional
|
||||||
public Product update(ProductDto dto, Long id) {
|
public Product update(ProductDto dto, Long id) {
|
||||||
if (dto.getName() == null) {
|
if (dto.getName() == null) {
|
||||||
throw new ConstraintException("设备名称不能为空!");
|
throw new ConstraintException("设备名称不能为空!");
|
||||||
@ -69,6 +71,7 @@ public class ProductServiceImpl extends ServiceImpl<ProductRepository, Product>
|
|||||||
* 删除
|
* 删除
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
|
@Transactional
|
||||||
public boolean delete(Long id) {
|
public boolean delete(Long id) {
|
||||||
removeById(id);
|
removeById(id);
|
||||||
paramService.delete(id);
|
paramService.delete(id);
|
||||||
|
@ -11,6 +11,7 @@ import com.zsc.edu.gateway.modules.iot.tsl.service.EventService;
|
|||||||
import com.zsc.edu.gateway.modules.iot.tsl.service.ParamService;
|
import com.zsc.edu.gateway.modules.iot.tsl.service.ParamService;
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author Yao
|
* @author Yao
|
||||||
@ -25,7 +26,7 @@ public class EventServiceImpl extends ServiceImpl<EventRepository, Event> implem
|
|||||||
* 新建物模型事件
|
* 新建物模型事件
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
|
@Transactional
|
||||||
public Event create(EventDto dto) {
|
public Event create(EventDto dto) {
|
||||||
if (baseMapper.findByName(dto.getName()) != null) {
|
if (baseMapper.findByName(dto.getName()) != null) {
|
||||||
throw new ConstraintException("该事件已存在!");
|
throw new ConstraintException("该事件已存在!");
|
||||||
@ -42,6 +43,7 @@ public class EventServiceImpl extends ServiceImpl<EventRepository, Event> implem
|
|||||||
* 更新物模型事件
|
* 更新物模型事件
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
|
@Transactional
|
||||||
public Event update(EventDto dto, Long id) {
|
public Event update(EventDto dto, Long id) {
|
||||||
if (dto.getName() == null) {
|
if (dto.getName() == null) {
|
||||||
throw new ConstraintException("事件名称不能为空!");
|
throw new ConstraintException("事件名称不能为空!");
|
||||||
@ -71,6 +73,7 @@ public class EventServiceImpl extends ServiceImpl<EventRepository, Event> implem
|
|||||||
*删除
|
*删除
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
|
@Transactional
|
||||||
public boolean delete(Long id) {
|
public boolean delete(Long id) {
|
||||||
removeById(id);
|
removeById(id);
|
||||||
return paramService.delete(id);
|
return paramService.delete(id);
|
||||||
|
@ -9,6 +9,7 @@ import com.zsc.edu.gateway.modules.iot.tsl.repo.ParamRepository;
|
|||||||
import com.zsc.edu.gateway.modules.iot.tsl.service.ParamService;
|
import com.zsc.edu.gateway.modules.iot.tsl.service.ParamService;
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
@ -24,6 +25,7 @@ public class ParamServiceImpl extends ServiceImpl<ParamRepository, Param> implem
|
|||||||
private final ParamMapper mapper;
|
private final ParamMapper mapper;
|
||||||
private final ParamMapper paramMapper;
|
private final ParamMapper paramMapper;
|
||||||
@Override
|
@Override
|
||||||
|
@Transactional
|
||||||
public Boolean create(List<ParamDto> params, Long id, Param.ForeignType foreignType) {
|
public Boolean create(List<ParamDto> params, Long id, Param.ForeignType foreignType) {
|
||||||
List<Param> paramsToInsert = params.stream()
|
List<Param> paramsToInsert = params.stream()
|
||||||
.map(dto -> {
|
.map(dto -> {
|
||||||
@ -38,6 +40,7 @@ public class ParamServiceImpl extends ServiceImpl<ParamRepository, Param> implem
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@Transactional
|
||||||
public Boolean update(List<ParamDto> paramDto, Long id) {
|
public Boolean update(List<ParamDto> paramDto, Long id) {
|
||||||
List<Param> params = baseMapper.selectList(new LambdaQueryWrapper<Param>()
|
List<Param> params = baseMapper.selectList(new LambdaQueryWrapper<Param>()
|
||||||
.eq(Objects.nonNull(id), Param::getForeignId, id));
|
.eq(Objects.nonNull(id), Param::getForeignId, id));
|
||||||
@ -57,6 +60,7 @@ public class ParamServiceImpl extends ServiceImpl<ParamRepository, Param> implem
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@Transactional
|
||||||
public Boolean delete(Long id) {
|
public Boolean delete(Long id) {
|
||||||
return baseMapper.delete(new LambdaQueryWrapper<Param>()
|
return baseMapper.delete(new LambdaQueryWrapper<Param>()
|
||||||
.eq(Objects.nonNull(id), Param::getForeignId, id)) > 0;
|
.eq(Objects.nonNull(id), Param::getForeignId, id)) > 0;
|
||||||
|
@ -24,6 +24,7 @@ public class PropertyServiceImpl extends ServiceImpl<PropertyRepository, Propert
|
|||||||
* 新建物模型属性
|
* 新建物模型属性
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
|
@Transactional
|
||||||
public Property create(PropertyDto dto) {
|
public Property create(PropertyDto dto) {
|
||||||
if (baseMapper.findByName(dto.getName()) != null) {
|
if (baseMapper.findByName(dto.getName()) != null) {
|
||||||
throw new ApiException("该属性已存在!");
|
throw new ApiException("该属性已存在!");
|
||||||
|
@ -11,6 +11,7 @@ import com.zsc.edu.gateway.modules.iot.tsl.service.ParamService;
|
|||||||
import com.zsc.edu.gateway.modules.iot.tsl.service.ServeService;
|
import com.zsc.edu.gateway.modules.iot.tsl.service.ServeService;
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
@ -29,6 +30,7 @@ public class ServeServiceImpl extends ServiceImpl<ServeRepository, Serve> implem
|
|||||||
* 新建功能
|
* 新建功能
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
|
@Transactional
|
||||||
public Serve create(ServeDto dto) {
|
public Serve create(ServeDto dto) {
|
||||||
if (baseMapper.findByName(dto.getName()) != null) {
|
if (baseMapper.findByName(dto.getName()) != null) {
|
||||||
throw new ConstraintException("该服务已存在!");
|
throw new ConstraintException("该服务已存在!");
|
||||||
@ -47,6 +49,7 @@ public class ServeServiceImpl extends ServiceImpl<ServeRepository, Serve> implem
|
|||||||
* 更新功能
|
* 更新功能
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
|
@Transactional
|
||||||
public Serve update(ServeDto dto, Long id) {
|
public Serve update(ServeDto dto, Long id) {
|
||||||
if (dto.getName() == null) {
|
if (dto.getName() == null) {
|
||||||
throw new ConstraintException("服务名称不能为空!");
|
throw new ConstraintException("服务名称不能为空!");
|
||||||
@ -81,6 +84,7 @@ public class ServeServiceImpl extends ServiceImpl<ServeRepository, Serve> implem
|
|||||||
* @return true
|
* @return true
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
|
@Transactional
|
||||||
public Boolean delete(Long id) {
|
public Boolean delete(Long id) {
|
||||||
removeById(id);
|
removeById(id);
|
||||||
return paramService.delete(id);
|
return paramService.delete(id);
|
||||||
|
@ -32,12 +32,12 @@ public class UserNoticeController {
|
|||||||
* 普通用户查看消息详情
|
* 普通用户查看消息详情
|
||||||
*
|
*
|
||||||
* @param userDetails 操作用户
|
* @param userDetails 操作用户
|
||||||
* @param messageId 消息ID
|
* @param noticeId 消息ID
|
||||||
* @return 用户消息详情
|
* @return 用户消息详情
|
||||||
*/
|
*/
|
||||||
@GetMapping("/self/{noticeId}")
|
@GetMapping("/self/{noticeId}")
|
||||||
public UserNoticeVo selfDetail(@AuthenticationPrincipal UserDetailsImpl userDetails, @PathVariable("noticeId") Long messageId) {
|
public UserNoticeVo selfDetail(@AuthenticationPrincipal UserDetailsImpl userDetails, @PathVariable("noticeId") Long noticeId) {
|
||||||
return service.detail(messageId, userDetails.getId());
|
return service.detail(noticeId, userDetails.getId());
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -17,7 +17,7 @@ import org.apache.ibatis.annotations.Param;
|
|||||||
*/
|
*/
|
||||||
public interface UserNoticeRepository extends BaseMapper<UserNotice> {
|
public interface UserNoticeRepository extends BaseMapper<UserNotice> {
|
||||||
|
|
||||||
UserNoticeVo selectByNoticeIdAndUserId(@Param("noticeId") Long messageId, @Param("userId") Long userId);
|
UserNoticeVo selectByNoticeIdAndUserId(@Param("noticeId") Long noticeId, @Param("userId") Long userId);
|
||||||
|
|
||||||
IPage<UserNoticeVo> page(Page<UserNoticeVo> page, @Param("query") UserNoticeQuery query);
|
IPage<UserNoticeVo> page(Page<UserNoticeVo> page, @Param("query") UserNoticeQuery query);
|
||||||
|
|
||||||
|
@ -22,13 +22,13 @@ public interface UserNoticeService extends IService<UserNotice> {
|
|||||||
|
|
||||||
Boolean createByAdmin(UserNoticeDto dto);
|
Boolean createByAdmin(UserNoticeDto dto);
|
||||||
|
|
||||||
UserNoticeVo detail(Long messageId, Long userId);
|
UserNoticeVo detail(Long noticeId, Long userId);
|
||||||
|
|
||||||
IPage<UserNoticeVo> page(Page<UserNoticeVo> page, UserNoticeQuery query);
|
IPage<UserNoticeVo> page(Page<UserNoticeVo> page, UserNoticeQuery query);
|
||||||
|
|
||||||
Integer countUnread(UserDetailsImpl userDetails);
|
Integer countUnread(UserDetailsImpl userDetails);
|
||||||
|
|
||||||
boolean markAsRead(UserDetailsImpl userDetails, List<Long> messageIds);
|
boolean markAsRead(UserDetailsImpl userDetails, List<Long> noticeIds);
|
||||||
|
|
||||||
|
|
||||||
boolean markAllAsRead(UserDetailsImpl userDetails);
|
boolean markAllAsRead(UserDetailsImpl userDetails);
|
||||||
|
@ -13,7 +13,7 @@ public class UserNoticeVo {
|
|||||||
/**
|
/**
|
||||||
* 用户消息id
|
* 用户消息id
|
||||||
*/
|
*/
|
||||||
private Long messageId;
|
private Long noticeId;
|
||||||
/**
|
/**
|
||||||
* 是否已读
|
* 是否已读
|
||||||
*/
|
*/
|
||||||
|
@ -497,16 +497,16 @@ VALUES (1, 'Device1', TRUE, 1, 'HW1.0', 'FW1.0', 'FactoryA', 'Client1', 1, '{"pa
|
|||||||
|
|
||||||
INSERT INTO iot_product (id, name, product_type, model, link, create_by, create_time, update_by, update_time, remark,
|
INSERT INTO iot_product (id, name, product_type, model, link, create_by, create_time, update_by, update_time, remark,
|
||||||
dept_id)
|
dept_id)
|
||||||
VALUES (1, 'Product1', 'TypeA', 'ModelX', 1, 'Admin', CURRENT_TIMESTAMP, 'Admin', CURRENT_TIMESTAMP, 'Remark1', 101),
|
VALUES ('Product1', 'TypeA', 'ModelX', 1, 'Admin', CURRENT_TIMESTAMP, 'Admin', CURRENT_TIMESTAMP, 'Remark1', 101),
|
||||||
(2, 'Product2', 'TypeB', 'ModelY', 2, 'Admin', CURRENT_TIMESTAMP, 'Admin', CURRENT_TIMESTAMP, 'Remark2', 102),
|
('Product2', 'TypeB', 'ModelY', 2, 'Admin', CURRENT_TIMESTAMP, 'Admin', CURRENT_TIMESTAMP, 'Remark2', 102),
|
||||||
(3, 'Product3', 'TypeA', 'ModelZ', 1, 'Admin', CURRENT_TIMESTAMP, 'Admin', CURRENT_TIMESTAMP, 'Remark3', 103),
|
('Product3', 'TypeA', 'ModelZ', 1, 'Admin', CURRENT_TIMESTAMP, 'Admin', CURRENT_TIMESTAMP, 'Remark3', 103),
|
||||||
(4, 'Product4', 'TypeC', 'ModelW', 3, 'Admin', CURRENT_TIMESTAMP, 'Admin', CURRENT_TIMESTAMP, 'Remark4', 104),
|
('Product4', 'TypeC', 'ModelW', 3, 'Admin', CURRENT_TIMESTAMP, 'Admin', CURRENT_TIMESTAMP, 'Remark4', 104),
|
||||||
(5, 'Product5', 'TypeB', 'ModelV', 2, 'Admin', CURRENT_TIMESTAMP, 'Admin', CURRENT_TIMESTAMP, 'Remark5', 105),
|
('Product5', 'TypeB', 'ModelV', 2, 'Admin', CURRENT_TIMESTAMP, 'Admin', CURRENT_TIMESTAMP, 'Remark5', 105),
|
||||||
(6, 'Product6', 'TypeD', 'ModelU', 4, 'Admin', CURRENT_TIMESTAMP, 'Admin', CURRENT_TIMESTAMP, 'Remark6', 106),
|
('Product6', 'TypeD', 'ModelU', 4, 'Admin', CURRENT_TIMESTAMP, 'Admin', CURRENT_TIMESTAMP, 'Remark6', 106),
|
||||||
(7, 'Product7', 'TypeA', 'ModelT', 1, 'Admin', CURRENT_TIMESTAMP, 'Admin', CURRENT_TIMESTAMP, 'Remark7', 107),
|
('Product7', 'TypeA', 'ModelT', 1, 'Admin', CURRENT_TIMESTAMP, 'Admin', CURRENT_TIMESTAMP, 'Remark7', 107),
|
||||||
(8, 'Product8', 'TypeC', 'ModelS', 3, 'Admin', CURRENT_TIMESTAMP, 'Admin', CURRENT_TIMESTAMP, 'Remark8', 108),
|
('Product8', 'TypeC', 'ModelS', 3, 'Admin', CURRENT_TIMESTAMP, 'Admin', CURRENT_TIMESTAMP, 'Remark8', 108),
|
||||||
(9, 'Product9', 'TypeB', 'ModelR', 2, 'Admin', CURRENT_TIMESTAMP, 'Admin', CURRENT_TIMESTAMP, 'Remark9', 109),
|
('Product9', 'TypeB', 'ModelR', 2, 'Admin', CURRENT_TIMESTAMP, 'Admin', CURRENT_TIMESTAMP, 'Remark9', 109),
|
||||||
(10, 'Product10', 'TypeD', 'ModelQ', 4, 'Admin', CURRENT_TIMESTAMP, 'Admin', CURRENT_TIMESTAMP, 'Remark10', 110);
|
('Product10', 'TypeD', 'ModelQ', 4, 'Admin', CURRENT_TIMESTAMP, 'Admin', CURRENT_TIMESTAMP, 'Remark10', 110);
|
||||||
|
|
||||||
INSERT INTO iot_param (id, data_type, uint, type, identifier, name, remark)
|
INSERT INTO iot_param (id, data_type, uint, type, identifier, name, remark)
|
||||||
VALUES (1, 1, 'm', 1, 'identifier1', 'Parameter1', 'Remark1'),
|
VALUES (1, 1, 'm', 1, 'identifier1', 'Parameter1', 'Remark1'),
|
||||||
@ -544,7 +544,7 @@ VALUES (1, 1, 1, 'prop1', 'Property 1', 'This is property 1'),
|
|||||||
(9, 1, 1, 'prop9', 'Property 9', 'This is property 9'),
|
(9, 1, 1, 'prop9', 'Property 9', 'This is property 9'),
|
||||||
(10, 2, 2, 'prop10', 'Property 10', 'This is property 10');
|
(10, 2, 2, 'prop10', 'Property 10', 'This is property 10');
|
||||||
|
|
||||||
INSERT INTO iot_serve (id, product_id, identifier, name, remark)
|
INSERT INTO iot_serve (product_id, identifier, name, remark)
|
||||||
VALUES (1, 'serve1', 'Service 1', 'This is service 1'),
|
VALUES (1, 'serve1', 'Service 1', 'This is service 1'),
|
||||||
(2, 'serve2', 'Service 2', 'This is service 2'),
|
(2, 'serve2', 'Service 2', 'This is service 2'),
|
||||||
(3, 'serve3', 'Service 3', 'This is service 3'),
|
(3, 'serve3', 'Service 3', 'This is service 3'),
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
create table iot_event
|
create table iot_event
|
||||||
(
|
(
|
||||||
id bigserial not null
|
id bigint not null
|
||||||
constraint iot_event_pk
|
constraint iot_event_pk
|
||||||
primary key,
|
primary key,
|
||||||
product_id bigint,
|
product_id bigint,
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
create table iot_product
|
create table iot_product
|
||||||
(
|
(
|
||||||
id bigserial not null
|
id bigint not null
|
||||||
constraint iot_product_pk
|
constraint iot_product_pk
|
||||||
primary key,
|
primary key,
|
||||||
name varchar,
|
name varchar,
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
create table iot_serve
|
create table iot_serve
|
||||||
(
|
(
|
||||||
id bigserial not null
|
id bigint not null
|
||||||
constraint iot_serve_pk
|
constraint iot_serve_pk
|
||||||
primary key,
|
primary key,
|
||||||
product_id bigint,
|
product_id bigint,
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
<mapper namespace="com.zsc.edu.gateway.modules.message.repo.UserNoticeRepository">
|
<mapper namespace="com.zsc.edu.gateway.modules.message.repo.UserNoticeRepository">
|
||||||
<resultMap id="userNoticeMap" type="com.zsc.edu.gateway.modules.message.vo.UserNoticeVo">
|
<resultMap id="userNoticeMap" type="com.zsc.edu.gateway.modules.message.vo.UserNoticeVo">
|
||||||
<id column="message_id" jdbcType="BIGINT" property="messageId"/>
|
<id column="notice_id" jdbcType="BIGINT" property="noticeId"/>
|
||||||
<result column="is_read" jdbcType="BOOLEAN" property="isRead"/>
|
<result column="is_read" jdbcType="BOOLEAN" property="isRead"/>
|
||||||
<result column="read_time" jdbcType="TIMESTAMP" property="readTime"/>
|
<result column="read_time" jdbcType="TIMESTAMP" property="readTime"/>
|
||||||
<result column="username" jdbcType="VARCHAR" property="username"/>
|
<result column="username" jdbcType="VARCHAR" property="username"/>
|
||||||
|
Loading…
Reference in New Issue
Block a user