feat (farm): 业务功能
- 字典表,收纳所有的字典内容 - 管理中心 (农事类型,农事名称)维护到字典表中 - 种植中心 (生产计划,农事记录)业务逻辑接口实现
This commit is contained in:
@@ -0,0 +1,120 @@
|
|||||||
|
package cn.iocoder.yudao.module.farm.controller.admin.cropFarmingCenter;
|
||||||
|
|
||||||
|
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||||
|
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||||
|
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||||
|
import cn.iocoder.yudao.module.farm.controller.admin.farmingrecord.vo.FarmingRecordPageReqVO;
|
||||||
|
import cn.iocoder.yudao.module.farm.controller.admin.farmingrecord.vo.FarmingRecordRespVO;
|
||||||
|
import cn.iocoder.yudao.module.farm.controller.admin.farmingrecord.vo.FarmingRecordSaveReqVO;
|
||||||
|
import cn.iocoder.yudao.module.farm.controller.admin.productionplan.vo.ProductionPlanPageReqVO;
|
||||||
|
import cn.iocoder.yudao.module.farm.controller.admin.productionplan.vo.ProductionPlanRespVO;
|
||||||
|
import cn.iocoder.yudao.module.farm.controller.admin.productionplan.vo.ProductionPlanSaveReqVO;
|
||||||
|
import cn.iocoder.yudao.module.farm.dal.dataobject.farmingrecord.FarmingRecordDO;
|
||||||
|
import cn.iocoder.yudao.module.farm.dal.dataobject.productionplan.ProductionPlanDO;
|
||||||
|
import cn.iocoder.yudao.module.farm.service.cropFarmingCenter.CropFarmingCenterService;
|
||||||
|
import cn.iocoder.yudao.module.farm.service.farmingrecord.FarmingRecordService;
|
||||||
|
import cn.iocoder.yudao.module.farm.service.productionplan.ProductionPlanService;
|
||||||
|
import io.swagger.v3.oas.annotations.Operation;
|
||||||
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
|
import jakarta.validation.Valid;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.springframework.validation.annotation.Validated;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @description: 种植中心
|
||||||
|
* 种植区域: farm_cultivation_area
|
||||||
|
* 模型: farm_model_management
|
||||||
|
* 生产计划: farm_production_plan
|
||||||
|
* 农事记录: farm_farming_record
|
||||||
|
* @author: binda
|
||||||
|
* @date: 2025/8/19 10:39
|
||||||
|
*/
|
||||||
|
@Tag(name = "种植中心")
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/farm/farming-center")
|
||||||
|
@Validated
|
||||||
|
@Slf4j
|
||||||
|
public class CropFarmingCenterController {
|
||||||
|
|
||||||
|
private final CropFarmingCenterService cropFarmingCenterService;
|
||||||
|
private final ProductionPlanService productionPlanService;
|
||||||
|
private final FarmingRecordService farmingRecordService;
|
||||||
|
|
||||||
|
public CropFarmingCenterController(CropFarmingCenterService cropFarmingCenterService,
|
||||||
|
ProductionPlanService productionPlanService,
|
||||||
|
FarmingRecordService farmingRecordService) {
|
||||||
|
this.cropFarmingCenterService = cropFarmingCenterService;
|
||||||
|
this.productionPlanService = productionPlanService;
|
||||||
|
this.farmingRecordService = farmingRecordService;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// 生产计划
|
||||||
|
@GetMapping("/production-plan/page")
|
||||||
|
@Operation(summary = "生产计划-分页")
|
||||||
|
public CommonResult<PageResult<ProductionPlanRespVO>> getProductionPlanPage(@Valid ProductionPlanPageReqVO pageReqVO) {
|
||||||
|
PageResult<ProductionPlanDO> pageResult = productionPlanService.getProductionPlanPage(pageReqVO);
|
||||||
|
return success(BeanUtils.toBean(pageResult, ProductionPlanRespVO.class));
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/production-plan/get/{id}")
|
||||||
|
@Operation(summary = "生产计划-查看")
|
||||||
|
public CommonResult<ProductionPlanRespVO> getProductionPlan(@PathVariable("id") String id) {
|
||||||
|
ProductionPlanDO productionPlan = productionPlanService.getProductionPlan(id);
|
||||||
|
return success(BeanUtils.toBean(productionPlan, ProductionPlanRespVO.class));
|
||||||
|
}
|
||||||
|
|
||||||
|
@PostMapping("/production-plan/create")
|
||||||
|
@Operation(summary = "生产计划-创建")
|
||||||
|
public CommonResult<String> createProductionPlan(@Valid @RequestBody cn.iocoder.yudao.module.farm.controller.admin.cropFarmingCenter.vo.ProductionPlanSaveReqVO createReqVO) {
|
||||||
|
String res = cropFarmingCenterService.createProductionPlan(createReqVO);
|
||||||
|
return success(res);
|
||||||
|
}
|
||||||
|
|
||||||
|
@PutMapping("/production-plan/update")
|
||||||
|
@Operation(summary = "生产计划-编辑")
|
||||||
|
public CommonResult<Boolean> updateProductionPlan(@Valid @RequestBody ProductionPlanSaveReqVO updateReqVO) {
|
||||||
|
productionPlanService.updateProductionPlan(updateReqVO);
|
||||||
|
return success(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
// 农事记录
|
||||||
|
@GetMapping("/farming-record/page")
|
||||||
|
@Operation(summary = "农事记录-分页")
|
||||||
|
public CommonResult<PageResult<FarmingRecordRespVO>> getFarmingRecordPage(@Valid FarmingRecordPageReqVO pageReqVO) {
|
||||||
|
PageResult<FarmingRecordDO> pageResult = farmingRecordService.getFarmingRecordPage(pageReqVO);
|
||||||
|
return success(BeanUtils.toBean(pageResult, FarmingRecordRespVO.class));
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/farming-record/get/{id}")
|
||||||
|
@Operation(summary = "农事记录-查看")
|
||||||
|
public CommonResult<FarmingRecordRespVO> getFarmingRecord(@PathVariable("id") String id) {
|
||||||
|
FarmingRecordDO farmingRecord = farmingRecordService.getFarmingRecord(id);
|
||||||
|
return success(BeanUtils.toBean(farmingRecord, FarmingRecordRespVO.class));
|
||||||
|
}
|
||||||
|
|
||||||
|
@PostMapping("/farming-record/create")
|
||||||
|
@Operation(summary = "农事记录-新增")
|
||||||
|
public CommonResult<String> createFarmingRecord(@Valid @RequestBody FarmingRecordSaveReqVO createReqVO) {
|
||||||
|
return success(farmingRecordService.createFarmingRecord(createReqVO));
|
||||||
|
}
|
||||||
|
|
||||||
|
@PutMapping("/farming-record/update")
|
||||||
|
@Operation(summary = "农事记录-编辑")
|
||||||
|
public CommonResult<Boolean> updateFarmingRecord(@Valid @RequestBody FarmingRecordSaveReqVO updateReqVO) {
|
||||||
|
farmingRecordService.updateFarmingRecord(updateReqVO);
|
||||||
|
return success(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
@DeleteMapping("/farming-record/delete/{id}")
|
||||||
|
@Operation(summary = "农事记录-删除")
|
||||||
|
public CommonResult<Boolean> deleteFarmingRecord(@PathVariable("id") String id) {
|
||||||
|
farmingRecordService.deleteFarmingRecord(id);
|
||||||
|
return success(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,80 @@
|
|||||||
|
package cn.iocoder.yudao.module.farm.controller.admin.cropFarmingCenter.vo;
|
||||||
|
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.time.LocalDate;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @description: 生产计划 - 保存请求实体类
|
||||||
|
* @author: binda
|
||||||
|
* @date: 2025/8/19 11:29
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class ProductionPlanSaveReqVO {
|
||||||
|
|
||||||
|
@Schema(description = "UUID")
|
||||||
|
private String id;
|
||||||
|
|
||||||
|
@Schema(description = "计划编号")
|
||||||
|
private String planNumber;
|
||||||
|
|
||||||
|
@Schema(description = "种植物种-编码")
|
||||||
|
private String plantSpeciesCode;
|
||||||
|
|
||||||
|
@Schema(description = "物种模型-ID")
|
||||||
|
private String speciesModelId;
|
||||||
|
|
||||||
|
@Schema(description = "排产开始日期")
|
||||||
|
private LocalDate productionStartDate;
|
||||||
|
|
||||||
|
@Schema(description = "排产结束日期")
|
||||||
|
private LocalDate productionEndDate;
|
||||||
|
|
||||||
|
@Schema(description = "采收开始日期")
|
||||||
|
private LocalDate harvestStartDate;
|
||||||
|
|
||||||
|
@Schema(description = "计划执行状态")
|
||||||
|
private Integer planStatus;
|
||||||
|
|
||||||
|
@Schema(description = "种植区域集合")
|
||||||
|
private List<CultivationArea> cultivationAreaList;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 种植区域
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public static class CultivationArea {
|
||||||
|
|
||||||
|
@Schema(description = "租户ID")
|
||||||
|
private String tenantId;
|
||||||
|
@Schema(description = "基地ID")
|
||||||
|
private String baseId;
|
||||||
|
@Schema(description = "基地名称")
|
||||||
|
private String baseName;
|
||||||
|
@Schema(description = "地块ID")
|
||||||
|
private String plotId;
|
||||||
|
@Schema(description = "地块名称")
|
||||||
|
private String plotName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 种植区域信息
|
||||||
|
*/
|
||||||
|
@Schema(description = "种植日期")
|
||||||
|
private LocalDate plantingDate;
|
||||||
|
@Schema(description = "种植株数")
|
||||||
|
private LocalDate plantingQuantity;
|
||||||
|
@Schema(description = "预计产量")
|
||||||
|
private Long predictedYields;
|
||||||
|
@Schema(description = "计划面积")
|
||||||
|
private Long predictedArea;
|
||||||
|
@Schema(description = "剩余面积")
|
||||||
|
private Long remainingArea;
|
||||||
|
@Schema(description = "占地面积")
|
||||||
|
private Integer usagePercentage;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -3,9 +3,12 @@ package cn.iocoder.yudao.module.farm.controller.admin.dict;
|
|||||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||||
import cn.iocoder.yudao.module.farm.controller.admin.dict.vo.CommonDictRespVO;
|
import cn.iocoder.yudao.module.farm.controller.admin.dict.vo.*;
|
||||||
import cn.iocoder.yudao.module.farm.controller.admin.dict.vo.FarmingTypeRespVO;
|
import cn.iocoder.yudao.module.farm.controller.admin.dict.vo.sys.SysDictRespVO;
|
||||||
import cn.iocoder.yudao.module.farm.controller.admin.dict.vo.SpeciesClassifyLibraryRespVO;
|
import cn.iocoder.yudao.module.farm.controller.admin.dict.vo.sys.SysDictTypeCodeRespVO;
|
||||||
|
import cn.iocoder.yudao.module.farm.controller.admin.disasterdata.vo.DisasterDataPageReqVO;
|
||||||
|
import cn.iocoder.yudao.module.farm.controller.admin.disasterdata.vo.DisasterDataRespVO;
|
||||||
|
import cn.iocoder.yudao.module.farm.controller.admin.disasterdata.vo.DisasterDataSaveReqVO;
|
||||||
import cn.iocoder.yudao.module.farm.controller.admin.farmingnamemaintenance.vo.FarmingNameMaintenancePageReqVO;
|
import cn.iocoder.yudao.module.farm.controller.admin.farmingnamemaintenance.vo.FarmingNameMaintenancePageReqVO;
|
||||||
import cn.iocoder.yudao.module.farm.controller.admin.farmingnamemaintenance.vo.FarmingNameMaintenanceRespVO;
|
import cn.iocoder.yudao.module.farm.controller.admin.farmingnamemaintenance.vo.FarmingNameMaintenanceRespVO;
|
||||||
import cn.iocoder.yudao.module.farm.controller.admin.farmingnamemaintenance.vo.FarmingNameMaintenanceSaveReqVO;
|
import cn.iocoder.yudao.module.farm.controller.admin.farmingnamemaintenance.vo.FarmingNameMaintenanceSaveReqVO;
|
||||||
@@ -18,16 +21,20 @@ import cn.iocoder.yudao.module.farm.controller.admin.inputlibrary.vo.InputLibrar
|
|||||||
import cn.iocoder.yudao.module.farm.controller.admin.specieslibrary.vo.SpeciesLibraryPageReqVO;
|
import cn.iocoder.yudao.module.farm.controller.admin.specieslibrary.vo.SpeciesLibraryPageReqVO;
|
||||||
import cn.iocoder.yudao.module.farm.controller.admin.specieslibrary.vo.SpeciesLibraryRespVO;
|
import cn.iocoder.yudao.module.farm.controller.admin.specieslibrary.vo.SpeciesLibraryRespVO;
|
||||||
import cn.iocoder.yudao.module.farm.controller.admin.specieslibrary.vo.SpeciesLibrarySaveReqVO;
|
import cn.iocoder.yudao.module.farm.controller.admin.specieslibrary.vo.SpeciesLibrarySaveReqVO;
|
||||||
|
import cn.iocoder.yudao.module.farm.dal.dataobject.disasterdata.DisasterDataDO;
|
||||||
import cn.iocoder.yudao.module.farm.dal.dataobject.farmingnamemaintenance.FarmingNameMaintenanceDO;
|
import cn.iocoder.yudao.module.farm.dal.dataobject.farmingnamemaintenance.FarmingNameMaintenanceDO;
|
||||||
import cn.iocoder.yudao.module.farm.dal.dataobject.farmingtypemaintenance.FarmingTypeMaintenanceDO;
|
import cn.iocoder.yudao.module.farm.dal.dataobject.farmingtypemaintenance.FarmingTypeMaintenanceDO;
|
||||||
import cn.iocoder.yudao.module.farm.dal.dataobject.inputlibrary.InputLibraryDO;
|
import cn.iocoder.yudao.module.farm.dal.dataobject.inputlibrary.InputLibraryDO;
|
||||||
import cn.iocoder.yudao.module.farm.dal.dataobject.speciesclassifylibrary.SpeciesClassifyLibraryDO;
|
import cn.iocoder.yudao.module.farm.dal.dataobject.speciesclassifylibrary.SpeciesClassifyLibraryDO;
|
||||||
import cn.iocoder.yudao.module.farm.dal.dataobject.specieslibrary.SpeciesLibraryDO;
|
import cn.iocoder.yudao.module.farm.dal.dataobject.specieslibrary.SpeciesLibraryDO;
|
||||||
|
import cn.iocoder.yudao.module.farm.dal.mysql.sysDict.SysDictDO;
|
||||||
|
import cn.iocoder.yudao.module.farm.service.disasterdata.DisasterDataService;
|
||||||
import cn.iocoder.yudao.module.farm.service.farmingnamemaintenance.FarmingNameMaintenanceService;
|
import cn.iocoder.yudao.module.farm.service.farmingnamemaintenance.FarmingNameMaintenanceService;
|
||||||
import cn.iocoder.yudao.module.farm.service.farmingtypemaintenance.FarmingTypeMaintenanceService;
|
import cn.iocoder.yudao.module.farm.service.farmingtypemaintenance.FarmingTypeMaintenanceService;
|
||||||
import cn.iocoder.yudao.module.farm.service.inputlibrary.InputLibraryService;
|
import cn.iocoder.yudao.module.farm.service.inputlibrary.InputLibraryService;
|
||||||
import cn.iocoder.yudao.module.farm.service.speciesclassifylibrary.SpeciesClassifyLibraryService;
|
import cn.iocoder.yudao.module.farm.service.speciesclassifylibrary.SpeciesClassifyLibraryService;
|
||||||
import cn.iocoder.yudao.module.farm.service.specieslibrary.SpeciesLibraryService;
|
import cn.iocoder.yudao.module.farm.service.specieslibrary.SpeciesLibraryService;
|
||||||
|
import cn.iocoder.yudao.module.farm.service.sysDict.SysDictService;
|
||||||
import io.swagger.v3.oas.annotations.Operation;
|
import io.swagger.v3.oas.annotations.Operation;
|
||||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
import jakarta.validation.Valid;
|
import jakarta.validation.Valid;
|
||||||
@@ -46,8 +53,7 @@ import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
|||||||
* 物种库维护: farm_species_library
|
* 物种库维护: farm_species_library
|
||||||
* 物种分类库维护 farm_species_classify_library
|
* 物种分类库维护 farm_species_classify_library
|
||||||
* 投入品库维护: farm_input_library
|
* 投入品库维护: farm_input_library
|
||||||
* 灾害库维护: farm_disaster_data
|
* 灾害/气象灾害库维护: farm_disaster_data
|
||||||
* 气象灾害库维护 : farm_weather_disaster_library
|
|
||||||
* @author: binda
|
* @author: binda
|
||||||
* @date: 2025/8/16 16:07
|
* @date: 2025/8/16 16:07
|
||||||
*/
|
*/
|
||||||
@@ -62,41 +68,52 @@ public class DictController {
|
|||||||
private final SpeciesLibraryService speciesLibraryService;
|
private final SpeciesLibraryService speciesLibraryService;
|
||||||
private final SpeciesClassifyLibraryService speciesClassifyLibraryService;
|
private final SpeciesClassifyLibraryService speciesClassifyLibraryService;
|
||||||
private final InputLibraryService inputLibraryService;
|
private final InputLibraryService inputLibraryService;
|
||||||
|
private final DisasterDataService disasterDataService;
|
||||||
|
private final SysDictService sysDictService;
|
||||||
|
|
||||||
public DictController(FarmingTypeMaintenanceService farmingTypeMaintenanceService, FarmingNameMaintenanceService farmingNameMaintenanceService, SpeciesLibraryService speciesLibraryService, SpeciesClassifyLibraryService speciesClassifyLibraryService, InputLibraryService inputLibraryService) {
|
public DictController(FarmingTypeMaintenanceService farmingTypeMaintenanceService, FarmingNameMaintenanceService farmingNameMaintenanceService, SpeciesLibraryService speciesLibraryService, SpeciesClassifyLibraryService speciesClassifyLibraryService, InputLibraryService inputLibraryService, DisasterDataService disasterDataService, SysDictService sysDictService) {
|
||||||
this.farmingTypeMaintenanceService = farmingTypeMaintenanceService;
|
this.farmingTypeMaintenanceService = farmingTypeMaintenanceService;
|
||||||
this.farmingNameMaintenanceService = farmingNameMaintenanceService;
|
this.farmingNameMaintenanceService = farmingNameMaintenanceService;
|
||||||
this.speciesLibraryService = speciesLibraryService;
|
this.speciesLibraryService = speciesLibraryService;
|
||||||
this.speciesClassifyLibraryService = speciesClassifyLibraryService;
|
this.speciesClassifyLibraryService = speciesClassifyLibraryService;
|
||||||
this.inputLibraryService = inputLibraryService;
|
this.inputLibraryService = inputLibraryService;
|
||||||
|
this.disasterDataService = disasterDataService;
|
||||||
|
this.sysDictService = sysDictService;
|
||||||
}
|
}
|
||||||
|
|
||||||
// 农事类型
|
// 农事类型
|
||||||
@Operation(summary = "字典数据维护-农事类型-分页")
|
@Operation(summary = "字典数据维护-农事类型-分页")
|
||||||
@GetMapping("/farming-type/page")
|
@GetMapping("/farming-type/page")
|
||||||
public CommonResult<PageResult<FarmingTypeMaintenanceRespVO>> getFarmingTypePage(FarmingTypeMaintenancePageReqVO reqVO) {
|
public CommonResult<PageResult<FarmingTypeMaintenanceRespVO>> getFarmingTypePage(FarmingTypeMaintenancePageReqVO reqVO) {
|
||||||
PageResult<FarmingTypeMaintenanceDO> pageResult = farmingTypeMaintenanceService.getFarmingTypeMaintenancePage(reqVO);
|
PageResult<FarmingTypeMaintenanceDO> result = sysDictService.getFarmingTypeMaintenancePage(reqVO);
|
||||||
return success(BeanUtils.toBean(pageResult, FarmingTypeMaintenanceRespVO.class));
|
return success(BeanUtils.toBean(result, FarmingTypeMaintenanceRespVO.class));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Operation(summary = "字典数据维护-农事类型-查看")
|
||||||
|
@GetMapping("/farming-type/get/{id}")
|
||||||
|
public CommonResult<FarmingTypeMaintenanceRespVO> getFarmingTypeMaintenance(@PathVariable("id") String id) {
|
||||||
|
FarmingTypeMaintenanceDO aDo = sysDictService.getFarmingTypeMaintenance(id);
|
||||||
|
return success(BeanUtils.toBean(aDo, FarmingTypeMaintenanceRespVO.class));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Operation(summary = "字典数据维护-农事类型-新增")
|
@Operation(summary = "字典数据维护-农事类型-新增")
|
||||||
@PostMapping("/farming-type/create")
|
@PostMapping("/farming-type/create")
|
||||||
public CommonResult<String> createFarmingType(@RequestBody FarmingTypeMaintenanceSaveReqVO saveVO) {
|
public CommonResult<Boolean> createFarmingType(@RequestBody FarmingTypeMaintenanceSaveReqVO saveVO) {
|
||||||
String res = farmingTypeMaintenanceService.createFarmingTypeMaintenance(saveVO);
|
sysDictService.createFarmingTypeMaintenance(saveVO);
|
||||||
return success(res);
|
return success(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Operation(summary = "字典数据维护-农事类型-编辑")
|
@Operation(summary = "字典数据维护-农事类型-编辑")
|
||||||
@PutMapping("/farming-type/update")
|
@PutMapping("/farming-type/update")
|
||||||
public CommonResult<Boolean> updateFarmingType(@RequestBody FarmingTypeMaintenanceSaveReqVO updateVO) {
|
public CommonResult<Boolean> updateFarmingType(@RequestBody FarmingTypeMaintenanceSaveReqVO updateVO) {
|
||||||
farmingTypeMaintenanceService.updateFarmingTypeMaintenance(updateVO);
|
sysDictService.updateFarmingTypeMaintenance(updateVO);
|
||||||
return success(true);
|
return success(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Operation(summary = "字典数据维护-农事类型-删除")
|
@Operation(summary = "字典数据维护-农事类型-删除")
|
||||||
@DeleteMapping("/farming-type/delete/{id}")
|
@DeleteMapping("/farming-type/delete/{id}")
|
||||||
public CommonResult<Boolean> delFarmingType(@PathVariable("id") String id) {
|
public CommonResult<Boolean> delFarmingType(@PathVariable("id") String id) {
|
||||||
farmingTypeMaintenanceService.deleteFarmingTypeMaintenance(id);
|
sysDictService.deleteFarmingTypeMaintenance(id);
|
||||||
return success(true);
|
return success(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -104,21 +121,29 @@ public class DictController {
|
|||||||
@Operation(summary = "字典数据维护-农事名称-分页")
|
@Operation(summary = "字典数据维护-农事名称-分页")
|
||||||
@GetMapping("/farming-name/page")
|
@GetMapping("/farming-name/page")
|
||||||
public CommonResult<PageResult<FarmingNameMaintenanceRespVO>> getFarmingNameMaintenancePage(@Valid FarmingNameMaintenancePageReqVO pageReqVO) {
|
public CommonResult<PageResult<FarmingNameMaintenanceRespVO>> getFarmingNameMaintenancePage(@Valid FarmingNameMaintenancePageReqVO pageReqVO) {
|
||||||
PageResult<FarmingNameMaintenanceDO> pageResult = farmingNameMaintenanceService.getFarmingNameMaintenancePage(pageReqVO);
|
PageResult<FarmingNameMaintenanceDO> pageResult = sysDictService.getFarmingNameMaintenancePage(pageReqVO);
|
||||||
return success(BeanUtils.toBean(pageResult, FarmingNameMaintenanceRespVO.class));
|
return success(BeanUtils.toBean(pageResult, FarmingNameMaintenanceRespVO.class));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Operation(summary = "字典数据维护-农事名称-查看")
|
||||||
|
@GetMapping("/farming-name/get/{id}")
|
||||||
|
public CommonResult<FarmingNameMaintenanceRespVO> getFarmingNameMaintenance(@PathVariable("id") String id) {
|
||||||
|
FarmingNameMaintenanceDO farmingNameMaintenance = sysDictService.getFarmingNameMaintenance(id);
|
||||||
|
return success(BeanUtils.toBean(farmingNameMaintenance, FarmingNameMaintenanceRespVO.class));
|
||||||
|
}
|
||||||
|
|
||||||
@Operation(summary = "字典数据维护-农事名称-新增")
|
@Operation(summary = "字典数据维护-农事名称-新增")
|
||||||
@PostMapping("/farming-name/create")
|
@PostMapping("/farming-name/create")
|
||||||
public CommonResult<String> createFarmingNameMaintenance(@Valid @RequestBody FarmingNameMaintenanceSaveReqVO createReqVO) {
|
public CommonResult<Boolean> createFarmingNameMaintenance(@Valid @RequestBody FarmingNameMaintenanceSaveReqVO createReqVO) {
|
||||||
return success(farmingNameMaintenanceService.createFarmingNameMaintenance(createReqVO));
|
sysDictService.createFarmingNameMaintenance(createReqVO);
|
||||||
|
return success(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@Operation(summary = "字典数据维护-农事名称-编辑")
|
@Operation(summary = "字典数据维护-农事名称-编辑")
|
||||||
@PutMapping("/farming-name/update")
|
@PutMapping("/farming-name/update")
|
||||||
public CommonResult<Boolean> updateFarmingNameMaintenance(@Valid @RequestBody FarmingNameMaintenanceSaveReqVO updateReqVO) {
|
public CommonResult<Boolean> updateFarmingNameMaintenance(@Valid @RequestBody FarmingNameMaintenanceSaveReqVO updateReqVO) {
|
||||||
farmingNameMaintenanceService.updateFarmingNameMaintenance(updateReqVO);
|
sysDictService.updateFarmingNameMaintenance(updateReqVO);
|
||||||
return success(true);
|
return success(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -126,7 +151,7 @@ public class DictController {
|
|||||||
@Operation(summary = "字典数据维护-农事名称-删除")
|
@Operation(summary = "字典数据维护-农事名称-删除")
|
||||||
@DeleteMapping("/farming-name/delete/{id}")
|
@DeleteMapping("/farming-name/delete/{id}")
|
||||||
public CommonResult<Boolean> deleteFarmingNameMaintenance(@PathVariable("id") String id) {
|
public CommonResult<Boolean> deleteFarmingNameMaintenance(@PathVariable("id") String id) {
|
||||||
farmingNameMaintenanceService.deleteFarmingNameMaintenance(id);
|
sysDictService.deleteFarmingNameMaintenance(id);
|
||||||
return success(true);
|
return success(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -138,6 +163,13 @@ public class DictController {
|
|||||||
return success(BeanUtils.toBean(pageResult, SpeciesLibraryRespVO.class));
|
return success(BeanUtils.toBean(pageResult, SpeciesLibraryRespVO.class));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Operation(summary = "字典数据维护-物种库-查看")
|
||||||
|
@GetMapping("/species/get/{id}")
|
||||||
|
public CommonResult<SpeciesLibraryRespVO> getSpeciesLibrary(@PathVariable("id") String id) {
|
||||||
|
SpeciesLibraryDO speciesLibrary = speciesLibraryService.getSpeciesLibrary(id);
|
||||||
|
return success(BeanUtils.toBean(speciesLibrary, SpeciesLibraryRespVO.class));
|
||||||
|
}
|
||||||
|
|
||||||
@Operation(summary = "字典数据维护-物种库-新增")
|
@Operation(summary = "字典数据维护-物种库-新增")
|
||||||
@PostMapping("/species/create")
|
@PostMapping("/species/create")
|
||||||
public CommonResult<String> createSpeciesLibrary(@Valid @RequestBody SpeciesLibrarySaveReqVO createReqVO) {
|
public CommonResult<String> createSpeciesLibrary(@Valid @RequestBody SpeciesLibrarySaveReqVO createReqVO) {
|
||||||
@@ -169,6 +201,13 @@ public class DictController {
|
|||||||
return success(BeanUtils.toBean(pageResult, InputLibraryRespVO.class));
|
return success(BeanUtils.toBean(pageResult, InputLibraryRespVO.class));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Operation(summary = "字典数据维护-投入品-查看")
|
||||||
|
@GetMapping("/invest-goods/get/{id}")
|
||||||
|
public CommonResult<InputLibraryRespVO> getInputLibrary(@PathVariable("id") String id) {
|
||||||
|
InputLibraryDO inputLibrary = inputLibraryService.getInputLibrary(id);
|
||||||
|
return success(BeanUtils.toBean(inputLibrary, InputLibraryRespVO.class));
|
||||||
|
}
|
||||||
|
|
||||||
@Operation(summary = "字典数据维护-投入品-新增")
|
@Operation(summary = "字典数据维护-投入品-新增")
|
||||||
@PostMapping("/invest-goods/create")
|
@PostMapping("/invest-goods/create")
|
||||||
public CommonResult<String> createInputLibrary(@Valid @RequestBody InputLibrarySaveReqVO createReqVO) {
|
public CommonResult<String> createInputLibrary(@Valid @RequestBody InputLibrarySaveReqVO createReqVO) {
|
||||||
@@ -190,11 +229,40 @@ public class DictController {
|
|||||||
return success(true);
|
return success(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 灾害库维护
|
// 灾害/气象灾害库维护
|
||||||
|
@Operation(summary = "字典数据维护-灾害库-分页")
|
||||||
|
@GetMapping("/disaster/page")
|
||||||
|
public CommonResult<PageResult<DisasterDataRespVO>> getDisasterDataPage(@Valid DisasterDataPageReqVO pageReqVO) {
|
||||||
|
PageResult<DisasterDataDO> pageResult = disasterDataService.getDisasterDataPage(pageReqVO);
|
||||||
|
return success(BeanUtils.toBean(pageResult, DisasterDataRespVO.class));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Operation(summary = "字典数据维护-灾害库-查看")
|
||||||
|
@GetMapping("/disaster/get/{id}")
|
||||||
|
public CommonResult<DisasterDataRespVO> getDisasterData(@PathVariable("id") String id) {
|
||||||
|
DisasterDataDO disasterData = disasterDataService.getDisasterData(id);
|
||||||
|
return success(BeanUtils.toBean(disasterData, DisasterDataRespVO.class));
|
||||||
|
}
|
||||||
|
|
||||||
// 气象灾害库维护
|
@Operation(summary = "字典数据维护-灾害库-新增")
|
||||||
|
@PostMapping("/disaster/create")
|
||||||
|
public CommonResult<String> createDisasterData(@Valid @RequestBody DisasterDataSaveReqVO createReqVO) {
|
||||||
|
return success(disasterDataService.createDisasterData(createReqVO));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Operation(summary = "字典数据维护-灾害库-编辑")
|
||||||
|
@PutMapping("/disaster/update")
|
||||||
|
public CommonResult<Boolean> updateDisasterData(@Valid @RequestBody DisasterDataSaveReqVO updateReqVO) {
|
||||||
|
disasterDataService.updateDisasterData(updateReqVO);
|
||||||
|
return success(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Operation(summary = "字典数据维护-灾害库-删除")
|
||||||
|
@DeleteMapping("/disaster/delete/{id}")
|
||||||
|
public CommonResult<Boolean> deleteDisasterData(@PathVariable("id") String id) {
|
||||||
|
disasterDataService.deleteDisasterData(id);
|
||||||
|
return success(true);
|
||||||
|
}
|
||||||
|
|
||||||
// 下拉框列表
|
// 下拉框列表
|
||||||
@Operation(summary = "字典数据维护-下拉框列表-农事类型")
|
@Operation(summary = "字典数据维护-下拉框列表-农事类型")
|
||||||
@@ -211,6 +279,30 @@ public class DictController {
|
|||||||
return success(BeanUtils.toBean(res, SpeciesClassifyLibraryRespVO.class));
|
return success(BeanUtils.toBean(res, SpeciesClassifyLibraryRespVO.class));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Operation(summary = "字典数据维护-下拉框列表-通用字典分类查询")
|
||||||
|
@GetMapping("/list/{dictTypeCode}")
|
||||||
|
public CommonResult<List<SysDictRespVO>> getSysDictList(@PathVariable("dictTypeCode") String dictTypeCode) {
|
||||||
|
List<SysDictDO> res = sysDictService.getByTypeCode(dictTypeCode);
|
||||||
|
return success(BeanUtils.toBean(res, SysDictRespVO.class));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Operation(summary = "字典数据维护-下拉框列表-字典分类名称")
|
||||||
|
@GetMapping("/list")
|
||||||
|
public CommonResult<List<SysDictTypeCodeRespVO>> getSysDictList() {
|
||||||
|
List<SysDictDO> res = sysDictService.groupByTypeCode();
|
||||||
|
return success(BeanUtils.toBean(res, SysDictTypeCodeRespVO.class));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@Operation(summary = "字典数据维护-下拉框列表-投入品类型")
|
@Operation(summary = "字典数据维护-下拉框列表-投入品类型")
|
||||||
@GetMapping("/list/invest-goods")
|
@GetMapping("/list/invest-goods")
|
||||||
public CommonResult<List<CommonDictRespVO>> getInvestGoodsList() {
|
public CommonResult<List<CommonDictRespVO>> getInvestGoodsList() {
|
||||||
@@ -259,9 +351,70 @@ public class DictController {
|
|||||||
return success(list);
|
return success(list);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Operation(summary = "字典数据维护-下拉框列表-灾害类型")
|
||||||
|
@GetMapping("/list/disaster")
|
||||||
|
public CommonResult<List<CommonDictRespVO>> getDisasterDataList() {
|
||||||
|
// todo 后续维护到字典表
|
||||||
|
List<CommonDictRespVO> list = Arrays.asList(
|
||||||
|
new CommonDictRespVO("1", "虫害", 1),
|
||||||
|
new CommonDictRespVO("2", "病害", 1),
|
||||||
|
new CommonDictRespVO("3", "草害", 1)
|
||||||
|
);
|
||||||
|
|
||||||
|
return success(list);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Operation(summary = "字典数据维护-下拉框列表-气象灾害名称")
|
||||||
|
@GetMapping("/list/weather/disaster")
|
||||||
|
public CommonResult<List<CommonDictRespVO>> getWeatherDisasterDataList() {
|
||||||
|
// todo 后续维护到字典表
|
||||||
|
List<CommonDictRespVO> list = Arrays.asList(
|
||||||
|
new CommonDictRespVO("1","洪水",1),
|
||||||
|
new CommonDictRespVO("2","内涝",1),
|
||||||
|
new CommonDictRespVO("3","渍涝",1),
|
||||||
|
new CommonDictRespVO("4","洪涝",1),
|
||||||
|
new CommonDictRespVO("5","农业干旱",1),
|
||||||
|
new CommonDictRespVO("6","台风",1),
|
||||||
|
new CommonDictRespVO("7","暴雨",1),
|
||||||
|
new CommonDictRespVO("8","暴雪",1),
|
||||||
|
new CommonDictRespVO("9","寒潮",1),
|
||||||
|
new CommonDictRespVO("10","大风",1),
|
||||||
|
new CommonDictRespVO("11","沙尘暴",1),
|
||||||
|
new CommonDictRespVO("12","高温",1),
|
||||||
|
new CommonDictRespVO("13","干热风",1),
|
||||||
|
new CommonDictRespVO("14","下击暴流",1),
|
||||||
|
new CommonDictRespVO("15","冰雹",1),
|
||||||
|
new CommonDictRespVO("16","霜冻",1),
|
||||||
|
new CommonDictRespVO("17","貍",1),
|
||||||
|
new CommonDictRespVO("18","雷雨大风",1),
|
||||||
|
new CommonDictRespVO("19","道路结冰",1),
|
||||||
|
new CommonDictRespVO("20","干旱",1),
|
||||||
|
new CommonDictRespVO("21","高温中暑",1),
|
||||||
|
new CommonDictRespVO("22","森林火险",1),
|
||||||
|
new CommonDictRespVO("23","草原火险",1),
|
||||||
|
new CommonDictRespVO("24","冰冻",1),
|
||||||
|
new CommonDictRespVO("25","低温雨雪冰冻",1),
|
||||||
|
new CommonDictRespVO("26","大雪",1),
|
||||||
|
new CommonDictRespVO("27","寒冷",1),
|
||||||
|
new CommonDictRespVO("28","连阴雨",1),
|
||||||
|
new CommonDictRespVO("29","渍涝风险",1),
|
||||||
|
new CommonDictRespVO("30","强降雨",1),
|
||||||
|
new CommonDictRespVO("31","强降温",1),
|
||||||
|
new CommonDictRespVO("32","雪灾",1),
|
||||||
|
new CommonDictRespVO("33","雷暴",1),
|
||||||
|
new CommonDictRespVO("34","降温",1),
|
||||||
|
new CommonDictRespVO("35","台风暴雨",1),
|
||||||
|
new CommonDictRespVO("36","严寒",1),
|
||||||
|
new CommonDictRespVO("37","沙尘",1),
|
||||||
|
new CommonDictRespVO("38","低温",1),
|
||||||
|
new CommonDictRespVO("39","雷暴大风",1),
|
||||||
|
new CommonDictRespVO("40","持续低温",1),
|
||||||
|
new CommonDictRespVO("41","台风海浪",1),
|
||||||
|
new CommonDictRespVO("42","森林(草原)火险",1)
|
||||||
|
);
|
||||||
|
|
||||||
|
return success(list);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -21,4 +21,7 @@ public class FarmingTypeRespVO {
|
|||||||
@Schema(description = "农事类型-名称")
|
@Schema(description = "农事类型-名称")
|
||||||
private String farmingName;
|
private String farmingName;
|
||||||
|
|
||||||
|
@Schema(description = "使用状态(0=停用,1=启用)")
|
||||||
|
private Integer useStatus;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,45 @@
|
|||||||
|
package cn.iocoder.yudao.module.farm.controller.admin.dict.vo.sys;
|
||||||
|
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @description:
|
||||||
|
* @author: binda
|
||||||
|
* @date: 2025/8/19 20:14
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class SysDictPageReqVO {
|
||||||
|
|
||||||
|
private Integer pageNo;
|
||||||
|
private Integer pageSize;
|
||||||
|
private Integer offset;
|
||||||
|
|
||||||
|
@Schema(description = "ID")
|
||||||
|
private String id;
|
||||||
|
@Schema(description = "字典分类编码")
|
||||||
|
private String dictTypeCode;
|
||||||
|
@Schema(description = "字典分类名称")
|
||||||
|
private String dictTypeName;
|
||||||
|
|
||||||
|
@Schema(description = "字段1编码")
|
||||||
|
private String field1Code;
|
||||||
|
@Schema(description = "字段1名称")
|
||||||
|
private String field1Name;
|
||||||
|
|
||||||
|
@Schema(description = "字段2编码")
|
||||||
|
private String field2Code;
|
||||||
|
@Schema(description = "字段2名称")
|
||||||
|
private String field2Name;
|
||||||
|
|
||||||
|
@Schema(description = "字段3编码")
|
||||||
|
private String field3Code;
|
||||||
|
@Schema(description = "字段3名称")
|
||||||
|
private String field3Name;
|
||||||
|
|
||||||
|
@Schema(description = "使用状态 (1:启用;0:停用)")
|
||||||
|
private Integer status;
|
||||||
|
@Schema(description = "删除状态 (1:已删除;0:未删除)")
|
||||||
|
private Integer deleted;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,36 @@
|
|||||||
|
package cn.iocoder.yudao.module.farm.controller.admin.dict.vo.sys;
|
||||||
|
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @description: 制定请求实体
|
||||||
|
* @author: binda
|
||||||
|
* @date: 2025/8/19 16:55
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@AllArgsConstructor
|
||||||
|
@NoArgsConstructor
|
||||||
|
public class SysDictReqVO {
|
||||||
|
|
||||||
|
private Integer id;
|
||||||
|
private String dictTypeCode;
|
||||||
|
private String field1Code;
|
||||||
|
private Integer deleted;
|
||||||
|
|
||||||
|
public SysDictReqVO(String dictTypeCode, String field1Code,Integer deleted) {
|
||||||
|
this.dictTypeCode = dictTypeCode;
|
||||||
|
this.field1Code = field1Code;
|
||||||
|
this.deleted = deleted;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public SysDictReqVO(Integer id, String dictTypeCode, Integer deleted) {
|
||||||
|
this.id = id;
|
||||||
|
this.dictTypeCode = dictTypeCode;
|
||||||
|
this.deleted = deleted;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,48 @@
|
|||||||
|
package cn.iocoder.yudao.module.farm.controller.admin.dict.vo.sys;
|
||||||
|
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @description: 字典响应实体
|
||||||
|
* @author: binda
|
||||||
|
* @date: 2025/8/19 16:54
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class SysDictRespVO {
|
||||||
|
|
||||||
|
|
||||||
|
@Schema(description = "ID")
|
||||||
|
private Integer id;
|
||||||
|
|
||||||
|
@Schema(description = "字典分类编码")
|
||||||
|
private String dictTypeCode;
|
||||||
|
|
||||||
|
@Schema(description = "字典分类名称")
|
||||||
|
private String dictTypeName;
|
||||||
|
|
||||||
|
@Schema(description = "字段1编码")
|
||||||
|
private String field1Code;
|
||||||
|
|
||||||
|
@Schema(description = "字段1名称")
|
||||||
|
private String field1Name;
|
||||||
|
|
||||||
|
@Schema(description = "字段2编码")
|
||||||
|
private String field2Code;
|
||||||
|
|
||||||
|
@Schema(description = "字段2名称")
|
||||||
|
private String field2Name;
|
||||||
|
|
||||||
|
@Schema(description = "字段3编码")
|
||||||
|
private String field3Code;
|
||||||
|
|
||||||
|
@Schema(description = "字段3名称")
|
||||||
|
private String field3Name;
|
||||||
|
|
||||||
|
@Schema(description = "启用状态(1:启用;0:停用)")
|
||||||
|
private Integer status;
|
||||||
|
|
||||||
|
@Schema(description = "删除状态(1:已删除;0:未删除)")
|
||||||
|
private Integer deleted;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,44 @@
|
|||||||
|
package cn.iocoder.yudao.module.farm.controller.admin.dict.vo.sys;
|
||||||
|
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @description:
|
||||||
|
* @author: binda
|
||||||
|
* @date: 2025/8/19 22:42
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class SysDictSaveVO {
|
||||||
|
|
||||||
|
@Schema(description = "字典分类编码")
|
||||||
|
private String dictTypeCode;
|
||||||
|
|
||||||
|
@Schema(description = "字典分类名称")
|
||||||
|
private String dictTypeName;
|
||||||
|
|
||||||
|
@Schema(description = "字段1编码")
|
||||||
|
private String field1Code;
|
||||||
|
|
||||||
|
@Schema(description = "字段1名称")
|
||||||
|
private String field1Name;
|
||||||
|
|
||||||
|
@Schema(description = "字段2编码")
|
||||||
|
private String field2Code;
|
||||||
|
|
||||||
|
@Schema(description = "字段2名称")
|
||||||
|
private String field2Name;
|
||||||
|
|
||||||
|
@Schema(description = "字段3编码")
|
||||||
|
private String field3Code;
|
||||||
|
|
||||||
|
@Schema(description = "字段3名称")
|
||||||
|
private String field3Name;
|
||||||
|
|
||||||
|
@Schema(description = "启用状态(1:启用;0:停用)")
|
||||||
|
private Integer status;
|
||||||
|
|
||||||
|
@Schema(description = "删除状态(1:已删除;0:未删除)")
|
||||||
|
private Integer deleted;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,18 @@
|
|||||||
|
package cn.iocoder.yudao.module.farm.controller.admin.dict.vo.sys;
|
||||||
|
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @description:
|
||||||
|
* @author: binda
|
||||||
|
* @date: 2025/8/19 18:37
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class SysDictTypeCodeRespVO {
|
||||||
|
@Schema(description = "字典分类编码")
|
||||||
|
private String dictTypeCode;
|
||||||
|
|
||||||
|
@Schema(description = "字典分类名称")
|
||||||
|
private String dictTypeName;
|
||||||
|
}
|
||||||
@@ -13,6 +13,26 @@ import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_
|
|||||||
@Data
|
@Data
|
||||||
public class DisasterDataPageReqVO extends PageParam {
|
public class DisasterDataPageReqVO extends PageParam {
|
||||||
|
|
||||||
|
@Schema(description = "灾害名称", example = "赵六")
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
@Schema(description = "灾害类型1=环境,2=病害,3=虫害,4=草害")
|
||||||
|
private Integer category;
|
||||||
|
|
||||||
|
@Schema(description = "灾害类型 1:普通; 2:气象灾害")
|
||||||
|
private Integer type;
|
||||||
|
|
||||||
|
@Schema(description = "发生月份")
|
||||||
|
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||||
|
private String[] disasterTime;
|
||||||
|
|
||||||
|
@Schema(description = "发生次数", example = "17530")
|
||||||
|
private Integer disasterCount;
|
||||||
|
|
||||||
|
@Schema(description = "创建时间")
|
||||||
|
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||||
|
private LocalDateTime[] createTime;
|
||||||
|
|
||||||
@Schema(description = "基础id", example = "3322")
|
@Schema(description = "基础id", example = "3322")
|
||||||
private String foundationId;
|
private String foundationId;
|
||||||
|
|
||||||
@@ -22,23 +42,6 @@ public class DisasterDataPageReqVO extends PageParam {
|
|||||||
@Schema(description = "基地名称", example = "芋艿")
|
@Schema(description = "基地名称", example = "芋艿")
|
||||||
private String baseName;
|
private String baseName;
|
||||||
|
|
||||||
@Schema(description = "发生月份")
|
|
||||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
|
||||||
private String[] disasterTime;
|
|
||||||
|
|
||||||
@Schema(description = "灾害类型1=环境,2=病害,3=虫害,4=草害")
|
|
||||||
private Integer category;
|
|
||||||
|
|
||||||
@Schema(description = "灾害名称", example = "赵六")
|
|
||||||
private String name;
|
|
||||||
|
|
||||||
@Schema(description = "发生次数", example = "17530")
|
|
||||||
private Integer disasterCount;
|
|
||||||
|
|
||||||
@Schema(description = "创建时间")
|
|
||||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
|
||||||
private LocalDateTime[] createTime;
|
|
||||||
|
|
||||||
@Schema(description = "地块ID", example = "21827")
|
@Schema(description = "地块ID", example = "21827")
|
||||||
private String plotId;
|
private String plotId;
|
||||||
|
|
||||||
|
|||||||
@@ -16,6 +16,49 @@ public class DisasterDataRespVO {
|
|||||||
@ExcelProperty("id")
|
@ExcelProperty("id")
|
||||||
private String id;
|
private String id;
|
||||||
|
|
||||||
|
@Schema(description = "灾害名称", example = "赵六")
|
||||||
|
@ExcelProperty("灾害名称")
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
@Schema(description = "灾害类型2=病害,1=虫害,3=草害")
|
||||||
|
@ExcelProperty("灾害类型2=病害,1=虫害,3=草害")
|
||||||
|
private Integer category;
|
||||||
|
|
||||||
|
@Schema(description = "灾害类型 1:普通; 2:气象灾害")
|
||||||
|
private Integer type;
|
||||||
|
@Schema(description = "灾害描述")
|
||||||
|
private String disasterDescription;
|
||||||
|
@Schema(description = "防治建议")
|
||||||
|
private String treatmentSuggestion;
|
||||||
|
@Schema(description = "图片地址")
|
||||||
|
private String imgUrl;
|
||||||
|
|
||||||
|
@Schema(description = "发生次数", example = "17530")
|
||||||
|
@ExcelProperty("发生次数")
|
||||||
|
private Integer disasterCount;
|
||||||
|
|
||||||
|
@Schema(description = "发生月份")
|
||||||
|
@ExcelProperty("发生月份")
|
||||||
|
private String disasterTime;
|
||||||
|
|
||||||
|
@Schema(description = "创建人")
|
||||||
|
@ExcelProperty("创建人")
|
||||||
|
private String creator;
|
||||||
|
|
||||||
|
@Schema(description = "更新人")
|
||||||
|
@ExcelProperty("更新人")
|
||||||
|
private String updater;
|
||||||
|
|
||||||
|
@Schema(description = "创建时间")
|
||||||
|
@ExcelProperty("创建时间")
|
||||||
|
private LocalDateTime createTime;
|
||||||
|
|
||||||
|
@Schema(description = "更新时间")
|
||||||
|
@ExcelProperty("更新时间")
|
||||||
|
private LocalDateTime updateTime;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@Schema(description = "基础id", example = "3322")
|
@Schema(description = "基础id", example = "3322")
|
||||||
@ExcelProperty("基础id")
|
@ExcelProperty("基础id")
|
||||||
private String foundationId;
|
private String foundationId;
|
||||||
@@ -28,26 +71,6 @@ public class DisasterDataRespVO {
|
|||||||
@ExcelProperty("基地名称")
|
@ExcelProperty("基地名称")
|
||||||
private String baseName;
|
private String baseName;
|
||||||
|
|
||||||
@Schema(description = "发生月份")
|
|
||||||
@ExcelProperty("发生月份")
|
|
||||||
private String disasterTime;
|
|
||||||
|
|
||||||
@Schema(description = "灾害类型1=环境,2=病害,3=虫害,4=草害")
|
|
||||||
@ExcelProperty("灾害类型1=环境,2=病害,3=虫害,4=草害")
|
|
||||||
private Integer category;
|
|
||||||
|
|
||||||
@Schema(description = "灾害名称", example = "赵六")
|
|
||||||
@ExcelProperty("灾害名称")
|
|
||||||
private String name;
|
|
||||||
|
|
||||||
@Schema(description = "发生次数", example = "17530")
|
|
||||||
@ExcelProperty("发生次数")
|
|
||||||
private Integer disasterCount;
|
|
||||||
|
|
||||||
@Schema(description = "创建时间")
|
|
||||||
@ExcelProperty("创建时间")
|
|
||||||
private LocalDateTime createTime;
|
|
||||||
|
|
||||||
@Schema(description = "地块ID", example = "21827")
|
@Schema(description = "地块ID", example = "21827")
|
||||||
@ExcelProperty("地块ID")
|
@ExcelProperty("地块ID")
|
||||||
private String plotId;
|
private String plotId;
|
||||||
|
|||||||
@@ -9,6 +9,24 @@ public class DisasterDataSaveReqVO {
|
|||||||
|
|
||||||
@Schema(description = "id", requiredMode = Schema.RequiredMode.REQUIRED, example = "26665")
|
@Schema(description = "id", requiredMode = Schema.RequiredMode.REQUIRED, example = "26665")
|
||||||
private String id;
|
private String id;
|
||||||
|
@Schema(description = "灾害名称", example = "赵六")
|
||||||
|
private String name;
|
||||||
|
@Schema(description = "灾害类型1=环境,2=病害,3=虫害,4=草害")
|
||||||
|
private Integer category;
|
||||||
|
@Schema(description = "灾害类型 1:普通; 2:气象灾害")
|
||||||
|
private Integer type;
|
||||||
|
@Schema(description = "灾害描述")
|
||||||
|
private String disasterDescription;
|
||||||
|
@Schema(description = "防治建议")
|
||||||
|
private String treatmentSuggestion;
|
||||||
|
@Schema(description = "图片地址")
|
||||||
|
private String imgUrl;
|
||||||
|
|
||||||
|
@Schema(description = "发生次数", example = "17530")
|
||||||
|
private Integer disasterCount;
|
||||||
|
|
||||||
|
@Schema(description = "发生月份")
|
||||||
|
private String disasterTime;
|
||||||
|
|
||||||
@Schema(description = "基础id", example = "3322")
|
@Schema(description = "基础id", example = "3322")
|
||||||
private String foundationId;
|
private String foundationId;
|
||||||
@@ -19,18 +37,6 @@ public class DisasterDataSaveReqVO {
|
|||||||
@Schema(description = "基地名称", example = "芋艿")
|
@Schema(description = "基地名称", example = "芋艿")
|
||||||
private String baseName;
|
private String baseName;
|
||||||
|
|
||||||
@Schema(description = "发生月份")
|
|
||||||
private String disasterTime;
|
|
||||||
|
|
||||||
@Schema(description = "灾害类型1=环境,2=病害,3=虫害,4=草害")
|
|
||||||
private Integer category;
|
|
||||||
|
|
||||||
@Schema(description = "灾害名称", example = "赵六")
|
|
||||||
private String name;
|
|
||||||
|
|
||||||
@Schema(description = "发生次数", example = "17530")
|
|
||||||
private Integer disasterCount;
|
|
||||||
|
|
||||||
@Schema(description = "地块ID", example = "21827")
|
@Schema(description = "地块ID", example = "21827")
|
||||||
private String plotId;
|
private String plotId;
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
package cn.iocoder.yudao.module.farm.controller.admin.farmingnamemaintenance.vo;
|
package cn.iocoder.yudao.module.farm.controller.admin.farmingnamemaintenance.vo;
|
||||||
|
|
||||||
|
import cn.idev.excel.annotation.ExcelProperty;
|
||||||
import lombok.*;
|
import lombok.*;
|
||||||
|
|
||||||
import io.swagger.v3.oas.annotations.media.Schema;
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
@@ -13,32 +14,23 @@ import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_
|
|||||||
@Data
|
@Data
|
||||||
public class FarmingNameMaintenancePageReqVO extends PageParam {
|
public class FarmingNameMaintenancePageReqVO extends PageParam {
|
||||||
|
|
||||||
@Schema(description = "农事名称", example = "李四")
|
@Schema(description = "农事名称-编码", example = "李四")
|
||||||
|
@ExcelProperty("农事名称-编码")
|
||||||
|
private String farmingCode;
|
||||||
|
|
||||||
|
@Schema(description = "农事名称-中午名", example = "李四")
|
||||||
|
@ExcelProperty("农事名称-中文名")
|
||||||
private String farmingName;
|
private String farmingName;
|
||||||
|
|
||||||
@Schema(description = "农事类型", example = "1")
|
@Schema(description = "农事类型-编码 (父级)", example = "1")
|
||||||
private String farmingType;
|
@ExcelProperty("农事类型-编码(父级)")
|
||||||
|
private String farmingTypeCode;
|
||||||
|
|
||||||
@Schema(description = "0=启用,1=停用", example = "2")
|
@Schema(description = "0=停用,1=启用", example = "1")
|
||||||
private Integer useStatus;
|
private Integer useStatus;
|
||||||
|
|
||||||
@Schema(description = "创建时间")
|
@Schema(description = "创建时间")
|
||||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||||
private LocalDateTime[] createTime;
|
private LocalDateTime[] createTime;
|
||||||
|
|
||||||
@Schema(description = "基地id", example = "23381")
|
|
||||||
private String baseId;
|
|
||||||
|
|
||||||
@Schema(description = "基地", example = "赵六")
|
|
||||||
private String baseName;
|
|
||||||
|
|
||||||
@Schema(description = "地块ID", example = "20315")
|
|
||||||
private String plotId;
|
|
||||||
|
|
||||||
@Schema(description = "地块", example = "张三")
|
|
||||||
private String plotName;
|
|
||||||
|
|
||||||
@Schema(description = "租户id", example = "15178")
|
|
||||||
private String tenantId;
|
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -7,7 +7,7 @@ import org.springframework.format.annotation.DateTimeFormat;
|
|||||||
import java.time.LocalDateTime;
|
import java.time.LocalDateTime;
|
||||||
import cn.idev.excel.annotation.*;
|
import cn.idev.excel.annotation.*;
|
||||||
|
|
||||||
@Schema(description = "管理后台 - 农事名称维护 Response VO")
|
@Schema(description = "管理后台 - 农事名称维护")
|
||||||
@Data
|
@Data
|
||||||
@ExcelIgnoreUnannotated
|
@ExcelIgnoreUnannotated
|
||||||
public class FarmingNameMaintenanceRespVO {
|
public class FarmingNameMaintenanceRespVO {
|
||||||
@@ -16,40 +16,32 @@ public class FarmingNameMaintenanceRespVO {
|
|||||||
@ExcelProperty("id")
|
@ExcelProperty("id")
|
||||||
private String id;
|
private String id;
|
||||||
|
|
||||||
@Schema(description = "农事名称", example = "李四")
|
@Schema(description = "农事名称-编码", example = "李四")
|
||||||
@ExcelProperty("农事名称")
|
@ExcelProperty("农事名称-编码")
|
||||||
|
private String farmingCode;
|
||||||
|
|
||||||
|
@Schema(description = "农事名称-中文名", example = "李四")
|
||||||
|
@ExcelProperty("农事名称-中文名")
|
||||||
private String farmingName;
|
private String farmingName;
|
||||||
|
|
||||||
@Schema(description = "农事类型", example = "1")
|
@Schema(description = "农事类型-编码 (父级)", example = "1")
|
||||||
@ExcelProperty("农事类型")
|
@ExcelProperty("农事类型-编码(父级)")
|
||||||
private String farmingType;
|
private String farmingTypeCode;
|
||||||
|
|
||||||
|
@Schema(description = "农事类型-名称 (父级)", example = "1")
|
||||||
|
@ExcelProperty("农事类型-名称(父级)")
|
||||||
|
private String farmingTypeName;
|
||||||
|
|
||||||
@Schema(description = "0=启用,1=停用", example = "2")
|
@Schema(description = "0=启用,1=停用", example = "2")
|
||||||
@ExcelProperty("0=启用,1=停用")
|
@ExcelProperty("0=启用,1=停用")
|
||||||
private Integer useStatus;
|
private Integer useStatus;
|
||||||
|
|
||||||
|
@Schema(description = "创建人")
|
||||||
|
@ExcelProperty("创建人")
|
||||||
|
private String creator;
|
||||||
|
|
||||||
@Schema(description = "创建时间")
|
@Schema(description = "创建时间")
|
||||||
@ExcelProperty("创建时间")
|
@ExcelProperty("创建时间")
|
||||||
private LocalDateTime createTime;
|
private LocalDateTime createTime;
|
||||||
|
|
||||||
@Schema(description = "基地id", example = "23381")
|
|
||||||
@ExcelProperty("基地id")
|
|
||||||
private String baseId;
|
|
||||||
|
|
||||||
@Schema(description = "基地", example = "赵六")
|
|
||||||
@ExcelProperty("基地")
|
|
||||||
private String baseName;
|
|
||||||
|
|
||||||
@Schema(description = "地块ID", example = "20315")
|
|
||||||
@ExcelProperty("地块ID")
|
|
||||||
private String plotId;
|
|
||||||
|
|
||||||
@Schema(description = "地块", example = "张三")
|
|
||||||
@ExcelProperty("地块")
|
|
||||||
private String plotName;
|
|
||||||
|
|
||||||
@Schema(description = "租户id", example = "15178")
|
|
||||||
@ExcelProperty("租户id")
|
|
||||||
private String tenantId;
|
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -19,19 +19,19 @@ public class FarmingNameMaintenanceSaveReqVO {
|
|||||||
@Schema(description = "0=启用,1=停用", example = "2")
|
@Schema(description = "0=启用,1=停用", example = "2")
|
||||||
private Integer useStatus;
|
private Integer useStatus;
|
||||||
|
|
||||||
@Schema(description = "基地id", example = "23381")
|
// @Schema(description = "基地id", example = "23381")
|
||||||
private String baseId;
|
// private String baseId;
|
||||||
|
//
|
||||||
@Schema(description = "基地", example = "赵六")
|
// @Schema(description = "基地", example = "赵六")
|
||||||
private String baseName;
|
// private String baseName;
|
||||||
|
//
|
||||||
@Schema(description = "地块ID", example = "20315")
|
// @Schema(description = "地块ID", example = "20315")
|
||||||
private String plotId;
|
// private String plotId;
|
||||||
|
//
|
||||||
@Schema(description = "地块", example = "张三")
|
// @Schema(description = "地块", example = "张三")
|
||||||
private String plotName;
|
// private String plotName;
|
||||||
|
//
|
||||||
@Schema(description = "租户id", example = "15178")
|
// @Schema(description = "租户id", example = "15178")
|
||||||
private String tenantId;
|
// private String tenantId;
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -32,7 +32,7 @@ import cn.iocoder.yudao.module.farm.service.farmingrecord.FarmingRecordService;
|
|||||||
|
|
||||||
@Tag(name = "管理后台 - 种植中心-农事基地-农事记录")
|
@Tag(name = "管理后台 - 种植中心-农事基地-农事记录")
|
||||||
@RestController
|
@RestController
|
||||||
@RequestMapping("/farm/ing-record")
|
@RequestMapping("/farm/farming-record")
|
||||||
@Validated
|
@Validated
|
||||||
public class FarmingRecordController {
|
public class FarmingRecordController {
|
||||||
|
|
||||||
|
|||||||
@@ -4,40 +4,21 @@ import lombok.*;
|
|||||||
|
|
||||||
import io.swagger.v3.oas.annotations.media.Schema;
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||||
import org.springframework.format.annotation.DateTimeFormat;
|
|
||||||
import java.time.LocalDateTime;
|
|
||||||
|
|
||||||
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
|
|
||||||
|
|
||||||
@Schema(description = "管理后台 - 农事类型维护分页 Request VO")
|
@Schema(description = "管理后台 - 农事类型维护分页 Request VO")
|
||||||
@Data
|
@Data
|
||||||
public class FarmingTypeMaintenancePageReqVO extends PageParam {
|
public class FarmingTypeMaintenancePageReqVO extends PageParam {
|
||||||
|
|
||||||
|
@Schema(description = "ID", example = "1")
|
||||||
|
private String id;
|
||||||
@Schema(description = "农事类型-编码", example = "1")
|
@Schema(description = "农事类型-编码", example = "1")
|
||||||
private String farmingCode;
|
private String farmingCode;
|
||||||
@Schema(description = "农事类型-名称", example = "采收")
|
@Schema(description = "农事类型-名称", example = "采收")
|
||||||
private String farmingName;
|
private String farmingName;
|
||||||
|
@Schema(description = "0=停用,1=启用", example = "0")
|
||||||
@Schema(description = "0=启用,1=停用", example = "0")
|
|
||||||
private Integer useStatus;
|
private Integer useStatus;
|
||||||
|
@Schema(description = "0=未删除,1=已删除", example = "0")
|
||||||
@Schema(description = "创建时间")
|
private Integer deleted;
|
||||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
|
||||||
private LocalDateTime[] createTime;
|
|
||||||
|
|
||||||
@Schema(description = "基地id", example = "29265")
|
|
||||||
private String baseId;
|
|
||||||
|
|
||||||
@Schema(description = "基地", example = "张三")
|
|
||||||
private String baseName;
|
|
||||||
|
|
||||||
@Schema(description = "地块ID", example = "28838")
|
|
||||||
private String plotId;
|
|
||||||
|
|
||||||
@Schema(description = "地块", example = "张三")
|
|
||||||
private String plotName;
|
|
||||||
|
|
||||||
@Schema(description = "租户id", example = "6207")
|
|
||||||
private String tenantId;
|
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -7,7 +7,9 @@ import org.springframework.format.annotation.DateTimeFormat;
|
|||||||
import java.time.LocalDateTime;
|
import java.time.LocalDateTime;
|
||||||
import cn.idev.excel.annotation.*;
|
import cn.idev.excel.annotation.*;
|
||||||
|
|
||||||
@Schema(description = "管理后台 - 农事类型维护 Response VO")
|
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
|
||||||
|
|
||||||
|
@Schema(description = "管理后台 - 农事类型维护")
|
||||||
@Data
|
@Data
|
||||||
@ExcelIgnoreUnannotated
|
@ExcelIgnoreUnannotated
|
||||||
public class FarmingTypeMaintenanceRespVO {
|
public class FarmingTypeMaintenanceRespVO {
|
||||||
@@ -16,36 +18,34 @@ public class FarmingTypeMaintenanceRespVO {
|
|||||||
@ExcelProperty("基础id")
|
@ExcelProperty("基础id")
|
||||||
private String id;
|
private String id;
|
||||||
|
|
||||||
@Schema(description = "农事类型", example = "1")
|
@Schema(description = "农事类型-编码", example = "1")
|
||||||
@ExcelProperty("农事类型")
|
@ExcelProperty("农事类型-编码")
|
||||||
private String farmingType;
|
private String farmingCode;
|
||||||
|
|
||||||
@Schema(description = "0=启用,1=停用", example = "2")
|
@Schema(description = "农事类型-名称", example = "1")
|
||||||
@ExcelProperty("0=启用,1=停用")
|
@ExcelProperty("农事类型-名称")
|
||||||
|
private String farmingName;
|
||||||
|
|
||||||
|
@Schema(description = "删除状态(1:已删除;2:未删除)", example = "2")
|
||||||
|
@ExcelProperty("删除状态")
|
||||||
|
private Integer deleted;
|
||||||
|
|
||||||
|
@Schema(description = "使用状态 (0=停用,1=启用)", example = "2")
|
||||||
|
@ExcelProperty("使用状态")
|
||||||
private Integer useStatus;
|
private Integer useStatus;
|
||||||
|
|
||||||
|
@Schema(description = "创建人")
|
||||||
|
@ExcelProperty("创建人")
|
||||||
|
private String creator;
|
||||||
|
|
||||||
@Schema(description = "创建时间")
|
@Schema(description = "创建时间")
|
||||||
@ExcelProperty("创建时间")
|
@ExcelProperty("创建时间")
|
||||||
|
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||||
private LocalDateTime createTime;
|
private LocalDateTime createTime;
|
||||||
|
|
||||||
@Schema(description = "基地id", example = "29265")
|
@Schema(description = "更新时间")
|
||||||
@ExcelProperty("基地id")
|
@ExcelProperty("更新时间")
|
||||||
private String baseId;
|
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||||
|
private LocalDateTime updateTime;
|
||||||
@Schema(description = "基地", example = "张三")
|
|
||||||
@ExcelProperty("基地")
|
|
||||||
private String baseName;
|
|
||||||
|
|
||||||
@Schema(description = "地块ID", example = "28838")
|
|
||||||
@ExcelProperty("地块ID")
|
|
||||||
private String plotId;
|
|
||||||
|
|
||||||
@Schema(description = "地块", example = "张三")
|
|
||||||
@ExcelProperty("地块")
|
|
||||||
private String plotName;
|
|
||||||
|
|
||||||
@Schema(description = "租户id", example = "6207")
|
|
||||||
@ExcelProperty("租户id")
|
|
||||||
private String tenantId;
|
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -2,6 +2,11 @@ package cn.iocoder.yudao.module.farm.controller.admin.farmingtypemaintenance.vo;
|
|||||||
|
|
||||||
import io.swagger.v3.oas.annotations.media.Schema;
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
import lombok.*;
|
import lombok.*;
|
||||||
|
import org.springframework.format.annotation.DateTimeFormat;
|
||||||
|
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
|
||||||
|
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
|
||||||
|
|
||||||
@Schema(description = "管理后台 - 农事类型维护新增/修改 Request VO")
|
@Schema(description = "管理后台 - 农事类型维护新增/修改 Request VO")
|
||||||
@Data
|
@Data
|
||||||
@@ -10,27 +15,21 @@ public class FarmingTypeMaintenanceSaveReqVO {
|
|||||||
@Schema(description = "基础id", requiredMode = Schema.RequiredMode.REQUIRED, example = "29520")
|
@Schema(description = "基础id", requiredMode = Schema.RequiredMode.REQUIRED, example = "29520")
|
||||||
private String id;
|
private String id;
|
||||||
|
|
||||||
@Schema(description = "农事类型", example = "1")
|
@Schema(description = "农事类型-编码", example = "1")
|
||||||
private String farmingType;
|
private String farmingCode;
|
||||||
|
@Schema(description = "农事类型-名称", example = "1")
|
||||||
|
private String farmingName;
|
||||||
|
|
||||||
@Schema(description = "0=启用,1=停用", example = "0")
|
@Schema(description = "0=停用,1=启用", example = "0")
|
||||||
private Integer useStatus;
|
private Integer useStatus;
|
||||||
@Schema(description = "0=未删除,1=已删除", example = "0")
|
@Schema(description = "0=未删除,1=已删除", example = "0")
|
||||||
private Integer deleted;
|
private Integer deleted;
|
||||||
|
|
||||||
@Schema(description = "基地id", example = "29265")
|
private String creator;
|
||||||
private String baseId;
|
private String updater;
|
||||||
|
// @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||||
@Schema(description = "基地", example = "张三")
|
// private LocalDateTime createTime;
|
||||||
private String baseName;
|
// @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||||
|
// private LocalDateTime update_time;
|
||||||
@Schema(description = "地块ID", example = "28838")
|
|
||||||
private String plotId;
|
|
||||||
|
|
||||||
@Schema(description = "地块", example = "张三")
|
|
||||||
private String plotName;
|
|
||||||
|
|
||||||
@Schema(description = "租户id", example = "6207")
|
|
||||||
private String tenantId;
|
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -73,6 +73,10 @@ public class InputLibraryRespVO {
|
|||||||
@ExcelProperty("0=启用,1=停用")
|
@ExcelProperty("0=启用,1=停用")
|
||||||
private Integer useStatus;
|
private Integer useStatus;
|
||||||
|
|
||||||
|
@Schema(description = "创建人")
|
||||||
|
@ExcelProperty("创建人")
|
||||||
|
private String creator;
|
||||||
|
|
||||||
@Schema(description = "创建时间")
|
@Schema(description = "创建时间")
|
||||||
@ExcelProperty("创建时间")
|
@ExcelProperty("创建时间")
|
||||||
private LocalDateTime createTime;
|
private LocalDateTime createTime;
|
||||||
|
|||||||
@@ -44,6 +44,10 @@ public class SpeciesLibraryRespVO {
|
|||||||
@ExcelProperty("0=启用,1=停用")
|
@ExcelProperty("0=启用,1=停用")
|
||||||
private Integer useStatus;
|
private Integer useStatus;
|
||||||
|
|
||||||
|
@Schema(description = "创建人")
|
||||||
|
@ExcelProperty("创建人")
|
||||||
|
private String creator;
|
||||||
|
|
||||||
@Schema(description = "创建时间")
|
@Schema(description = "创建时间")
|
||||||
@ExcelProperty("创建时间")
|
@ExcelProperty("创建时间")
|
||||||
private LocalDateTime createTime;
|
private LocalDateTime createTime;
|
||||||
|
|||||||
@@ -1,5 +1,7 @@
|
|||||||
package cn.iocoder.yudao.module.farm.dal.dataobject.disasterdata;
|
package cn.iocoder.yudao.module.farm.dal.dataobject.disasterdata;
|
||||||
|
|
||||||
|
import cn.idev.excel.annotation.ExcelProperty;
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
import lombok.*;
|
import lombok.*;
|
||||||
|
|
||||||
import java.time.LocalDateTime;
|
import java.time.LocalDateTime;
|
||||||
@@ -27,6 +29,46 @@ public class DisasterDataDO extends BaseDO {
|
|||||||
*/
|
*/
|
||||||
@TableId(type = IdType.INPUT)
|
@TableId(type = IdType.INPUT)
|
||||||
private String id;
|
private String id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 灾害名称
|
||||||
|
*/
|
||||||
|
private String name;
|
||||||
|
/**
|
||||||
|
* 灾害类型 2=病害,1=虫害,3=草害
|
||||||
|
*/
|
||||||
|
private Integer category;
|
||||||
|
/**
|
||||||
|
* 灾害类别 1:普通; 2:气象灾害
|
||||||
|
*/
|
||||||
|
private Integer type;
|
||||||
|
/**
|
||||||
|
* 灾害描述
|
||||||
|
*/
|
||||||
|
private String disasterDescription;
|
||||||
|
/**
|
||||||
|
* 防治建议
|
||||||
|
*/
|
||||||
|
private String treatmentSuggestion;
|
||||||
|
/**
|
||||||
|
* 图片地址
|
||||||
|
*/
|
||||||
|
private String imgUrl;
|
||||||
|
/**
|
||||||
|
* 发生次数
|
||||||
|
*/
|
||||||
|
private Integer disasterCount;
|
||||||
|
/**
|
||||||
|
* 发生月份
|
||||||
|
*/
|
||||||
|
private String disasterTime;
|
||||||
|
|
||||||
|
private String creator;
|
||||||
|
|
||||||
|
private LocalDateTime createTime;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 基础id
|
* 基础id
|
||||||
*/
|
*/
|
||||||
@@ -39,22 +81,6 @@ public class DisasterDataDO extends BaseDO {
|
|||||||
* 基地名称
|
* 基地名称
|
||||||
*/
|
*/
|
||||||
private String baseName;
|
private String baseName;
|
||||||
/**
|
|
||||||
* 发生月份
|
|
||||||
*/
|
|
||||||
private String disasterTime;
|
|
||||||
/**
|
|
||||||
* 灾害类型1=环境,2=病害,3=虫害,4=草害
|
|
||||||
*/
|
|
||||||
private Integer category;
|
|
||||||
/**
|
|
||||||
* 灾害名称
|
|
||||||
*/
|
|
||||||
private String name;
|
|
||||||
/**
|
|
||||||
* 发生次数
|
|
||||||
*/
|
|
||||||
private Integer disasterCount;
|
|
||||||
/**
|
/**
|
||||||
* 地块ID
|
* 地块ID
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -1,5 +1,7 @@
|
|||||||
package cn.iocoder.yudao.module.farm.dal.dataobject.farmingnamemaintenance;
|
package cn.iocoder.yudao.module.farm.dal.dataobject.farmingnamemaintenance;
|
||||||
|
|
||||||
|
import cn.idev.excel.annotation.ExcelProperty;
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
import lombok.*;
|
import lombok.*;
|
||||||
|
|
||||||
import java.time.LocalDateTime;
|
import java.time.LocalDateTime;
|
||||||
@@ -28,18 +30,22 @@ public class FarmingNameMaintenanceDO extends BaseDO {
|
|||||||
*/
|
*/
|
||||||
@TableId(type = IdType.INPUT)
|
@TableId(type = IdType.INPUT)
|
||||||
private String id;
|
private String id;
|
||||||
/**
|
|
||||||
* 农事名称
|
private String farmingCode;
|
||||||
*/
|
|
||||||
private String farmingName;
|
private String farmingName;
|
||||||
/**
|
|
||||||
* 农事类型
|
private String farmingTypeCode;
|
||||||
*/
|
private String farmingTypeName;
|
||||||
private String farmingType;
|
|
||||||
/**
|
/**
|
||||||
* 0=启用,1=停用
|
* 0=启用,1=停用
|
||||||
*/
|
*/
|
||||||
private Integer useStatus;
|
private Integer useStatus;
|
||||||
|
|
||||||
|
private String creator;
|
||||||
|
|
||||||
|
private LocalDateTime createTime;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 基地id
|
* 基地id
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -28,14 +28,18 @@ public class FarmingTypeMaintenanceDO extends BaseDO {
|
|||||||
@TableId(type = IdType.INPUT)
|
@TableId(type = IdType.INPUT)
|
||||||
private String id;
|
private String id;
|
||||||
/**
|
/**
|
||||||
* 农事类型
|
* 农事类型-编码
|
||||||
*/
|
*/
|
||||||
private String farmingCode;
|
private String farmingCode;
|
||||||
|
/**
|
||||||
|
* 农事类型-名称
|
||||||
|
*/
|
||||||
private String farmingName;
|
private String farmingName;
|
||||||
/**
|
/**
|
||||||
* 0=启用,1=停用
|
* 0=停用,1=启用
|
||||||
*/
|
*/
|
||||||
private Integer useStatus;
|
private Integer useStatus;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 基地id
|
* 基地id
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -3,9 +3,6 @@ package cn.iocoder.yudao.module.farm.dal.dataobject.inputlibrary;
|
|||||||
import lombok.*;
|
import lombok.*;
|
||||||
|
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
import java.math.BigDecimal;
|
|
||||||
import java.time.LocalDateTime;
|
|
||||||
import java.time.LocalDateTime;
|
|
||||||
import com.baomidou.mybatisplus.annotation.*;
|
import com.baomidou.mybatisplus.annotation.*;
|
||||||
import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO;
|
import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO;
|
||||||
|
|
||||||
|
|||||||
@@ -2,7 +2,6 @@ package cn.iocoder.yudao.module.farm.dal.dataobject.specieslibrary;
|
|||||||
|
|
||||||
import lombok.*;
|
import lombok.*;
|
||||||
|
|
||||||
import java.time.LocalDateTime;
|
|
||||||
import java.time.LocalDateTime;
|
import java.time.LocalDateTime;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import com.baomidou.mybatisplus.annotation.*;
|
import com.baomidou.mybatisplus.annotation.*;
|
||||||
@@ -82,6 +81,11 @@ public class SpeciesLibraryDO extends BaseDO {
|
|||||||
* 0=启用,1=停用
|
* 0=启用,1=停用
|
||||||
*/
|
*/
|
||||||
private Integer useStatus;
|
private Integer useStatus;
|
||||||
|
|
||||||
|
private String creator;
|
||||||
|
|
||||||
|
private LocalDateTime createTime;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 基地id
|
* 基地id
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -6,6 +6,9 @@ import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
|
|||||||
import cn.iocoder.yudao.module.farm.controller.admin.disasterdata.vo.DisasterDataPageReqVO;
|
import cn.iocoder.yudao.module.farm.controller.admin.disasterdata.vo.DisasterDataPageReqVO;
|
||||||
import cn.iocoder.yudao.module.farm.dal.dataobject.disasterdata.DisasterDataDO;
|
import cn.iocoder.yudao.module.farm.dal.dataobject.disasterdata.DisasterDataDO;
|
||||||
import org.apache.ibatis.annotations.Mapper;
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 灾害数据 Mapper
|
* 灾害数据 Mapper
|
||||||
@@ -17,18 +20,15 @@ public interface DisasterDataMapper extends BaseMapperX<DisasterDataDO> {
|
|||||||
|
|
||||||
default PageResult<DisasterDataDO> selectPage(DisasterDataPageReqVO reqVO) {
|
default PageResult<DisasterDataDO> selectPage(DisasterDataPageReqVO reqVO) {
|
||||||
return selectPage(reqVO, new LambdaQueryWrapperX<DisasterDataDO>()
|
return selectPage(reqVO, new LambdaQueryWrapperX<DisasterDataDO>()
|
||||||
.eqIfPresent(DisasterDataDO::getFoundationId, reqVO.getFoundationId())
|
|
||||||
.eqIfPresent(DisasterDataDO::getBaseId, reqVO.getBaseId())
|
|
||||||
.likeIfPresent(DisasterDataDO::getBaseName, reqVO.getBaseName())
|
|
||||||
.betweenIfPresent(DisasterDataDO::getDisasterTime, reqVO.getDisasterTime())
|
|
||||||
.eqIfPresent(DisasterDataDO::getCategory, reqVO.getCategory())
|
|
||||||
.likeIfPresent(DisasterDataDO::getName, reqVO.getName())
|
.likeIfPresent(DisasterDataDO::getName, reqVO.getName())
|
||||||
.eqIfPresent(DisasterDataDO::getDisasterCount, reqVO.getDisasterCount())
|
.eqIfPresent(DisasterDataDO::getCategory, reqVO.getCategory())
|
||||||
.betweenIfPresent(DisasterDataDO::getCreateTime, reqVO.getCreateTime())
|
.eqIfPresent(DisasterDataDO::getType, reqVO.getType())
|
||||||
.eqIfPresent(DisasterDataDO::getPlotId, reqVO.getPlotId())
|
);
|
||||||
.likeIfPresent(DisasterDataDO::getPlotName, reqVO.getPlotName())
|
|
||||||
.eqIfPresent(DisasterDataDO::getTenantId, reqVO.getTenantId())
|
|
||||||
.orderByDesc(DisasterDataDO::getCreateTime));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
List<DisasterDataDO> selectDisasterDataPage(@Param("req") DisasterDataPageReqVO reqVO);
|
||||||
|
|
||||||
|
long selectDisasterDataCount(@Param("req") DisasterDataPageReqVO reqVO);
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -17,15 +17,11 @@ public interface FarmingNameMaintenanceMapper extends BaseMapperX<FarmingNameMai
|
|||||||
|
|
||||||
default PageResult<FarmingNameMaintenanceDO> selectPage(FarmingNameMaintenancePageReqVO reqVO) {
|
default PageResult<FarmingNameMaintenanceDO> selectPage(FarmingNameMaintenancePageReqVO reqVO) {
|
||||||
return selectPage(reqVO, new LambdaQueryWrapperX<FarmingNameMaintenanceDO>()
|
return selectPage(reqVO, new LambdaQueryWrapperX<FarmingNameMaintenanceDO>()
|
||||||
|
.eqIfPresent(FarmingNameMaintenanceDO::getFarmingCode, reqVO.getFarmingCode())
|
||||||
.likeIfPresent(FarmingNameMaintenanceDO::getFarmingName, reqVO.getFarmingName())
|
.likeIfPresent(FarmingNameMaintenanceDO::getFarmingName, reqVO.getFarmingName())
|
||||||
.eqIfPresent(FarmingNameMaintenanceDO::getFarmingType, reqVO.getFarmingType())
|
.likeIfPresent(FarmingNameMaintenanceDO::getFarmingTypeCode, reqVO.getFarmingTypeCode())
|
||||||
.eqIfPresent(FarmingNameMaintenanceDO::getUseStatus, reqVO.getUseStatus())
|
.eqIfPresent(FarmingNameMaintenanceDO::getUseStatus, reqVO.getUseStatus())
|
||||||
.betweenIfPresent(FarmingNameMaintenanceDO::getCreateTime, reqVO.getCreateTime())
|
.betweenIfPresent(FarmingNameMaintenanceDO::getCreateTime, reqVO.getCreateTime())
|
||||||
.eqIfPresent(FarmingNameMaintenanceDO::getBaseId, reqVO.getBaseId())
|
|
||||||
.likeIfPresent(FarmingNameMaintenanceDO::getBaseName, reqVO.getBaseName())
|
|
||||||
.eqIfPresent(FarmingNameMaintenanceDO::getPlotId, reqVO.getPlotId())
|
|
||||||
.likeIfPresent(FarmingNameMaintenanceDO::getPlotName, reqVO.getPlotName())
|
|
||||||
.eqIfPresent(FarmingNameMaintenanceDO::getTenantId, reqVO.getTenantId())
|
|
||||||
.orderByDesc(FarmingNameMaintenanceDO::getCreateTime));
|
.orderByDesc(FarmingNameMaintenanceDO::getCreateTime));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -20,18 +20,17 @@ import java.util.List;
|
|||||||
public interface FarmingTypeMaintenanceMapper extends BaseMapperX<FarmingTypeMaintenanceDO> {
|
public interface FarmingTypeMaintenanceMapper extends BaseMapperX<FarmingTypeMaintenanceDO> {
|
||||||
|
|
||||||
default PageResult<FarmingTypeMaintenanceDO> selectPage(FarmingTypeMaintenancePageReqVO reqVO) {
|
default PageResult<FarmingTypeMaintenanceDO> selectPage(FarmingTypeMaintenancePageReqVO reqVO) {
|
||||||
|
|
||||||
return selectPage(reqVO, new LambdaQueryWrapperX<FarmingTypeMaintenanceDO>()
|
return selectPage(reqVO, new LambdaQueryWrapperX<FarmingTypeMaintenanceDO>()
|
||||||
.eqIfPresent(FarmingTypeMaintenanceDO::getFarmingCode, reqVO.getFarmingCode())
|
.eqIfPresent(FarmingTypeMaintenanceDO::getFarmingCode, reqVO.getFarmingCode())
|
||||||
.eqIfPresent(FarmingTypeMaintenanceDO::getFarmingName, reqVO.getFarmingName())
|
.eqIfPresent(FarmingTypeMaintenanceDO::getFarmingName, reqVO.getFarmingName())
|
||||||
.eqIfPresent(FarmingTypeMaintenanceDO::getUseStatus, reqVO.getUseStatus())
|
.eqIfPresent(FarmingTypeMaintenanceDO::getUseStatus, reqVO.getUseStatus())
|
||||||
.betweenIfPresent(FarmingTypeMaintenanceDO::getCreateTime, reqVO.getCreateTime())
|
.eqIfPresent(FarmingTypeMaintenanceDO::getDeleted, reqVO.getDeleted())
|
||||||
.eqIfPresent(FarmingTypeMaintenanceDO::getBaseId, reqVO.getBaseId())
|
.orderByDesc(FarmingTypeMaintenanceDO::getCreateTime)
|
||||||
.likeIfPresent(FarmingTypeMaintenanceDO::getBaseName, reqVO.getBaseName())
|
);
|
||||||
.eqIfPresent(FarmingTypeMaintenanceDO::getPlotId, reqVO.getPlotId())
|
|
||||||
.likeIfPresent(FarmingTypeMaintenanceDO::getPlotName, reqVO.getPlotName())
|
|
||||||
.eqIfPresent(FarmingTypeMaintenanceDO::getTenantId, reqVO.getTenantId())
|
|
||||||
.orderByDesc(FarmingTypeMaintenanceDO::getCreateTime));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
List<FarmingTypeMaintenanceDO> listForFarmingType(@Param("req") FarmingTypeMaintenanceSaveReqVO reqVO );
|
List<FarmingTypeMaintenanceDO> listForFarmingType(@Param("req") FarmingTypeMaintenanceSaveReqVO reqVO );
|
||||||
|
|
||||||
|
Boolean update(@Param("req") FarmingTypeMaintenanceDO reqVO);
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,33 @@
|
|||||||
|
package cn.iocoder.yudao.module.farm.dal.mysql.sysDict;
|
||||||
|
|
||||||
|
import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO;
|
||||||
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import lombok.*;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @description: 字典
|
||||||
|
* @author: binda
|
||||||
|
* @date: 2025/8/19 17:38
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
@ToString(callSuper = true)
|
||||||
|
@Builder
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
public class SysDictDO extends BaseDO {
|
||||||
|
|
||||||
|
@TableId(type = IdType.INPUT)
|
||||||
|
private Integer id;
|
||||||
|
private String dictTypeCode;
|
||||||
|
private String dictTypeName;
|
||||||
|
private String field1Code;
|
||||||
|
private String field1Name;
|
||||||
|
private String field2Code;
|
||||||
|
private String field2Name;
|
||||||
|
private String field3Code;
|
||||||
|
private String field3Name;
|
||||||
|
private Integer status;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,33 @@
|
|||||||
|
package cn.iocoder.yudao.module.farm.dal.mysql.sysDict;
|
||||||
|
|
||||||
|
import cn.iocoder.yudao.module.farm.controller.admin.dict.vo.sys.SysDictPageReqVO;
|
||||||
|
import cn.iocoder.yudao.module.farm.controller.admin.dict.vo.sys.SysDictReqVO;
|
||||||
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @description: 字典DAO
|
||||||
|
* @author: binda
|
||||||
|
* @date: 2025/8/19 17:42
|
||||||
|
*/
|
||||||
|
@Mapper
|
||||||
|
public interface SysDictMapper {
|
||||||
|
|
||||||
|
SysDictDO selectDictByOne(SysDictReqVO reqVO);
|
||||||
|
|
||||||
|
String selectDictByGroup(SysDictReqVO reqVO);
|
||||||
|
|
||||||
|
List<SysDictDO> selectDictByPage(SysDictPageReqVO reqVO);
|
||||||
|
|
||||||
|
Long countDictByCondition(SysDictPageReqVO reqVO);
|
||||||
|
|
||||||
|
List<SysDictDO> getByTypeCode(@Param("dictTypeCode") String dictTypeCode);
|
||||||
|
|
||||||
|
List<SysDictDO> groupByTypeCode();
|
||||||
|
|
||||||
|
void insertOne(SysDictDO reqVO);
|
||||||
|
|
||||||
|
void updateById(SysDictDO reqVO);
|
||||||
|
}
|
||||||
@@ -0,0 +1,18 @@
|
|||||||
|
package cn.iocoder.yudao.module.farm.service.cropFarmingCenter;
|
||||||
|
|
||||||
|
import cn.iocoder.yudao.module.farm.controller.admin.cropFarmingCenter.vo.ProductionPlanSaveReqVO;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @description: 种植中心
|
||||||
|
* @author: binda
|
||||||
|
* @data: 2025/8/19 11:27
|
||||||
|
*/
|
||||||
|
public interface CropFarmingCenterService {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 生产计划-新增
|
||||||
|
* @param createReqVO
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
String createProductionPlan(ProductionPlanSaveReqVO createReqVO);
|
||||||
|
}
|
||||||
@@ -0,0 +1,40 @@
|
|||||||
|
package cn.iocoder.yudao.module.farm.service.cropFarmingCenter;
|
||||||
|
|
||||||
|
import cn.iocoder.yudao.module.farm.controller.admin.cropFarmingCenter.vo.ProductionPlanSaveReqVO;
|
||||||
|
import cn.iocoder.yudao.module.farm.service.cultivationarea.CultivationAreaService;
|
||||||
|
import cn.iocoder.yudao.module.farm.service.productionplan.ProductionPlanService;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @description:
|
||||||
|
* @author: binda
|
||||||
|
* @date: 2025/8/19 11:34
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
@Slf4j
|
||||||
|
public class CropFarmingCenterServiceImpl implements CropFarmingCenterService {
|
||||||
|
|
||||||
|
private final CultivationAreaService cultivationAreaService;
|
||||||
|
private final ProductionPlanService productionPlanService;
|
||||||
|
|
||||||
|
public CropFarmingCenterServiceImpl(CultivationAreaService cultivationAreaService, ProductionPlanService productionPlanService) {
|
||||||
|
this.cultivationAreaService = cultivationAreaService;
|
||||||
|
this.productionPlanService = productionPlanService;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// 创建
|
||||||
|
// 1份生产计划 -> n种植区域; 1个种植区域 -> 1基地的n个地块(种植区域)
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String createProductionPlan(ProductionPlanSaveReqVO createReqVO) {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -86,7 +86,14 @@ private void validateDisasterDataExists(String id) {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public PageResult<DisasterDataDO> getDisasterDataPage(DisasterDataPageReqVO pageReqVO) {
|
public PageResult<DisasterDataDO> getDisasterDataPage(DisasterDataPageReqVO pageReqVO) {
|
||||||
return disasterDataMapper.selectPage(pageReqVO);
|
|
||||||
|
List<DisasterDataDO> list = disasterDataMapper.selectDisasterDataPage(pageReqVO);
|
||||||
|
long count = disasterDataMapper.selectDisasterDataCount(pageReqVO);
|
||||||
|
PageResult<DisasterDataDO> res = new PageResult<>();
|
||||||
|
res.setList(list);
|
||||||
|
res.setTotal(count);
|
||||||
|
|
||||||
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -8,6 +8,7 @@ import cn.iocoder.yudao.module.farm.controller.admin.farmingnamemaintenance.vo.F
|
|||||||
import cn.iocoder.yudao.module.farm.controller.admin.farmingnamemaintenance.vo.FarmingNameMaintenanceSaveReqVO;
|
import cn.iocoder.yudao.module.farm.controller.admin.farmingnamemaintenance.vo.FarmingNameMaintenanceSaveReqVO;
|
||||||
import cn.iocoder.yudao.module.farm.dal.dataobject.farmingnamemaintenance.FarmingNameMaintenanceDO;
|
import cn.iocoder.yudao.module.farm.dal.dataobject.farmingnamemaintenance.FarmingNameMaintenanceDO;
|
||||||
import cn.iocoder.yudao.module.farm.dal.mysql.farmingnamemaintenance.FarmingNameMaintenanceMapper;
|
import cn.iocoder.yudao.module.farm.dal.mysql.farmingnamemaintenance.FarmingNameMaintenanceMapper;
|
||||||
|
import cn.iocoder.yudao.module.farm.utils.StrHelperUtil;
|
||||||
import jakarta.annotation.Resource;
|
import jakarta.annotation.Resource;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.springframework.validation.annotation.Validated;
|
import org.springframework.validation.annotation.Validated;
|
||||||
@@ -37,6 +38,7 @@ public class FarmingNameMaintenanceServiceImpl implements FarmingNameMaintenance
|
|||||||
FarmingNameMaintenanceDO farmingNameMaintenance = BeanUtils.toBean(createReqVO, FarmingNameMaintenanceDO.class);
|
FarmingNameMaintenanceDO farmingNameMaintenance = BeanUtils.toBean(createReqVO, FarmingNameMaintenanceDO.class);
|
||||||
farmingNameMaintenance.setId(IdUtil.fastUUID());
|
farmingNameMaintenance.setId(IdUtil.fastUUID());
|
||||||
farmingNameMaintenance.setTenantId(String.valueOf(user.getTenantId()));
|
farmingNameMaintenance.setTenantId(String.valueOf(user.getTenantId()));
|
||||||
|
farmingNameMaintenance.setFarmingCode(StrHelperUtil.generate());
|
||||||
farmingNameMaintenanceMapper.insert(farmingNameMaintenance);
|
farmingNameMaintenanceMapper.insert(farmingNameMaintenance);
|
||||||
|
|
||||||
// 返回
|
// 返回
|
||||||
|
|||||||
@@ -65,4 +65,6 @@ public interface FarmingTypeMaintenanceService {
|
|||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
List<FarmingTypeMaintenanceDO> getFarmingTypeList();
|
List<FarmingTypeMaintenanceDO> getFarmingTypeList();
|
||||||
|
|
||||||
|
FarmingTypeMaintenanceDO getFarmingName(String farmingTypeCode);
|
||||||
}
|
}
|
||||||
@@ -5,6 +5,7 @@ import cn.iocoder.yudao.framework.security.core.LoginUser;
|
|||||||
import cn.iocoder.yudao.module.farm.controller.admin.farmingtypemaintenance.vo.FarmingTypeMaintenancePageReqVO;
|
import cn.iocoder.yudao.module.farm.controller.admin.farmingtypemaintenance.vo.FarmingTypeMaintenancePageReqVO;
|
||||||
import cn.iocoder.yudao.module.farm.controller.admin.farmingtypemaintenance.vo.FarmingTypeMaintenanceSaveReqVO;
|
import cn.iocoder.yudao.module.farm.controller.admin.farmingtypemaintenance.vo.FarmingTypeMaintenanceSaveReqVO;
|
||||||
import cn.iocoder.yudao.module.farm.enums.CommonConstants;
|
import cn.iocoder.yudao.module.farm.enums.CommonConstants;
|
||||||
|
import cn.iocoder.yudao.module.farm.utils.StrHelperUtil;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import jakarta.annotation.Resource;
|
import jakarta.annotation.Resource;
|
||||||
import org.springframework.validation.annotation.Validated;
|
import org.springframework.validation.annotation.Validated;
|
||||||
@@ -40,6 +41,7 @@ public class FarmingTypeMaintenanceServiceImpl implements FarmingTypeMaintenance
|
|||||||
FarmingTypeMaintenanceDO farmingTypeMaintenance = BeanUtils.toBean(createReqVO, FarmingTypeMaintenanceDO.class);
|
FarmingTypeMaintenanceDO farmingTypeMaintenance = BeanUtils.toBean(createReqVO, FarmingTypeMaintenanceDO.class);
|
||||||
farmingTypeMaintenance.setId(IdUtil.fastUUID());
|
farmingTypeMaintenance.setId(IdUtil.fastUUID());
|
||||||
farmingTypeMaintenance.setTenantId(String.valueOf(user.getTenantId()));
|
farmingTypeMaintenance.setTenantId(String.valueOf(user.getTenantId()));
|
||||||
|
farmingTypeMaintenance.setFarmingCode(StrHelperUtil.generate());
|
||||||
farmingTypeMaintenanceMapper.insert(farmingTypeMaintenance);
|
farmingTypeMaintenanceMapper.insert(farmingTypeMaintenance);
|
||||||
|
|
||||||
// 返回
|
// 返回
|
||||||
@@ -52,7 +54,7 @@ public class FarmingTypeMaintenanceServiceImpl implements FarmingTypeMaintenance
|
|||||||
validateFarmingTypeMaintenanceExists(updateReqVO.getId());
|
validateFarmingTypeMaintenanceExists(updateReqVO.getId());
|
||||||
// 更新
|
// 更新
|
||||||
FarmingTypeMaintenanceDO updateObj = BeanUtils.toBean(updateReqVO, FarmingTypeMaintenanceDO.class);
|
FarmingTypeMaintenanceDO updateObj = BeanUtils.toBean(updateReqVO, FarmingTypeMaintenanceDO.class);
|
||||||
farmingTypeMaintenanceMapper.updateById(updateObj);
|
farmingTypeMaintenanceMapper.update(updateObj);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -92,4 +94,9 @@ public class FarmingTypeMaintenanceServiceImpl implements FarmingTypeMaintenance
|
|||||||
|
|
||||||
return farmingTypeMaintenanceMapper.listForFarmingType(reqVO);
|
return farmingTypeMaintenanceMapper.listForFarmingType(reqVO);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public FarmingTypeMaintenanceDO getFarmingName(String farmingTypeCode) {
|
||||||
|
return farmingTypeMaintenanceMapper.selectOne(FarmingTypeMaintenanceDO::getFarmingCode, farmingTypeCode);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -3,7 +3,6 @@ package cn.iocoder.yudao.module.farm.service.speciesclassifylibrary;
|
|||||||
import cn.iocoder.yudao.module.farm.controller.admin.dict.vo.SpeciesClassifyLibraryReqVO;
|
import cn.iocoder.yudao.module.farm.controller.admin.dict.vo.SpeciesClassifyLibraryReqVO;
|
||||||
import cn.iocoder.yudao.module.farm.dal.dataobject.speciesclassifylibrary.SpeciesClassifyLibraryDO;
|
import cn.iocoder.yudao.module.farm.dal.dataobject.speciesclassifylibrary.SpeciesClassifyLibraryDO;
|
||||||
import cn.iocoder.yudao.module.farm.dal.mysql.speciesclassifylibrary.SpeciesClassifyLibraryMapper;
|
import cn.iocoder.yudao.module.farm.dal.mysql.speciesclassifylibrary.SpeciesClassifyLibraryMapper;
|
||||||
import cn.iocoder.yudao.module.farm.enums.CommonConstants;
|
|
||||||
import jakarta.annotation.Resource;
|
import jakarta.annotation.Resource;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.springframework.validation.annotation.Validated;
|
import org.springframework.validation.annotation.Validated;
|
||||||
|
|||||||
@@ -0,0 +1,57 @@
|
|||||||
|
package cn.iocoder.yudao.module.farm.service.sysDict;
|
||||||
|
|
||||||
|
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||||
|
import cn.iocoder.yudao.module.farm.controller.admin.dict.vo.sys.SysDictPageReqVO;
|
||||||
|
import cn.iocoder.yudao.module.farm.controller.admin.farmingnamemaintenance.vo.FarmingNameMaintenancePageReqVO;
|
||||||
|
import cn.iocoder.yudao.module.farm.controller.admin.farmingnamemaintenance.vo.FarmingNameMaintenanceSaveReqVO;
|
||||||
|
import cn.iocoder.yudao.module.farm.controller.admin.farmingtypemaintenance.vo.FarmingTypeMaintenancePageReqVO;
|
||||||
|
import cn.iocoder.yudao.module.farm.controller.admin.farmingtypemaintenance.vo.FarmingTypeMaintenanceSaveReqVO;
|
||||||
|
import cn.iocoder.yudao.module.farm.dal.dataobject.farmingnamemaintenance.FarmingNameMaintenanceDO;
|
||||||
|
import cn.iocoder.yudao.module.farm.dal.dataobject.farmingtypemaintenance.FarmingTypeMaintenanceDO;
|
||||||
|
import cn.iocoder.yudao.module.farm.dal.mysql.sysDict.SysDictDO;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @description: 字典
|
||||||
|
* @author: binda
|
||||||
|
* @data: 2025/8/19 17:35
|
||||||
|
*/
|
||||||
|
public interface SysDictService {
|
||||||
|
|
||||||
|
|
||||||
|
List<SysDictDO> getByTypeCode(String dictTypeCode);
|
||||||
|
|
||||||
|
List<SysDictDO> groupByTypeCode();
|
||||||
|
|
||||||
|
PageResult<SysDictDO> selectDictByPage(SysDictPageReqVO reqVO);
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 农事类型
|
||||||
|
*/
|
||||||
|
PageResult<FarmingTypeMaintenanceDO> getFarmingTypeMaintenancePage(FarmingTypeMaintenancePageReqVO reqVO);
|
||||||
|
|
||||||
|
FarmingTypeMaintenanceDO getFarmingTypeMaintenance(String id);
|
||||||
|
|
||||||
|
void createFarmingTypeMaintenance(FarmingTypeMaintenanceSaveReqVO reqVO);
|
||||||
|
|
||||||
|
void updateFarmingTypeMaintenance(FarmingTypeMaintenanceSaveReqVO reqVO);
|
||||||
|
|
||||||
|
void deleteFarmingTypeMaintenance(String id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 农事名称
|
||||||
|
*/
|
||||||
|
PageResult<FarmingNameMaintenanceDO> getFarmingNameMaintenancePage(FarmingNameMaintenancePageReqVO reqVO);
|
||||||
|
|
||||||
|
FarmingNameMaintenanceDO getFarmingNameMaintenance(String id);
|
||||||
|
|
||||||
|
void createFarmingNameMaintenance(FarmingNameMaintenanceSaveReqVO reqVO);
|
||||||
|
|
||||||
|
void updateFarmingNameMaintenance(FarmingNameMaintenanceSaveReqVO reqVO);
|
||||||
|
|
||||||
|
void deleteFarmingNameMaintenance(String id);
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,276 @@
|
|||||||
|
package cn.iocoder.yudao.module.farm.service.sysDict;
|
||||||
|
|
||||||
|
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||||
|
import cn.iocoder.yudao.module.farm.controller.admin.dict.vo.sys.SysDictPageReqVO;
|
||||||
|
import cn.iocoder.yudao.module.farm.controller.admin.dict.vo.sys.SysDictReqVO;
|
||||||
|
import cn.iocoder.yudao.module.farm.controller.admin.farmingnamemaintenance.vo.FarmingNameMaintenancePageReqVO;
|
||||||
|
import cn.iocoder.yudao.module.farm.controller.admin.farmingnamemaintenance.vo.FarmingNameMaintenanceSaveReqVO;
|
||||||
|
import cn.iocoder.yudao.module.farm.controller.admin.farmingtypemaintenance.vo.FarmingTypeMaintenancePageReqVO;
|
||||||
|
import cn.iocoder.yudao.module.farm.controller.admin.farmingtypemaintenance.vo.FarmingTypeMaintenanceSaveReqVO;
|
||||||
|
import cn.iocoder.yudao.module.farm.dal.dataobject.farmingnamemaintenance.FarmingNameMaintenanceDO;
|
||||||
|
import cn.iocoder.yudao.module.farm.dal.dataobject.farmingtypemaintenance.FarmingTypeMaintenanceDO;
|
||||||
|
import cn.iocoder.yudao.module.farm.dal.mysql.sysDict.SysDictDO;
|
||||||
|
import cn.iocoder.yudao.module.farm.dal.mysql.sysDict.SysDictMapper;
|
||||||
|
import cn.iocoder.yudao.module.farm.utils.StrHelperUtil;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
|
import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
|
||||||
|
import static cn.iocoder.yudao.module.farm.enums.ErrorCodeConstants.FARMING_TYPE_MAINTENANCE_NOT_EXISTS;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @description: 字典
|
||||||
|
* @author: binda
|
||||||
|
* @date: 2025/8/19 17:35
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
public class SysDictServiceImpl implements SysDictService{
|
||||||
|
|
||||||
|
private final String FARMING_TYPE = "farming_type";
|
||||||
|
private final String FARMING_NAME = "farming_name";
|
||||||
|
|
||||||
|
|
||||||
|
private final SysDictMapper sysDictMapper;
|
||||||
|
|
||||||
|
public SysDictServiceImpl(SysDictMapper sysDictMapper) {
|
||||||
|
this.sysDictMapper = sysDictMapper;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<SysDictDO> getByTypeCode(String dictTypeCode) {
|
||||||
|
|
||||||
|
return sysDictMapper.getByTypeCode(dictTypeCode);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<SysDictDO> groupByTypeCode() {
|
||||||
|
|
||||||
|
return sysDictMapper.groupByTypeCode();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public PageResult<SysDictDO> selectDictByPage(SysDictPageReqVO reqVO) {
|
||||||
|
|
||||||
|
Integer pageNo = reqVO.getPageNo();
|
||||||
|
Integer pageSize = reqVO.getPageSize();
|
||||||
|
|
||||||
|
// 计算偏移量
|
||||||
|
int offset = (pageNo - 1) * pageSize;
|
||||||
|
reqVO.setOffset(offset);
|
||||||
|
List<SysDictDO> list = sysDictMapper.selectDictByPage(reqVO);
|
||||||
|
|
||||||
|
Long total = sysDictMapper.countDictByCondition(reqVO);
|
||||||
|
long totalPages = (long) Math.ceil((double) total / pageSize);
|
||||||
|
|
||||||
|
return new PageResult<>(list,totalPages);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void validateExists(String id) {
|
||||||
|
if (sysDictMapper.selectDictByOne(new SysDictReqVO(Integer.valueOf(id), "", null)) == null) {
|
||||||
|
throw exception(FARMING_TYPE_MAINTENANCE_NOT_EXISTS);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public PageResult<FarmingTypeMaintenanceDO> getFarmingTypeMaintenancePage(FarmingTypeMaintenancePageReqVO reqVO) {
|
||||||
|
|
||||||
|
SysDictPageReqVO source = new SysDictPageReqVO();
|
||||||
|
source.setDictTypeCode(FARMING_TYPE);
|
||||||
|
source.setPageNo(reqVO.getPageNo());
|
||||||
|
source.setPageSize(reqVO.getPageSize());
|
||||||
|
source.setField1Code(reqVO.getFarmingCode());
|
||||||
|
source.setField1Name(reqVO.getFarmingName());
|
||||||
|
source.setStatus(reqVO.getUseStatus());
|
||||||
|
PageResult<SysDictDO> result = this.selectDictByPage(source);
|
||||||
|
|
||||||
|
List<FarmingTypeMaintenanceDO> list = result.getList().stream().map(e -> {
|
||||||
|
FarmingTypeMaintenanceDO obj = new FarmingTypeMaintenanceDO();
|
||||||
|
obj.setId(String.valueOf(e.getId()));
|
||||||
|
obj.setFarmingCode(e.getField1Code());
|
||||||
|
obj.setFarmingName(e.getField1Name());
|
||||||
|
obj.setUseStatus(e.getStatus());
|
||||||
|
obj.setCreator(e.getCreator());
|
||||||
|
obj.setCreateTime(e.getCreateTime());
|
||||||
|
obj.setUpdater(e.getUpdater());
|
||||||
|
return obj;
|
||||||
|
}).collect(Collectors.toList());
|
||||||
|
|
||||||
|
Long total = result.getTotal();
|
||||||
|
|
||||||
|
return new PageResult<>(list, total);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public FarmingTypeMaintenanceDO getFarmingTypeMaintenance(String id) {
|
||||||
|
|
||||||
|
SysDictDO obj = sysDictMapper.selectDictByOne(new SysDictReqVO(Integer.valueOf(id), FARMING_TYPE, 0));
|
||||||
|
|
||||||
|
FarmingTypeMaintenanceDO res = new FarmingTypeMaintenanceDO();
|
||||||
|
res.setId(String.valueOf(obj.getId()));
|
||||||
|
res.setFarmingCode(obj.getField1Code());
|
||||||
|
res.setFarmingName(obj.getField1Name());
|
||||||
|
res.setUseStatus(obj.getStatus());
|
||||||
|
res.setDeleted(obj.getDeleted());
|
||||||
|
res.setCreator(obj.getCreator());
|
||||||
|
res.setCreateTime(obj.getCreateTime());
|
||||||
|
res.setUpdater(obj.getUpdater());
|
||||||
|
res.setUpdateTime(obj.getUpdateTime());
|
||||||
|
return res;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public void createFarmingTypeMaintenance(FarmingTypeMaintenanceSaveReqVO reqVO) {
|
||||||
|
|
||||||
|
SysDictDO obj = new SysDictDO();
|
||||||
|
obj.setDictTypeCode(FARMING_TYPE);
|
||||||
|
obj.setDictTypeName("农事类型");
|
||||||
|
obj.setField1Code(StrHelperUtil.generate());
|
||||||
|
obj.setField1Name(reqVO.getFarmingName());
|
||||||
|
obj.setStatus(reqVO.getUseStatus());
|
||||||
|
obj.setDeleted(false);
|
||||||
|
obj.setCreator(reqVO.getCreator());
|
||||||
|
|
||||||
|
sysDictMapper.insertOne(obj);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void updateFarmingTypeMaintenance(FarmingTypeMaintenanceSaveReqVO reqVO) {
|
||||||
|
|
||||||
|
this.validateExists(reqVO.getId());
|
||||||
|
|
||||||
|
SysDictDO obj = new SysDictDO();
|
||||||
|
obj.setId(Integer.valueOf(reqVO.getId()));
|
||||||
|
obj.setField1Name(reqVO.getFarmingName());
|
||||||
|
obj.setStatus(reqVO.getUseStatus());
|
||||||
|
|
||||||
|
sysDictMapper.updateById(obj);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void deleteFarmingTypeMaintenance(String id) {
|
||||||
|
|
||||||
|
this.validateExists(id);
|
||||||
|
|
||||||
|
SysDictDO obj = new SysDictDO();
|
||||||
|
obj.setId(Integer.valueOf(id));
|
||||||
|
obj.setDeleted(true);
|
||||||
|
|
||||||
|
sysDictMapper.updateById(obj);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public PageResult<FarmingNameMaintenanceDO> getFarmingNameMaintenancePage(FarmingNameMaintenancePageReqVO reqVO) {
|
||||||
|
|
||||||
|
SysDictPageReqVO source = new SysDictPageReqVO();
|
||||||
|
source.setDictTypeCode(FARMING_NAME);
|
||||||
|
source.setPageNo(reqVO.getPageNo());
|
||||||
|
source.setPageSize( reqVO.getPageSize());
|
||||||
|
source.setField1Code(reqVO.getFarmingTypeCode());
|
||||||
|
source.setField2Name(reqVO.getFarmingName());
|
||||||
|
source.setStatus(reqVO.getUseStatus());
|
||||||
|
PageResult<SysDictDO> result = this.selectDictByPage(source);
|
||||||
|
|
||||||
|
Long total = result.getTotal();
|
||||||
|
List<FarmingNameMaintenanceDO> list = result.getList().stream().map(e -> {
|
||||||
|
FarmingNameMaintenanceDO obj = new FarmingNameMaintenanceDO();
|
||||||
|
obj.setId(String.valueOf(e.getId()));
|
||||||
|
obj.setFarmingCode(e.getField2Code());
|
||||||
|
obj.setFarmingName(e.getField2Name());
|
||||||
|
obj.setFarmingTypeCode(e.getField1Code());
|
||||||
|
obj.setFarmingTypeName(e.getField1Name());
|
||||||
|
obj.setUseStatus(e.getStatus());
|
||||||
|
obj.setCreator(e.getCreator());
|
||||||
|
obj.setCreateTime(e.getCreateTime());
|
||||||
|
obj.setUpdater(e.getUpdater());
|
||||||
|
return obj;
|
||||||
|
}).collect(Collectors.toList());
|
||||||
|
|
||||||
|
return new PageResult<>(list, total);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public FarmingNameMaintenanceDO getFarmingNameMaintenance(String id) {
|
||||||
|
|
||||||
|
SysDictDO obj = sysDictMapper.selectDictByOne(new SysDictReqVO(Integer.valueOf(id), FARMING_NAME, 0));
|
||||||
|
|
||||||
|
FarmingNameMaintenanceDO res = new FarmingNameMaintenanceDO();
|
||||||
|
res.setId(String.valueOf(obj.getId()));
|
||||||
|
res.setFarmingTypeCode(obj.getField1Code());
|
||||||
|
res.setFarmingTypeName(obj.getField1Name());
|
||||||
|
res.setFarmingCode(obj.getField2Code());
|
||||||
|
res.setFarmingName(obj.getField2Name());
|
||||||
|
res.setUseStatus(obj.getStatus());
|
||||||
|
res.setDeleted(obj.getDeleted());
|
||||||
|
res.setCreator(obj.getCreator());
|
||||||
|
res.setCreateTime(obj.getCreateTime());
|
||||||
|
res.setUpdater(obj.getUpdater());
|
||||||
|
res.setUpdateTime(obj.getUpdateTime());
|
||||||
|
return res;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void createFarmingNameMaintenance(FarmingNameMaintenanceSaveReqVO reqVO) {
|
||||||
|
|
||||||
|
String field1Name = sysDictMapper.selectDictByGroup(new SysDictReqVO(FARMING_NAME, reqVO.getFarmingType(), 0));
|
||||||
|
|
||||||
|
SysDictDO obj = new SysDictDO();
|
||||||
|
obj.setDictTypeCode(FARMING_NAME);
|
||||||
|
obj.setDictTypeName("农事类型");
|
||||||
|
obj.setField1Code(reqVO.getFarmingType());
|
||||||
|
obj.setField1Name(field1Name);
|
||||||
|
obj.setField2Code(StrHelperUtil.generate());
|
||||||
|
obj.setField2Name(reqVO.getFarmingName());
|
||||||
|
obj.setStatus(reqVO.getUseStatus());
|
||||||
|
obj.setDeleted(false);
|
||||||
|
obj.setCreator("系统");
|
||||||
|
|
||||||
|
sysDictMapper.insertOne(obj);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void updateFarmingNameMaintenance(FarmingNameMaintenanceSaveReqVO reqVO) {
|
||||||
|
|
||||||
|
this.validateExists(reqVO.getId());
|
||||||
|
|
||||||
|
String field1Name = sysDictMapper.selectDictByGroup(new SysDictReqVO(FARMING_NAME, reqVO.getFarmingType(), 0));
|
||||||
|
|
||||||
|
SysDictDO obj = new SysDictDO();
|
||||||
|
obj.setId(Integer.valueOf(reqVO.getId()));
|
||||||
|
obj.setStatus(reqVO.getUseStatus());
|
||||||
|
obj.setField1Code(reqVO.getFarmingType());
|
||||||
|
obj.setField1Name(field1Name);
|
||||||
|
obj.setField2Name(reqVO.getFarmingName());
|
||||||
|
sysDictMapper.updateById(obj);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void deleteFarmingNameMaintenance(String id) {
|
||||||
|
|
||||||
|
this.validateExists(id);
|
||||||
|
|
||||||
|
SysDictDO obj = new SysDictDO();
|
||||||
|
obj.setId(Integer.valueOf(id));
|
||||||
|
obj.setDeleted(true);
|
||||||
|
|
||||||
|
sysDictMapper.updateById(obj);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,35 @@
|
|||||||
|
package cn.iocoder.yudao.module.farm.utils;
|
||||||
|
|
||||||
|
import java.security.SecureRandom;
|
||||||
|
import java.util.Random;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @description: 字符串工具
|
||||||
|
* @author: binda
|
||||||
|
* @date: 2025/8/18 15:48
|
||||||
|
*/
|
||||||
|
public class StrHelperUtil {
|
||||||
|
// 定义可用字符(大写字母和数字)
|
||||||
|
private static final String ALLOWED_CHARACTERS = "ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";
|
||||||
|
private static final int STRING_LENGTH = 12;
|
||||||
|
|
||||||
|
// 使用SecureRandom以获得更好的随机性
|
||||||
|
private static final Random random = new SecureRandom();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 生成随机字符串(大写字母和数字组成,长度12)
|
||||||
|
* @return 随机生成的字符串
|
||||||
|
*/
|
||||||
|
public static String generate() {
|
||||||
|
StringBuilder sb = new StringBuilder(STRING_LENGTH);
|
||||||
|
|
||||||
|
for (int i = 0; i < STRING_LENGTH; i++) {
|
||||||
|
// 从ALLOWED_CHARACTERS中随机选择一个字符
|
||||||
|
int randomIndex = random.nextInt(ALLOWED_CHARACTERS.length());
|
||||||
|
char randomChar = ALLOWED_CHARACTERS.charAt(randomIndex);
|
||||||
|
sb.append(randomChar);
|
||||||
|
}
|
||||||
|
|
||||||
|
return sb.toString();
|
||||||
|
}
|
||||||
|
}
|
||||||
204
yudao-module-farm/src/main/resources/mapper/SysDictMapper.xml
Normal file
204
yudao-module-farm/src/main/resources/mapper/SysDictMapper.xml
Normal file
@@ -0,0 +1,204 @@
|
|||||||
|
<?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.iocoder.yudao.module.farm.dal.mysql.sysDict.SysDictMapper">
|
||||||
|
|
||||||
|
<!--
|
||||||
|
一般情况下,尽可能使用 Mapper 进行 CRUD 增删改查即可。
|
||||||
|
无法满足的场景,例如说多表关联查询,才使用 XML 编写 SQL。
|
||||||
|
代码生成器暂时只生成 Mapper XML 文件本身,更多推荐 MybatisX 快速开发插件来生成查询。
|
||||||
|
文档可见:https://www.iocoder.cn/MyBatis/x-plugins/
|
||||||
|
-->
|
||||||
|
|
||||||
|
<sql id="all_fields">
|
||||||
|
id,
|
||||||
|
dict_type_code,
|
||||||
|
dict_type_name,
|
||||||
|
field1_code,
|
||||||
|
field1_name,
|
||||||
|
field2_code,
|
||||||
|
field2_name,
|
||||||
|
field3_code,
|
||||||
|
field3_name,
|
||||||
|
status,
|
||||||
|
deleted,
|
||||||
|
creator,
|
||||||
|
create_time,
|
||||||
|
updater,
|
||||||
|
update_time
|
||||||
|
</sql>
|
||||||
|
|
||||||
|
<select id="selectDictByOne"
|
||||||
|
parameterType="cn.iocoder.yudao.module.farm.controller.admin.dict.vo.sys.SysDictReqVO"
|
||||||
|
resultType="cn.iocoder.yudao.module.farm.dal.mysql.sysDict.SysDictDO">
|
||||||
|
|
||||||
|
SELECT
|
||||||
|
<include refid="all_fields"/>
|
||||||
|
FROM farm_sys_dict
|
||||||
|
<include refid="where_2"/>
|
||||||
|
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<sql id="where_2">
|
||||||
|
<where>
|
||||||
|
<if test="id != null">
|
||||||
|
AND id = #{id}
|
||||||
|
</if>
|
||||||
|
<if test="dictTypeCode != null and dictTypeCode != ''">
|
||||||
|
AND dict_type_code = #{dictTypeCode}
|
||||||
|
</if>
|
||||||
|
<if test="deleted != null">
|
||||||
|
AND deleted = #{deleted}
|
||||||
|
</if>
|
||||||
|
</where>
|
||||||
|
</sql>
|
||||||
|
|
||||||
|
<select id="selectDictByGroup"
|
||||||
|
parameterType="cn.iocoder.yudao.module.farm.controller.admin.dict.vo.sys.SysDictReqVO"
|
||||||
|
resultType="string">
|
||||||
|
|
||||||
|
SELECT field1_name
|
||||||
|
FROM farm_sys_dict
|
||||||
|
<where>
|
||||||
|
<if test="dictTypeCode != null and dictTypeCode != ''">
|
||||||
|
AND dict_type_code = #{dictTypeCode}
|
||||||
|
</if>
|
||||||
|
<if test="field1Code != null and field1Code != ''">
|
||||||
|
AND field1_code = #{field1Code}
|
||||||
|
</if>
|
||||||
|
<if test="deleted != null">
|
||||||
|
AND deleted = #{deleted}
|
||||||
|
</if>
|
||||||
|
</where>
|
||||||
|
GROUP BY field1_name
|
||||||
|
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<!-- 分页查询 -->
|
||||||
|
<select id="selectDictByPage"
|
||||||
|
parameterType="cn.iocoder.yudao.module.farm.controller.admin.dict.vo.sys.SysDictPageReqVO"
|
||||||
|
resultType="cn.iocoder.yudao.module.farm.dal.mysql.sysDict.SysDictDO">
|
||||||
|
SELECT
|
||||||
|
<include refid="all_fields"/>
|
||||||
|
FROM farm_sys_dict
|
||||||
|
<include refid="where_1"/>
|
||||||
|
ORDER BY dict_type_code, field1_code, field2_code, field3_code
|
||||||
|
LIMIT #{offset}, #{pageSize}
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<!-- 统计总数 -->
|
||||||
|
<select id="countDictByCondition" resultType="java.lang.Long">
|
||||||
|
SELECT COUNT(*)
|
||||||
|
FROM farm_sys_dict
|
||||||
|
<include refid="where_1"/>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<sql id="where_1">
|
||||||
|
<where>
|
||||||
|
<if test="dictTypeCode != null and dictTypeCode != ''">
|
||||||
|
AND dict_type_code = #{dictTypeCode}
|
||||||
|
</if>
|
||||||
|
<if test="field1Code != null and field1Code != ''">
|
||||||
|
AND field1_code = #{field1Code}
|
||||||
|
</if>
|
||||||
|
<if test="field1Name != null and field1Name != ''">
|
||||||
|
AND field1_name LIKE CONCAT('%', #{field1Name}, '%')
|
||||||
|
</if>
|
||||||
|
<if test="field2Code != null and field2Code != ''">
|
||||||
|
AND field2_code = #{field2Code}
|
||||||
|
</if>
|
||||||
|
<if test="field2Name != null and field2Name != ''">
|
||||||
|
AND field2_name LIKE CONCAT('%', #{field2Name}, '%')
|
||||||
|
</if>
|
||||||
|
<if test="field3Code != null and field3Code != ''">
|
||||||
|
AND field3_code = #{field3Code}
|
||||||
|
</if>
|
||||||
|
<if test="field3Name != null and field3Name != ''">
|
||||||
|
AND field3_name LIKE CONCAT('%', #{field3Name}, '%')
|
||||||
|
</if>
|
||||||
|
<if test="status != null">
|
||||||
|
AND status = #{status}
|
||||||
|
</if>
|
||||||
|
<if test="deleted != null">
|
||||||
|
AND deleted = #{deleted}
|
||||||
|
</if>
|
||||||
|
</where>
|
||||||
|
</sql>
|
||||||
|
|
||||||
|
<select id="getByTypeCode"
|
||||||
|
parameterType="cn.iocoder.yudao.module.farm.controller.admin.dict.vo.sys.SysDictPageReqVO"
|
||||||
|
resultType="cn.iocoder.yudao.module.farm.dal.mysql.sysDict.SysDictDO">
|
||||||
|
|
||||||
|
SELECT
|
||||||
|
<include refid="all_fields"/>
|
||||||
|
FROM farm_sys_dict t
|
||||||
|
WHERE
|
||||||
|
t.deleted = 0
|
||||||
|
AND t.dict_type_code = #{dictTypeCode}
|
||||||
|
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="groupByTypeCode" resultType="cn.iocoder.yudao.module.farm.dal.mysql.sysDict.SysDictDO">
|
||||||
|
|
||||||
|
SELECT dict_type_code,
|
||||||
|
dict_type_name
|
||||||
|
FROM farm_sys_dict
|
||||||
|
GROUP by dict_type_code, dict_type_name
|
||||||
|
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<insert id="insertOne" parameterType="cn.iocoder.yudao.module.farm.dal.mysql.sysDict.SysDictDO">
|
||||||
|
INSERT INTO farm_sys_dict
|
||||||
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||||
|
<if test="dictTypeCode != null and dictTypeCode != ''">dict_type_code,</if>
|
||||||
|
<if test="dictTypeName != null and dictTypeName != ''">dict_type_name,</if>
|
||||||
|
<if test="field1Code != null">field1_code,</if>
|
||||||
|
<if test="field1Name != null">field1_name,</if>
|
||||||
|
<if test="field2Code != null">field2_code,</if>
|
||||||
|
<if test="field2Name != null">field2_name,</if>
|
||||||
|
<if test="field3Code != null">field3_code,</if>
|
||||||
|
<if test="field3Name != null">field3_name,</if>
|
||||||
|
<if test="status != null">status,</if>
|
||||||
|
<if test="deleted != null">deleted,</if>
|
||||||
|
<if test="creator != null and creator != ''">creator,</if>
|
||||||
|
<if test="updater != null and updater != ''">updater,</if>
|
||||||
|
create_time,
|
||||||
|
update_time
|
||||||
|
</trim>
|
||||||
|
<trim prefix="VALUES (" suffix=")" suffixOverrides=",">
|
||||||
|
<if test="dictTypeCode != null and dictTypeCode != ''">#{dictTypeCode},</if>
|
||||||
|
<if test="dictTypeName != null and dictTypeName != ''">#{dictTypeName},</if>
|
||||||
|
<if test="field1Code != null">#{field1Code},</if>
|
||||||
|
<if test="field1Name != null">#{field1Name},</if>
|
||||||
|
<if test="field2Code != null">#{field2Code},</if>
|
||||||
|
<if test="field2Name != null">#{field2Name},</if>
|
||||||
|
<if test="field3Code != null">#{field3Code},</if>
|
||||||
|
<if test="field3Name != null">#{field3Name},</if>
|
||||||
|
<if test="status != null">#{status},</if>
|
||||||
|
<if test="deleted != null">#{deleted},</if>
|
||||||
|
<if test="creator != null and creator != ''">#{creator},</if>
|
||||||
|
<if test="updater != null and updater != ''">#{updater},</if>
|
||||||
|
NOW(),
|
||||||
|
NOW()
|
||||||
|
</trim>
|
||||||
|
</insert>
|
||||||
|
|
||||||
|
<update id="updateById" parameterType="cn.iocoder.yudao.module.farm.dal.mysql.sysDict.SysDictDO">
|
||||||
|
UPDATE farm_sys_dict
|
||||||
|
<set>
|
||||||
|
<if test="dictTypeCode != null and dictTypeCode != ''">dict_type_code = #{dictTypeCode},</if>
|
||||||
|
<if test="dictTypeName != null and dictTypeName != ''">dict_type_name = #{dictTypeName},</if>
|
||||||
|
<if test="field1Code != null">field1_code = #{field1Code},</if>
|
||||||
|
<if test="field1Name != null">field1_name = #{field1Name},</if>
|
||||||
|
<if test="field2Code != null">field2_code = #{field2Code},</if>
|
||||||
|
<if test="field2Name != null">field2_name = #{field2Name},</if>
|
||||||
|
<if test="field3Code != null">field3_code = #{field3Code},</if>
|
||||||
|
<if test="field3Name != null">field3_name = #{field3Name},</if>
|
||||||
|
<if test="status != null">status = #{status},</if>
|
||||||
|
<if test="deleted != null">deleted = #{deleted},</if>
|
||||||
|
<if test="updater != null and updater != ''">updater = #{updater},</if>
|
||||||
|
update_time = NOW()
|
||||||
|
</set>
|
||||||
|
WHERE id = #{id}
|
||||||
|
</update>
|
||||||
|
|
||||||
|
</mapper>
|
||||||
@@ -9,4 +9,61 @@
|
|||||||
文档可见:https://www.iocoder.cn/MyBatis/x-plugins/
|
文档可见:https://www.iocoder.cn/MyBatis/x-plugins/
|
||||||
-->
|
-->
|
||||||
|
|
||||||
|
<resultMap id="DisasterDataResultMap" type="cn.iocoder.yudao.module.farm.dal.dataobject.disasterdata.DisasterDataDO">
|
||||||
|
<!-- 基础字段 -->
|
||||||
|
<id column="id" property="id"/>
|
||||||
|
<result column="name" property="name"/>
|
||||||
|
<result column="category" property="category"/>
|
||||||
|
<result column="type" property="type"/>
|
||||||
|
<result column="disaster_description" property="disasterDescription"/>
|
||||||
|
<result column="treatment_suggestion" property="treatmentSuggestion"/>
|
||||||
|
<result column="img_url" property="imgUrl"/>
|
||||||
|
<result column="disaster_count" property="disasterCount"/>
|
||||||
|
<result column="disaster_time" property="disasterTime"/>
|
||||||
|
<result column="creator" property="creator"/>
|
||||||
|
<result column="create_time" property="createTime"/>
|
||||||
|
<!-- 其他字段 -->
|
||||||
|
<result column="foundation_id" property="foundationId"/>
|
||||||
|
<result column="base_id" property="baseId"/>
|
||||||
|
<result column="base_name" property="baseName"/>
|
||||||
|
<result column="plot_id" property="plotId"/>
|
||||||
|
<result column="plot_name" property="plotName"/>
|
||||||
|
<result column="tenant_id" property="tenantId"/>
|
||||||
|
<!-- 表中存在但DO中没有的字段 -->
|
||||||
|
<result column="updater" property="updater"/>
|
||||||
|
<result column="update_time" property="updateTime"/>
|
||||||
|
<result column="deleted" property="deleted"/>
|
||||||
|
</resultMap>
|
||||||
|
|
||||||
|
<select id="selectDisasterDataPage" resultMap="DisasterDataResultMap">
|
||||||
|
SELECT *
|
||||||
|
FROM farm_disaster_data
|
||||||
|
WHERE deleted = 0
|
||||||
|
<if test="req.name != null and req.name != ''">
|
||||||
|
AND name LIKE CONCAT('%', #{req.name}, '%')
|
||||||
|
</if>
|
||||||
|
<if test="req.category != null">
|
||||||
|
AND category = #{req.category}
|
||||||
|
</if>
|
||||||
|
<if test="req.type != null">
|
||||||
|
AND type = #{req.type}
|
||||||
|
</if>
|
||||||
|
LIMIT #{req.pageSize} OFFSET #{req.pageNo}
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="selectDisasterDataCount" resultType="java.lang.Long">
|
||||||
|
SELECT COUNT(*)
|
||||||
|
FROM farm_disaster_data
|
||||||
|
WHERE deleted = 0
|
||||||
|
<if test="req.name != null and req.name != ''">
|
||||||
|
AND name LIKE CONCAT('%', #{req.name}, '%')
|
||||||
|
</if>
|
||||||
|
<if test="req.category != null">
|
||||||
|
AND category = #{req.category}
|
||||||
|
</if>
|
||||||
|
<if test="req.type != null">
|
||||||
|
AND type = #{req.type}
|
||||||
|
</if>
|
||||||
|
</select>
|
||||||
|
|
||||||
</mapper>
|
</mapper>
|
||||||
@@ -50,4 +50,27 @@
|
|||||||
</where>
|
</where>
|
||||||
|
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
<update id="update" parameterType="cn.iocoder.yudao.module.farm.dal.dataobject.farmingtypemaintenance.FarmingTypeMaintenanceDO">
|
||||||
|
UPDATE farm_farming_type_maintenance t
|
||||||
|
<set>
|
||||||
|
<if test="req.farmingCode != null and req.farmingCode != ''">
|
||||||
|
t.farming_code = #{farmingCode},
|
||||||
|
</if>
|
||||||
|
<if test="req.farmingName != null and req.farmingName != ''">
|
||||||
|
t.farming_name = #{farmingName},
|
||||||
|
</if>
|
||||||
|
<if test="req.useStatus != null">
|
||||||
|
t.use_status = #{useStatus},
|
||||||
|
</if>
|
||||||
|
<if test="req.deleted != null">
|
||||||
|
t.deleted = #{deleted},
|
||||||
|
</if>
|
||||||
|
<if test="req.updater != null and req.updater != ''">
|
||||||
|
t.updater = #{updater},
|
||||||
|
</if>
|
||||||
|
t.update_time = NOW()
|
||||||
|
</set>
|
||||||
|
where t.id = #{req.id}
|
||||||
|
</update>
|
||||||
</mapper>
|
</mapper>
|
||||||
@@ -10,16 +10,16 @@
|
|||||||
-->
|
-->
|
||||||
|
|
||||||
<sql id="all_fields">
|
<sql id="all_fields">
|
||||||
id,
|
t.id,
|
||||||
primary_class_code,
|
t.primary_class_code,
|
||||||
primary_class_name,
|
t.primary_class_name,
|
||||||
secondary_class_code,
|
t.secondary_class_code,
|
||||||
secondary_class_name,
|
t.secondary_class_name,
|
||||||
use_status,
|
t.use_status,
|
||||||
creator,
|
t.creator,
|
||||||
create_time,
|
t.create_time,
|
||||||
updater,
|
t.updater,
|
||||||
update_time
|
t.update_time
|
||||||
</sql>
|
</sql>
|
||||||
|
|
||||||
<select id="getSpeciesClassifyLibraryList"
|
<select id="getSpeciesClassifyLibraryList"
|
||||||
@@ -29,39 +29,24 @@
|
|||||||
SELECT <include refid="all_fields"/> FROM farm_species_classify_library t
|
SELECT <include refid="all_fields"/> FROM farm_species_classify_library t
|
||||||
<where>
|
<where>
|
||||||
<if test="req.id != null">
|
<if test="req.id != null">
|
||||||
AND id = #{req.id}
|
AND t.id = #{req.id}
|
||||||
</if>
|
</if>
|
||||||
<if test="req.primaryClassCode != null and req.primaryClassCode != ''">
|
<if test="req.primaryClassCode != null and req.primaryClassCode != ''">
|
||||||
AND primary_class_code = #{req.primaryClassCode}
|
AND t.tprimary_class_code = #{req.primaryClassCode}
|
||||||
</if>
|
</if>
|
||||||
<if test="req.primaryClassName != null and req.primaryClassName != ''">
|
<if test="req.primaryClassName != null and req.primaryClassName != ''">
|
||||||
AND primary_class_name LIKE CONCAT('%', #{req.primaryClassName}, '%')
|
AND t.primary_class_name LIKE CONCAT('%', #{req.primaryClassName}, '%')
|
||||||
</if>
|
</if>
|
||||||
<if test="req.secondaryClassCode != null and req.secondaryClassCode != ''">
|
<if test="req.secondaryClassCode != null and req.secondaryClassCode != ''">
|
||||||
AND secondary_class_code = #{req.secondaryClassCode}
|
AND t.secondary_class_code = #{req.secondaryClassCode}
|
||||||
</if>
|
</if>
|
||||||
<if test="req.secondaryClassName != null and req.secondaryClassName != ''">
|
<if test="req.secondaryClassName != null and req.secondaryClassName != ''">
|
||||||
AND secondary_class_name LIKE CONCAT('%', #{req.secondaryClassName}, '%')
|
AND t.secondary_class_name LIKE CONCAT('%', #{req.secondaryClassName}, '%')
|
||||||
</if>
|
</if>
|
||||||
<if test="req.useStatus != null">
|
<if test="req.useStatus != null">
|
||||||
AND use_status = #{req.useStatus}
|
AND t.use_status = #{req.useStatus}
|
||||||
</if>
|
|
||||||
<if test="req.creator != null and req.creator != ''">
|
|
||||||
AND creator = #{req.creator}
|
|
||||||
</if>
|
|
||||||
<if test="req.createTime != null">
|
|
||||||
AND create_time >= #{req.createTime}
|
|
||||||
</if>
|
|
||||||
<if test="req.updater != null and req.updater != ''">
|
|
||||||
AND updater = #{req.updater}
|
|
||||||
</if>
|
|
||||||
<if test="req.updateTime != null">
|
|
||||||
AND update_time >= #{req.updateTime}
|
|
||||||
</if>
|
</if>
|
||||||
</where>
|
</where>
|
||||||
ORDER BY t.id DESC
|
|
||||||
|
|
||||||
|
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
</mapper>
|
</mapper>
|
||||||
Reference in New Issue
Block a user