skjcmanager/skjcmanager-service/skjcmanager-sm/src/main/java/cn/gistack/sm/sjztmd/entity/TbResGeneralInvestigation.java
@@ -35,6 +35,34 @@ private String guid; /** * 填报年度 */ @ApiModelProperty(value = "填报年度") @TableField("\"tb_year\"") private Integer tbYear; /** * 填报季度 */ @ApiModelProperty(value = "填报季度") @TableField(value = "\"tb_quarter\"", fill = FieldFill.UPDATE) private String tbQuarter; /** * 是否普查完成 */ @ApiModelProperty(value = "是否普查完成") @TableField("\"is_inv_com\"") private Integer isInvCom; /** * 年度填报状态表id */ @ApiModelProperty(value = "年度填报状态表id") @TableField(value = "\"tb_state_id\"", fill = FieldFill.UPDATE) private String tbStateId; /** * 水库编码 */ @ApiModelProperty(value = "水库编码") skjcmanager/skjcmanager-service/skjcmanager-sm/src/main/java/cn/gistack/sm/sjztmd/entity/TbResGeneralInvestigationState.java
New file @@ -0,0 +1,83 @@ package cn.gistack.sm.sjztmd.entity; import com.baomidou.mybatisplus.annotation.*; import com.baomidou.mybatisplus.extension.handlers.FastjsonTypeHandler; import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.databind.annotation.JsonSerialize; import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import lombok.Data; import org.springframework.format.annotation.DateTimeFormat; import java.io.Serializable; import java.util.Date; /** * @PROJECT_NAME: skjcmanager * @DESCRIPTION: 白蚁普查 * @USER: aix * @DATE: 2024/3/11 14:02 */ @Data @TableName(value = "\"tb_res_general_investigation_state\"", autoResultMap = true) @ApiModel(value = "水库白蚁年度普查填报状态", description = "水库白蚁年度普查填报状态") public class TbResGeneralInvestigationState implements Serializable { private static final long serialVersionUID = 1L; /** * 主键 */ @JsonSerialize(using = ToStringSerializer.class) @ApiModelProperty(value = "主键") @TableId(value = "\"guid\"", type = IdType.ASSIGN_ID) private String guid; /** * 填报年度 */ @ApiModelProperty(value = "填报年度") @TableField("\"tb_year\"") private Integer tbYear; /** * 填报季度 */ @ApiModelProperty(value = "填报季度") @TableField(value = "\"tb_quarter\"", fill = FieldFill.UPDATE) private String tbQuarter; /** * 水库编码 */ @ApiModelProperty(value = "水库编码") @TableField(value = "\"res_guid\"", fill = FieldFill.UPDATE) private String resGuid; /** * 填报状态(0填报中,1待审核,2已审核) */ @ApiModelProperty(value = "填报状态(0填报中,1待审核,2已审核") @TableField("\"check_state\"") @JsonSerialize(using = ToStringSerializer.class) private Integer checkState; /** * 创建时间 */ @ApiModelProperty(value = "创建时间 ") @TableField("\"create_time\"") @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") private Date createTime; /** * 纬度 */ @ApiModelProperty(value = "纬度") @TableField(value = "\"create_user\"", fill = FieldFill.UPDATE) private String createUser; } skjcmanager/skjcmanager-service/skjcmanager-sm/src/main/java/cn/gistack/sm/sjztmd/mapper/TbResGeneralInvestigationStateMapper.java
New file @@ -0,0 +1,16 @@ package cn.gistack.sm.sjztmd.mapper; import cn.gistack.sm.sjztmd.entity.TbResGeneralInvestigation; import cn.gistack.sm.sjztmd.entity.TbResGeneralInvestigationState; import com.baomidou.mybatisplus.core.mapper.BaseMapper; /** * AttResBaseMapper 接口 * * @author Chill */ public interface TbResGeneralInvestigationStateMapper extends BaseMapper<TbResGeneralInvestigationState> { } skjcmanager/skjcmanager-service/skjcmanager-sm/src/main/java/cn/gistack/sm/sjztmd/mapper/TbResGeneralInvestigationStateMapper.xml
New file @@ -0,0 +1,5 @@ <?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="cn.gistack.sm.sjztmd.mapper.TbResGeneralInvestigationStateMapper"> <!--namespace根据自己需要创建的的mapper的路径和名称填写--> </mapper> skjcmanager/skjcmanager-service/skjcmanager-sm/src/main/java/cn/gistack/sm/sjztmd/service/ITbResGeneralInvestigationService.java
@@ -11,4 +11,11 @@ */ public interface ITbResGeneralInvestigationService extends IService<TbResGeneralInvestigation> { /** * 自定义保存或者修改对象方法 * @param entity * @return */ boolean saveOrUpdateBy(TbResGeneralInvestigation entity); } skjcmanager/skjcmanager-service/skjcmanager-sm/src/main/java/cn/gistack/sm/sjztmd/service/ITbResGeneralInvestigationStateService.java
New file @@ -0,0 +1,15 @@ package cn.gistack.sm.sjztmd.service; import cn.gistack.sm.sjztmd.entity.TbResGeneralInvestigation; import cn.gistack.sm.sjztmd.entity.TbResGeneralInvestigationState; import com.baomidou.mybatisplus.extension.service.IService; /** * @PROJECT_NAME: skjcmanager * @DESCRIPTION: * @USER: aix * @DATE: 2024/3/11 14:35 */ public interface ITbResGeneralInvestigationStateService extends IService<TbResGeneralInvestigationState> { } skjcmanager/skjcmanager-service/skjcmanager-sm/src/main/java/cn/gistack/sm/sjztmd/service/impl/TbResGeneralInvestigationServiceImpl.java
@@ -1,9 +1,12 @@ package cn.gistack.sm.sjztmd.service.impl; import cn.gistack.sm.sjztmd.entity.TbResGeneralInvestigation; import cn.gistack.sm.sjztmd.entity.TbResGeneralInvestigationState; import cn.gistack.sm.sjztmd.mapper.TbResGeneralInvestigationMapper; import cn.gistack.sm.sjztmd.service.ITbResGeneralInvestigationService; import cn.gistack.sm.sjztmd.service.ITbResGeneralInvestigationStateService; import com.baomidou.dynamic.datasource.annotation.DS; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; @@ -19,4 +22,29 @@ @Transactional(rollbackFor = Exception.class) public class TbResGeneralInvestigationServiceImpl extends ServiceImpl<TbResGeneralInvestigationMapper, TbResGeneralInvestigation> implements ITbResGeneralInvestigationService { private ITbResGeneralInvestigationStateService tbResGeneralInvestigationStateService; @Override @Transactional public boolean saveOrUpdateBy(TbResGeneralInvestigation entity) { QueryWrapper queryWrapper = new QueryWrapper(); queryWrapper.eq("res_guid",entity.getResGuid()); queryWrapper.eq("tb_year",entity.getTbYear()); queryWrapper.eq("tb_quarter",entity.getTbYear()); TbResGeneralInvestigationState state = tbResGeneralInvestigationStateService.getOne(queryWrapper); if (null == state) { state = new TbResGeneralInvestigationState(); state.setResGuid(entity.getResGuid()); state.setTbQuarter(entity.getTbQuarter()); state.setTbYear(entity.getTbYear()); } // 是否普查完成 1是 0否 state.setCheckState(entity.getIsInvCom()); tbResGeneralInvestigationStateService.saveOrUpdate(state); return this.saveOrUpdate(entity); } } skjcmanager/skjcmanager-service/skjcmanager-sm/src/main/java/cn/gistack/sm/sjztmd/service/impl/TbResGeneralInvestigationStateServiceImpl.java
New file @@ -0,0 +1,25 @@ package cn.gistack.sm.sjztmd.service.impl; import cn.gistack.sm.sjztmd.entity.TbResGeneralInvestigation; import cn.gistack.sm.sjztmd.entity.TbResGeneralInvestigationState; import cn.gistack.sm.sjztmd.mapper.TbResGeneralInvestigationMapper; import cn.gistack.sm.sjztmd.mapper.TbResGeneralInvestigationStateMapper; import cn.gistack.sm.sjztmd.service.ITbResGeneralInvestigationService; import cn.gistack.sm.sjztmd.service.ITbResGeneralInvestigationStateService; import com.baomidou.dynamic.datasource.annotation.DS; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; /** * @PROJECT_NAME: skjcmanager * @DESCRIPTION: * @USER: aix * @DATE: 2024/3/11 14:36 */ @Service @DS("zt") @Transactional(rollbackFor = Exception.class) public class TbResGeneralInvestigationStateServiceImpl extends ServiceImpl<TbResGeneralInvestigationStateMapper, TbResGeneralInvestigationState> implements ITbResGeneralInvestigationStateService { }