src/main/java/com/lunhan/xxx/host/ApplicationStarter.java | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
src/main/java/com/lunhan/xxx/host/controller/TestInfoServiceController.java | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
src/main/java/com/lunhan/xxx/repository/BasicPO.java | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
src/main/java/com/lunhan/xxx/repository/impl/TestInfoMapperImpl.java | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
src/main/java/com/lunhan/xxx/repository/mapper/TestInfoMapper.java | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
src/main/java/com/lunhan/xxx/repository/po/TestInfoPO.java | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
src/main/java/com/lunhan/xxx/service/TestInfoService.java | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
src/main/resources/application-dev.yml | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 |
src/main/java/com/lunhan/xxx/host/ApplicationStarter.java
@@ -11,7 +11,7 @@ @SpringBootApplication(scanBasePackages = { "com.lunhan" }) @ServletComponentScan @MapperScan("com.baomidou.mybatisplus.samples.quickstart.mapper") @MapperScan("com.lunhan.xxx.repository.mapper") // 开启缓存 @EnableCaching public class ApplicationStarter extends SpringBootServletInitializer { src/main/java/com/lunhan/xxx/host/controller/TestInfoServiceController.java
@@ -223,7 +223,7 @@ } /** * 删除[测试信息] * 批量删除[测试信息] * * @author lin.liu * @date 2021/11/23 src/main/java/com/lunhan/xxx/repository/BasicPO.java
文件已删除 src/main/java/com/lunhan/xxx/repository/impl/TestInfoMapperImpl.java
文件名从 src/main/java/com/lunhan/xxx/repository/mapper/TestInfoMapperImpl.java 修改 @@ -20,7 +20,7 @@ # 神兽保佑 # 永无BUG! */ package com.lunhan.xxx.repository.mapper; package com.lunhan.xxx.repository.impl; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; @@ -34,7 +34,7 @@ import com.lunhan.xxx.entity.dto.search.SearchTestInfo; import com.lunhan.xxx.entity.enums.EOrderBy; import com.lunhan.xxx.repository.BasicMapperImpl; import com.lunhan.xxx.repository.imapper.TestInfoMapper; import com.lunhan.xxx.repository.mapper.TestInfoMapper; import com.lunhan.xxx.repository.po.TestInfoPO; import org.springframework.stereotype.Repository; @@ -44,9 +44,8 @@ * @description 测试信息 数据访问类 * @date 2021/11/23 */ @Repository class TestInfoMapperImpl extends BasicMapperImpl<TestInfoPO> { public class TestInfoMapperImpl extends BasicMapperImpl<TestInfoPO> { public TestInfoMapperImpl(TestInfoMapper mapper) { super(mapper); } src/main/java/com/lunhan/xxx/repository/mapper/TestInfoMapper.java
文件名从 src/main/java/com/lunhan/xxx/repository/imapper/TestInfoMapper.java 修改 @@ -1,12 +1,14 @@ package com.lunhan.xxx.repository.imapper; package com.lunhan.xxx.repository.mapper; import com.baomidou.mybatisplus.core.toolkit.Constants; import com.lunhan.xxx.entity.dto.search.SearchTestInfo; import com.lunhan.xxx.repository.BasicMapper; import com.lunhan.xxx.repository.po.TestInfoPO; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Select; @Mapper public interface TestInfoMapper extends BasicMapper<TestInfoPO> { // #{param}:会进行预编译,而且进行类型匹配,最后进行变量替换,括号中可以添加映射类型如 // @Select( src/main/java/com/lunhan/xxx/repository/po/TestInfoPO.java
@@ -22,9 +22,8 @@ */ package com.lunhan.xxx.repository.po; import com.lunhan.xxx.repository.BasicPO; import com.baomidou.mybatisplus.annotation.*; import javax.persistence.*; import java.math.BigDecimal; import java.sql.Timestamp; @@ -34,72 +33,84 @@ * @description 测试信息 * @date 2021/11/23 */ @Entity @Table(name = "test_info") public class TestInfoPO extends BasicPO { @TableName("test_info") public class TestInfoPO { /** * 主键id */ @TableId @TableField("id") private Long id; /** * 名称 */ @Column(name = "name") @TableField("name") private String name; /** * 用户id */ @Column(name = "user_id") @TableField("user_id") private Long userId; /** * 电话 */ @Column(name = "phone") @TableField("phone") private String phone; /** * 余额 */ @Column(name = "balance") @TableField("balance") private BigDecimal balance; /** * 性别 男=1,女=2,其他=3 */ @Column(name = "sex") @TableField("sex") private Integer sex; /** * 生日 */ @Column(name = "birthday") @TableField("birthday") private String birthday; /** * 排序值 */ @Column(name = "sort") @TableField("sort") private Integer sort; /** * 状态 正常=200,停用=300,删除=400 */ @Column(name = "status") @TableField("status") private Integer status; /** * 备注 */ @Column(name = "comment") @TableField("comment") private String comment; /** * 创建时间 */ @Column(name = "create_time") @TableField("create_time") private Long createTime; /** * 数据最后更新时间 */ @Column(name = "update_time", insertable = false, updatable = false) @TableField("update_time") private Timestamp updateTime; /** * 是否删除(逻辑删除) */ @Column(name = "is_delete") @TableField("is_delete") private Integer isDelete; public Long getId() { return id; } public void setId(Long id) { this.id = id; } public String getName() { return this.name; } src/main/java/com/lunhan/xxx/service/TestInfoService.java
@@ -2,6 +2,7 @@ import com.lunhan.xxx.common.ExecutedResult; import com.lunhan.xxx.common.PagerResult; import com.lunhan.xxx.common.enums.EYesOrNo; import com.lunhan.xxx.common.model.Tuple; import com.lunhan.xxx.common.util.*; import com.lunhan.xxx.entity.dto.search.SearchTestInfo; @@ -10,7 +11,7 @@ import com.lunhan.xxx.entity.request.ReqSetSort; import com.lunhan.xxx.entity.request.test.ReqCreateTestInfo; import com.lunhan.xxx.entity.request.test.ReqModifyTestInfo; import com.lunhan.xxx.repository.imapper.TestInfoMapper; import com.lunhan.xxx.repository.impl.TestInfoMapperImpl; import com.lunhan.xxx.repository.po.TestInfoPO; import com.lunhan.xxx.repository.vo.TestInfoVO; import com.lunhan.xxx.service.convert.TestInfoConvert; @@ -27,7 +28,7 @@ @Service public class TestInfoService extends BaseService { @Autowired private TestInfoMapper mapper; private TestInfoMapperImpl mapper; public ExecutedResult<Long> create(ReqCreateTestInfo request) { // 转换po @@ -37,6 +38,8 @@ item.setStatus(EState.NORMAL.getValue()); // 设置记录创建时间 item.setCreateTime(LocalDateTimeUtil.nowTimeStamp()); // 非逻辑删除 item.setIsDelete(EYesOrNo.NO.getValue()); int rowCount = mapper.insert(item); if (rowCount != 1) { src/main/resources/application-dev.yml
@@ -6,7 +6,7 @@ date-format: yyyy-MM-dd HH:mm:ss datasource: driver-class-name: org.postgresql.Driver url: jdbc:postgresql://113.250.189.120:57654/water_trade_center url: jdbc:postgresql://113.250.189.120:57654/test_db1 username: lunhan password: lunhan.20240330 druid: