Merge branch 'master' of http://8.140.179.55:20000/r/pipIrr-SV
New file |
| | |
| | | package com.dy.pipIrrGlobal.daoIr; |
| | | |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | |
| | | /** |
| | | * @author :WuZeYu |
| | | * @Date :2024/5/16 18:23 |
| | | * @LastEditTime :2024/5/16 18:23 |
| | | * @Description |
| | | */ |
| | | @Mapper |
| | | public interface IrIrrigateUnitMapper { |
| | | } |
| | |
| | | import com.dy.pipIrrGlobal.pojoPr.PrController; |
| | | import com.dy.pipIrrGlobal.pojoPr.PrIntake; |
| | | import com.dy.pipIrrGlobal.voIr.VoProject; |
| | | import com.dy.pipIrrGlobal.voIr.VoProjectOne; |
| | | import com.dy.pipIrrGlobal.voPr.VoIntake; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.apache.ibatis.annotations.Param; |
| | |
| | | */ |
| | | @Mapper |
| | | public interface IrProjectMapper extends BaseMapper<IrProject> { |
| | | //增 |
| | | //增 |
| | | int insertSelective(IrProject record); |
| | | //删 |
| | | |
| | | //删 |
| | | int deleteLogicById(Long id); |
| | | //改 |
| | | |
| | | //改 |
| | | int updateByPrimaryKeySelective(IrProject record); |
| | | //查一个 |
| | | IrProject selectById(Long id); |
| | | |
| | | //查一个 |
| | | VoProjectOne selectById(Long id); |
| | | |
| | | /** |
| | | * 修改项目状态 |
| | | * |
| | | * @return |
| | | */ |
| | | int updateProjectState(IrProject record); |
| | | |
| | | /** |
| | | * 根据下级Id获取上一级地址Id |
| | | * |
| | | * @param vaId 下一级Id |
| | | * @return |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 根据指定条件获取取水口记录数 |
| | | * |
| | | * @param params |
| | | * @return |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 根据指定条件获取取水口记录 |
| | | * |
| | | * @param params |
| | | * @return |
| | | */ |
New file |
| | |
| | | package com.dy.pipIrrGlobal.pojoIr; |
| | | |
| | | /** |
| | | * @author :WuZeYu |
| | | * @Date :2024/5/16 18:29 |
| | | * @LastEditTime :2024/5/16 18:29 |
| | | * @Description |
| | | */ |
| | | |
| | | import com.alibaba.fastjson2.annotation.JSONField; |
| | | import com.alibaba.fastjson2.writer.ObjectWriterImplToString; |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import io.swagger.v3.oas.annotations.media.Schema; |
| | | import jakarta.validation.constraints.NotBlank; |
| | | import jakarta.validation.constraints.NotNull; |
| | | import lombok.*; |
| | | import org.hibernate.validator.constraints.Length; |
| | | |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * 灌溉单元表 |
| | | */ |
| | | |
| | | @TableName(value="ir_irrigate_unit", autoResultMap = true) |
| | | @Data |
| | | @Builder |
| | | @ToString |
| | | @NoArgsConstructor |
| | | @AllArgsConstructor |
| | | @Schema(name = "项目实体") |
| | | public class IrIrrigateUnit { |
| | | public static final long serialVersionUID = 202405161833001L; |
| | | |
| | | /** |
| | | * 主键 |
| | | */ |
| | | @JSONField(serializeUsing= ObjectWriterImplToString.class) |
| | | @TableId(type = IdType.INPUT) |
| | | @Schema(description = "实体id", requiredMode = Schema.RequiredMode.NOT_REQUIRED) |
| | | private Long id; |
| | | |
| | | /** |
| | | * 项目ID |
| | | */ |
| | | @Schema(description = "项目ID", requiredMode = Schema.RequiredMode.REQUIRED) |
| | | @NotNull(message = "项目ID不能为空") |
| | | private Long projectId; |
| | | /** |
| | | * 灌溉面积 |
| | | */ |
| | | @Schema(description = "灌溉面积", requiredMode = Schema.RequiredMode.REQUIRED) |
| | | @Length(message = "项目名称不大于{max}字",max = 12) |
| | | private float area; |
| | | /** |
| | | * 操作人ID |
| | | */ |
| | | @Schema(description = "操作人ID", requiredMode = Schema.RequiredMode.NOT_REQUIRED) |
| | | @NotNull(message = "操作人ID不能为空") |
| | | private Long operator; |
| | | |
| | | /** |
| | | * 操作时间 |
| | | */ |
| | | @Schema(description = "操作时间", requiredMode = Schema.RequiredMode.NOT_REQUIRED) |
| | | private Date operateDt; |
| | | |
| | | /** |
| | | * 备注 |
| | | */ |
| | | @Schema(description = "备注", requiredMode = Schema.RequiredMode.REQUIRED) |
| | | private String remarks; |
| | | |
| | | /** |
| | | * 逻辑删除标识;0-未删除,1-删除 |
| | | */ |
| | | @Schema(description = "删除标识", requiredMode = Schema.RequiredMode.NOT_REQUIRED) |
| | | private Byte deleted; |
| | | } |
| | |
| | | import io.swagger.v3.oas.annotations.media.Schema; |
| | | import lombok.Data; |
| | | |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * @author :WuZeYu |
| | | * @Date :2024/5/15 21:02 |
| | |
| | | @ExcelProperty("项目备注") |
| | | @ColumnWidth(250) |
| | | private String remarks; |
| | | |
| | | @Schema(title = "操作时间") |
| | | @ExcelProperty("操作时间") |
| | | @ColumnWidth(50) |
| | | private Date operateDt; |
| | | } |
New file |
| | |
| | | package com.dy.pipIrrGlobal.voIr; |
| | | |
| | | import com.dy.common.po.BaseEntity; |
| | | import com.dy.common.webUtil.QueryConditionVo; |
| | | import io.swagger.v3.oas.annotations.media.Schema; |
| | | import lombok.*; |
| | | |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * @author :WuZeYu |
| | | * @Date :2024/5/15 21:11 |
| | | * @LastEditTime :2024/5/15 21:11 |
| | | * @Description |
| | | */ |
| | | @Data |
| | | @Schema(name = "项目视图(查一个)") |
| | | public class VoProjectOne implements BaseEntity { |
| | | @Schema(description = "项目名称") |
| | | public String projectName; |
| | | |
| | | @Schema(description = "项目Id") |
| | | private String id; |
| | | /** |
| | | * 省ID |
| | | */ |
| | | @Schema(description = "省ID") |
| | | private String provinceId; |
| | | /** |
| | | * 市ID |
| | | */ |
| | | @Schema(description = "市ID") |
| | | private String cityId; |
| | | /** |
| | | * 县ID |
| | | */ |
| | | @Schema(description = "县ID") |
| | | private String countyId; |
| | | /** |
| | | * 镇ID |
| | | */ |
| | | @Schema(description = "镇ID") |
| | | private String townId; |
| | | /** |
| | | * 村ID |
| | | */ |
| | | @Schema(description = "村ID") |
| | | private String villageId; |
| | | /** |
| | | * 项目状态;1-启动,2-停止 |
| | | */ |
| | | @Schema(description = "项目状态") |
| | | private Byte projectState; |
| | | |
| | | /** |
| | | * 操作人名字 |
| | | */ |
| | | @Schema(description = "操作人名字") |
| | | private String operatorName; |
| | | |
| | | /** |
| | | * 操作时间 |
| | | */ |
| | | @Schema(description = "操作时间") |
| | | private Date operateDt; |
| | | |
| | | /** |
| | | * 备注 |
| | | */ |
| | | @Schema(description = "备注") |
| | | private String remarks; |
| | | |
| | | |
| | | } |
New file |
| | |
| | | <?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.dy.pipIrrGlobal.daoIr.IrIrrigateUnitMapper"> |
| | | <resultMap id="BaseResultMap" type="com.dy.pipIrrGlobal.pojoIr.IrProject"> |
| | | <!--@mbg.generated--> |
| | | <!--@Table ir_project--> |
| | | <id column="id" jdbcType="BIGINT" property="id" /> |
| | | <result column="project_name" jdbcType="VARCHAR" property="projectName" /> |
| | | <result column="province_id" jdbcType="BIGINT" property="provinceId" /> |
| | | <result column="city_id" jdbcType="BIGINT" property="cityId" /> |
| | | <result column="county_id" jdbcType="BIGINT" property="countyId" /> |
| | | <result column="town_id" jdbcType="BIGINT" property="townId" /> |
| | | <result column="village_id" jdbcType="BIGINT" property="villageId" /> |
| | | <result column="project_state" jdbcType="TINYINT" property="projectState" /> |
| | | <result column="remarks" jdbcType="VARCHAR" property="remarks" /> |
| | | <result column="operator" jdbcType="BIGINT" property="operator" /> |
| | | <result column="operate_time" jdbcType="TIMESTAMP" property="operateDt" /> |
| | | <result column="deleted" jdbcType="TINYINT" property="deleted" /> |
| | | </resultMap> |
| | | <sql id="Base_Column_List"> |
| | | <!--@mbg.generated--> |
| | | id, project_name, province_id, city_id, county_id, town_id, `village_id`, project_state, remarks, `operator`, |
| | | operate_time, deleted |
| | | </sql> |
| | | </mapper> |
| | |
| | | where id = #{id,jdbcType=BIGINT} |
| | | </update> |
| | | <!--查询一个信息--> |
| | | <select id="selectById" resultMap="BaseResultMap"> |
| | | select <include refid="Base_Column_List" /> from ir_project where id = #{id,jdbcType=BIGINT} and deleted = 0 |
| | | <select id="selectById" resultType="com.dy.pipIrrGlobal.voIr.VoProjectOne"> |
| | | select |
| | | CAST(pro.id AS char)AS projectId, |
| | | CAST(pro.province_id AS char)AS provinceId, |
| | | CAST(pro.city_id AS char)AS cityId, |
| | | CAST(pro.county_id AS char)AS countyId, |
| | | CAST(pro.town_id AS char)AS townId, |
| | | CAST(pro.village_id AS char)AS villageId, |
| | | pro.project_name AS projectName, |
| | | pro.project_state AS projectState, |
| | | cli.name AS operatorName, |
| | | pro.remarks, |
| | | pro.operate_time AS operateDt |
| | | from ir_project pro |
| | | left join se_client cli on cli.id = pro.operator |
| | | where pro.id = #{id,jdbcType=BIGINT} and pro.deleted = 0 |
| | | </select> |
| | | <!--分页查询数量--> |
| | | <select id="getRecordCount" resultType="java.lang.Long"> |
| | |
| | | pro.project_name AS projectName, |
| | | pro.project_state AS projectState, |
| | | CONCAT(province.`name`,city.`name`,country.`name`, town.`name`, village.`name`) AS address, |
| | | pro.remarks |
| | | pro.remarks, |
| | | pro.operate_time AS operateDt |
| | | FROM ir_project pro |
| | | LEFT JOIN ba_district province ON pro.province_id = province.id |
| | | LEFT JOIN ba_district city ON pro.city_id = city.id |
| | |
| | | AND pro.project_state = #{projectState} |
| | | </if> |
| | | </where> |
| | | ORDER BY pro.operate_time DESC |
| | | <if test="pageCurr != null and pageSize != null"> |
| | | LIMIT ${(pageCurr-1)*pageSize}, ${pageSize} |
| | | </if> |
| | | </select> |
| | | </mapper> |
New file |
| | |
| | | package com.dy.pipIrrIrrigate.irrigateUnit; |
| | | |
| | | |
| | | import io.swagger.v3.oas.annotations.tags.Tag; |
| | | import lombok.RequiredArgsConstructor; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | /** |
| | | * @author :WuZeYu |
| | | * @Date :2024/5/16 18:07 |
| | | * @LastEditTime :2024/5/16 18:07 |
| | | * @Description |
| | | */ |
| | | @Slf4j |
| | | @Tag(name = "灌溉单元", description = "灌溉单元") |
| | | @RestController |
| | | @RequestMapping(path = "irrigate/unit") |
| | | @RequiredArgsConstructor |
| | | public class IrrigateUnitCtrl { |
| | | @Autowired |
| | | private IrrigateUnitSv irrigateUnitSv; |
| | | } |
New file |
| | |
| | | package com.dy.pipIrrIrrigate.irrigateUnit; |
| | | |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | /** |
| | | * @author :WuZeYu |
| | | * @Date :2024/5/16 18:11 |
| | | * @LastEditTime :2024/5/16 18:11 |
| | | * @Description |
| | | */ |
| | | @Slf4j |
| | | @Service |
| | | public class IrrigateUnitSv { |
| | | } |
| | |
| | | import com.dy.pipIrrGlobal.pojoIr.IrProject; |
| | | import com.dy.pipIrrGlobal.pojoPr.PrIntake; |
| | | import com.dy.pipIrrGlobal.voIr.VoProject; |
| | | import com.dy.pipIrrGlobal.voIr.VoProjectOne; |
| | | import com.dy.pipIrrGlobal.voPr.VoIntake; |
| | | import com.dy.pipIrrGlobal.voSe.VoActiveCard; |
| | | import com.dy.pipIrrIrrigate.result.IrrigateResultCode; |
| | |
| | | }) |
| | | @GetMapping(path = "one") |
| | | @SsoAop() |
| | | public BaseResponse<IrProject> one(@RequestParam Long id) { |
| | | IrProject irProject = this.projectSv.selectById(id); |
| | | public BaseResponse<VoProjectOne> one(@RequestParam Long id) { |
| | | VoProjectOne irProject = this.projectSv.selectById(id); |
| | | if (irProject == null) { |
| | | return BaseResponseUtils.buildFail(IrrigateResultCode.NO_PROJECT.getMessage()); |
| | | } else { |
| | |
| | | import com.dy.pipIrrGlobal.daoIr.IrProjectMapper; |
| | | import com.dy.pipIrrGlobal.pojoIr.IrProject; |
| | | import com.dy.pipIrrGlobal.voIr.VoProject; |
| | | import com.dy.pipIrrGlobal.voIr.VoProjectOne; |
| | | import com.dy.pipIrrGlobal.voPr.VoIntake; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.apache.dubbo.common.utils.PojoUtils; |
| | |
| | | * @param id |
| | | * @return |
| | | */ |
| | | public IrProject selectById(Long id){ |
| | | IrProject irProject = irProjectMapper.selectById(id); |
| | | public VoProjectOne selectById(Long id){ |
| | | VoProjectOne irProject = irProjectMapper.selectById(id); |
| | | return irProject; |
| | | } |
| | | |
New file |
| | |
| | | package com.dy.pipIrrIrrigate.project; |
| | | |
| | | import com.dy.common.webUtil.QueryConditionVo; |
| | | import io.swagger.v3.oas.annotations.media.Schema; |
| | | import lombok.*; |
| | | |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * @author :WuZeYu |
| | | * @Date :2024/5/15 21:11 |
| | | * @LastEditTime :2024/5/15 21:11 |
| | | * @Description |
| | | */ |
| | | @Data |
| | | @EqualsAndHashCode(callSuper = false) |
| | | @ToString(callSuper = true) |
| | | @NoArgsConstructor |
| | | @AllArgsConstructor |
| | | @Builder |
| | | @Schema(name = "项目查询条件(查一个)") |
| | | public class QueryVoOne extends QueryConditionVo { |
| | | @Schema(description = "项目名称") |
| | | public String projectName; |
| | | |
| | | @Schema(description = "项目Id") |
| | | private Long id; |
| | | /** |
| | | * 省ID |
| | | */ |
| | | @Schema(description = "省ID") |
| | | private Long provinceId; |
| | | /** |
| | | * 市ID |
| | | */ |
| | | @Schema(description = "市ID") |
| | | private Long cityId; |
| | | /** |
| | | * 县ID |
| | | */ |
| | | @Schema(description = "县ID") |
| | | private Long countyId; |
| | | /** |
| | | * 镇ID |
| | | */ |
| | | @Schema(description = "镇ID") |
| | | private Long townId; |
| | | /** |
| | | * 村ID |
| | | */ |
| | | @Schema(description = "村ID") |
| | | private Long villageId; |
| | | /** |
| | | * 项目状态;1-启动,2-停止 |
| | | */ |
| | | @Schema(description = "项目状态") |
| | | private Byte projectState; |
| | | |
| | | /** |
| | | * 操作人ID |
| | | */ |
| | | @Schema(description = "操作人ID") |
| | | private Long operator; |
| | | |
| | | /** |
| | | * 操作时间 |
| | | */ |
| | | @Schema(description = "操作时间") |
| | | private Date operateDt; |
| | | |
| | | /** |
| | | * 备注 |
| | | */ |
| | | @Schema(description = "备注") |
| | | private String remarks; |
| | | |
| | | /** |
| | | * 逻辑删除标识;0-未删除,1-删除 |
| | | */ |
| | | @Schema(description = "删除标识") |
| | | private Byte deleted; |
| | | } |