forked from rongchao/epmet-cloud-rizhao
12 changed files with 201 additions and 11 deletions
@ -0,0 +1,16 @@ |
|||
package com.epmet.dao; |
|||
|
|||
import com.epmet.commons.mybatis.dao.BaseDao; |
|||
import com.epmet.entity.GuideReaderEntity; |
|||
import org.apache.ibatis.annotations.Mapper; |
|||
|
|||
/** |
|||
* 办事指南阅读记录 |
|||
* |
|||
* @author generator generator@elink-cn.com |
|||
* @since v1.0.0 2023-02-02 |
|||
*/ |
|||
@Mapper |
|||
public interface GuideReaderDao extends BaseDao<GuideReaderEntity> { |
|||
|
|||
} |
@ -0,0 +1,44 @@ |
|||
package com.epmet.entity; |
|||
|
|||
import com.baomidou.mybatisplus.annotation.TableName; |
|||
|
|||
import com.epmet.commons.mybatis.entity.BaseEpmetEntity; |
|||
import lombok.Data; |
|||
import lombok.EqualsAndHashCode; |
|||
|
|||
import java.util.Date; |
|||
|
|||
/** |
|||
* 办事指南阅读记录 |
|||
* |
|||
* @author generator generator@elink-cn.com |
|||
* @since v1.0.0 2023-02-02 |
|||
*/ |
|||
@Data |
|||
@EqualsAndHashCode(callSuper=false) |
|||
@TableName("guide_reader") |
|||
public class GuideReaderEntity extends BaseEpmetEntity { |
|||
|
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
/** |
|||
* 客户ID |
|||
*/ |
|||
private String customerId; |
|||
|
|||
/** |
|||
* 办事指南id |
|||
*/ |
|||
private String guideId; |
|||
|
|||
/** |
|||
* 用户id;进入过办事指南详情就算是已读 |
|||
*/ |
|||
private String userId; |
|||
|
|||
/** |
|||
* 工作端:gov;居民端:resi |
|||
*/ |
|||
private String userType; |
|||
|
|||
} |
@ -0,0 +1,34 @@ |
|||
package com.epmet.service; |
|||
|
|||
import com.epmet.commons.mybatis.service.BaseService; |
|||
import com.epmet.entity.GuideReaderEntity; |
|||
|
|||
/** |
|||
* 办事指南阅读记录 |
|||
* |
|||
* @author generator generator@elink-cn.com |
|||
* @since v1.0.0 2023-02-02 |
|||
*/ |
|||
public interface GuideReaderService extends BaseService<GuideReaderEntity> { |
|||
|
|||
/** |
|||
* 单条查询 |
|||
* |
|||
* @param guideId |
|||
* @param userId |
|||
* @return GuideReaderDTO |
|||
* @author generator |
|||
* @date 2023-02-02 |
|||
*/ |
|||
GuideReaderEntity get(String guideId,String userId); |
|||
|
|||
/** |
|||
* 默认保存 |
|||
* |
|||
* @param dto |
|||
* @return void |
|||
* @author generator |
|||
* @date 2023-02-02 |
|||
*/ |
|||
void save(GuideReaderEntity dto); |
|||
} |
@ -0,0 +1,35 @@ |
|||
package com.epmet.service.impl; |
|||
|
|||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
|||
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; |
|||
import com.epmet.dao.GuideReaderDao; |
|||
import com.epmet.entity.GuideReaderEntity; |
|||
import com.epmet.service.GuideReaderService; |
|||
import org.springframework.stereotype.Service; |
|||
import org.springframework.transaction.annotation.Transactional; |
|||
|
|||
/** |
|||
* 办事指南阅读记录 |
|||
* |
|||
* @author generator generator@elink-cn.com |
|||
* @since v1.0.0 2023-02-02 |
|||
*/ |
|||
@Service |
|||
public class GuideReaderServiceImpl extends BaseServiceImpl<GuideReaderDao, GuideReaderEntity> implements GuideReaderService { |
|||
|
|||
@Override |
|||
public GuideReaderEntity get(String guideId,String userId) { |
|||
LambdaQueryWrapper<GuideReaderEntity> queryWrapper=new LambdaQueryWrapper<>(); |
|||
queryWrapper.eq(GuideReaderEntity::getGuideId,guideId) |
|||
.eq(GuideReaderEntity::getUserId,userId); |
|||
GuideReaderEntity entity = baseDao.selectOne(queryWrapper); |
|||
return entity; |
|||
} |
|||
|
|||
@Override |
|||
@Transactional(rollbackFor = Exception.class) |
|||
public void save(GuideReaderEntity entity) { |
|||
insert(entity); |
|||
} |
|||
|
|||
} |
@ -0,0 +1,14 @@ |
|||
CREATE TABLE `guide_reader` ( |
|||
`ID` varchar(64) NOT NULL COMMENT 'ID', |
|||
`CUSTOMER_ID` varchar(64) NOT NULL COMMENT '客户ID', |
|||
`GUIDE_ID` varchar(64) NOT NULL COMMENT '办事指南id', |
|||
`USER_ID` varchar(64) NOT NULL COMMENT '用户id;进入过办事指南详情就算是已读', |
|||
`USER_TYPE` varchar(10) NOT NULL COMMENT '工作端:gov;居民端:resi', |
|||
`DEL_FLAG` int(11) NOT NULL COMMENT '删除标识:0.未删除 1.已删除', |
|||
`REVISION` int(11) NOT NULL COMMENT '乐观锁', |
|||
`CREATED_BY` varchar(32) NOT NULL COMMENT '创建人', |
|||
`CREATED_TIME` datetime NOT NULL COMMENT '创建时间', |
|||
`UPDATED_BY` varchar(32) NOT NULL COMMENT '更新人', |
|||
`UPDATED_TIME` datetime NOT NULL COMMENT '更新时间', |
|||
PRIMARY KEY (`ID`) |
|||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='办事指南阅读记录'; |
@ -0,0 +1,21 @@ |
|||
<?xml version="1.0" encoding="UTF-8"?> |
|||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
|||
|
|||
<mapper namespace="com.epmet.dao.GuideReaderDao"> |
|||
|
|||
<resultMap type="com.epmet.entity.GuideReaderEntity" id="guideReaderMap"> |
|||
<result property="id" column="ID"/> |
|||
<result property="customerId" column="CUSTOMER_ID"/> |
|||
<result property="guideId" column="GUIDE_ID"/> |
|||
<result property="userId" column="USER_ID"/> |
|||
<result property="userType" column="USER_TYPE"/> |
|||
<result property="delFlag" column="DEL_FLAG"/> |
|||
<result property="revision" column="REVISION"/> |
|||
<result property="createdBy" column="CREATED_BY"/> |
|||
<result property="createdTime" column="CREATED_TIME"/> |
|||
<result property="updatedBy" column="UPDATED_BY"/> |
|||
<result property="updatedTime" column="UPDATED_TIME"/> |
|||
</resultMap> |
|||
|
|||
|
|||
</mapper> |
Loading…
Reference in new issue