初步完成农场分区、菜地划分模块。
This commit is contained in:
parent
ca4d0db841
commit
3c83bf252c
@ -16,8 +16,8 @@ import com.ruoyi.common.annotation.Log;
|
|||||||
import com.ruoyi.common.core.controller.BaseController;
|
import com.ruoyi.common.core.controller.BaseController;
|
||||||
import com.ruoyi.common.core.domain.AjaxResult;
|
import com.ruoyi.common.core.domain.AjaxResult;
|
||||||
import com.ruoyi.common.enums.BusinessType;
|
import com.ruoyi.common.enums.BusinessType;
|
||||||
import com.jlt.csa.domain.Zone;
|
import com.jlt.csa.domain.FarmZone;
|
||||||
import com.jlt.csa.service.IZoneService;
|
import com.jlt.csa.service.IFarmZoneService;
|
||||||
import com.ruoyi.common.utils.poi.ExcelUtil;
|
import com.ruoyi.common.utils.poi.ExcelUtil;
|
||||||
import com.ruoyi.common.core.page.TableDataInfo;
|
import com.ruoyi.common.core.page.TableDataInfo;
|
||||||
|
|
||||||
@ -25,24 +25,24 @@ import com.ruoyi.common.core.page.TableDataInfo;
|
|||||||
* 农场分区Controller
|
* 农场分区Controller
|
||||||
*
|
*
|
||||||
* @author 郏磊涛
|
* @author 郏磊涛
|
||||||
* @date 2022-03-27
|
* @date 2022-03-28
|
||||||
*/
|
*/
|
||||||
@RestController
|
@RestController
|
||||||
@RequestMapping("/csa/farmzone")
|
@RequestMapping("/csa/farmzone")
|
||||||
public class ZoneController extends BaseController
|
public class FarmZoneController extends BaseController
|
||||||
{
|
{
|
||||||
@Autowired
|
@Autowired
|
||||||
private IZoneService zoneService;
|
private IFarmZoneService farmZoneService;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询农场分区列表
|
* 查询农场分区列表
|
||||||
*/
|
*/
|
||||||
@PreAuthorize("@ss.hasPermi('csa:farmzone:list')")
|
@PreAuthorize("@ss.hasPermi('csa:farmzone:list')")
|
||||||
@GetMapping("/list")
|
@GetMapping("/list")
|
||||||
public TableDataInfo list(Zone zone)
|
public TableDataInfo list(FarmZone farmZone)
|
||||||
{
|
{
|
||||||
startPage();
|
startPage();
|
||||||
List<Zone> list = zoneService.selectZoneList(zone);
|
List<FarmZone> list = farmZoneService.selectFarmZoneList(farmZone);
|
||||||
return getDataTable(list);
|
return getDataTable(list);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -52,10 +52,10 @@ public class ZoneController extends BaseController
|
|||||||
@PreAuthorize("@ss.hasPermi('csa:farmzone:export')")
|
@PreAuthorize("@ss.hasPermi('csa:farmzone:export')")
|
||||||
@Log(title = "农场分区", businessType = BusinessType.EXPORT)
|
@Log(title = "农场分区", businessType = BusinessType.EXPORT)
|
||||||
@PostMapping("/export")
|
@PostMapping("/export")
|
||||||
public void export(HttpServletResponse response, Zone zone)
|
public void export(HttpServletResponse response, FarmZone farmZone)
|
||||||
{
|
{
|
||||||
List<Zone> list = zoneService.selectZoneList(zone);
|
List<FarmZone> list = farmZoneService.selectFarmZoneList(farmZone);
|
||||||
ExcelUtil<Zone> util = new ExcelUtil<Zone>(Zone.class);
|
ExcelUtil<FarmZone> util = new ExcelUtil<FarmZone>(FarmZone.class);
|
||||||
util.exportExcel(response, list, "农场分区数据");
|
util.exportExcel(response, list, "农场分区数据");
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -63,10 +63,10 @@ public class ZoneController extends BaseController
|
|||||||
* 获取农场分区详细信息
|
* 获取农场分区详细信息
|
||||||
*/
|
*/
|
||||||
@PreAuthorize("@ss.hasPermi('csa:farmzone:query')")
|
@PreAuthorize("@ss.hasPermi('csa:farmzone:query')")
|
||||||
@GetMapping(value = "/{code}")
|
@GetMapping(value = "/{id}")
|
||||||
public AjaxResult getInfo(@PathVariable("code") String code)
|
public AjaxResult getInfo(@PathVariable("id") Long id)
|
||||||
{
|
{
|
||||||
return AjaxResult.success(zoneService.selectZoneByCode(code));
|
return AjaxResult.success(farmZoneService.selectFarmZoneById(id));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -75,9 +75,9 @@ public class ZoneController extends BaseController
|
|||||||
@PreAuthorize("@ss.hasPermi('csa:farmzone:add')")
|
@PreAuthorize("@ss.hasPermi('csa:farmzone:add')")
|
||||||
@Log(title = "农场分区", businessType = BusinessType.INSERT)
|
@Log(title = "农场分区", businessType = BusinessType.INSERT)
|
||||||
@PostMapping
|
@PostMapping
|
||||||
public AjaxResult add(@RequestBody Zone zone)
|
public AjaxResult add(@RequestBody FarmZone farmZone)
|
||||||
{
|
{
|
||||||
return toAjax(zoneService.insertZone(zone));
|
return toAjax(farmZoneService.insertFarmZone(farmZone));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -86,9 +86,9 @@ public class ZoneController extends BaseController
|
|||||||
@PreAuthorize("@ss.hasPermi('csa:farmzone:edit')")
|
@PreAuthorize("@ss.hasPermi('csa:farmzone:edit')")
|
||||||
@Log(title = "农场分区", businessType = BusinessType.UPDATE)
|
@Log(title = "农场分区", businessType = BusinessType.UPDATE)
|
||||||
@PutMapping
|
@PutMapping
|
||||||
public AjaxResult edit(@RequestBody Zone zone)
|
public AjaxResult edit(@RequestBody FarmZone farmZone)
|
||||||
{
|
{
|
||||||
return toAjax(zoneService.updateZone(zone));
|
return toAjax(farmZoneService.updateFarmZone(farmZone));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -96,9 +96,9 @@ public class ZoneController extends BaseController
|
|||||||
*/
|
*/
|
||||||
@PreAuthorize("@ss.hasPermi('csa:farmzone:remove')")
|
@PreAuthorize("@ss.hasPermi('csa:farmzone:remove')")
|
||||||
@Log(title = "农场分区", businessType = BusinessType.DELETE)
|
@Log(title = "农场分区", businessType = BusinessType.DELETE)
|
||||||
@DeleteMapping("/{codes}")
|
@DeleteMapping("/{ids}")
|
||||||
public AjaxResult remove(@PathVariable String[] codes)
|
public AjaxResult remove(@PathVariable Long[] ids)
|
||||||
{
|
{
|
||||||
return toAjax(zoneService.deleteZoneByCodes(codes));
|
return toAjax(farmZoneService.deleteFarmZoneByIds(ids));
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -23,9 +23,9 @@ import com.ruoyi.common.core.page.TableDataInfo;
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 菜地划分Controller
|
* 菜地划分Controller
|
||||||
*
|
*
|
||||||
* @author 郏磊涛
|
* @author 郏磊涛
|
||||||
* @date 2022-03-24
|
* @date 2022-03-29
|
||||||
*/
|
*/
|
||||||
@RestController
|
@RestController
|
||||||
@RequestMapping("/csa/garden")
|
@RequestMapping("/csa/garden")
|
||||||
@ -91,12 +91,23 @@ public class GardenController extends BaseController
|
|||||||
return toAjax(gardenService.updateGarden(garden));
|
return toAjax(gardenService.updateGarden(garden));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量更新菜地状态
|
||||||
|
*/
|
||||||
|
@PreAuthorize("@ss.hasPermi('csa:garden:edit')")
|
||||||
|
@Log(title = "农场分区", businessType = BusinessType.UPDATE)
|
||||||
|
@PutMapping("/{ids}")
|
||||||
|
public AjaxResult updateStatus(@RequestBody Garden garden, @PathVariable Long[] ids)
|
||||||
|
{
|
||||||
|
return toAjax(gardenService.updateGardenStatus(garden, ids));
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 删除菜地划分
|
* 删除菜地划分
|
||||||
*/
|
*/
|
||||||
@PreAuthorize("@ss.hasPermi('csa:garden:remove')")
|
@PreAuthorize("@ss.hasPermi('csa:garden:remove')")
|
||||||
@Log(title = "菜地划分", businessType = BusinessType.DELETE)
|
@Log(title = "菜地划分", businessType = BusinessType.DELETE)
|
||||||
@DeleteMapping("/{ids}")
|
@DeleteMapping("/{ids}")
|
||||||
public AjaxResult remove(@PathVariable Long[] ids)
|
public AjaxResult remove(@PathVariable Long[] ids)
|
||||||
{
|
{
|
||||||
return toAjax(gardenService.deleteGardenByIds(ids));
|
return toAjax(gardenService.deleteGardenByIds(ids));
|
||||||
|
@ -1,115 +0,0 @@
|
|||||||
package com.jlt.csa.controller.base;
|
|
||||||
|
|
||||||
import com.jlt.csa.service.base.ICsaDictDataService;
|
|
||||||
import com.jlt.csa.service.base.ICsaDictTypeService;
|
|
||||||
import com.ruoyi.common.annotation.Log;
|
|
||||||
import com.ruoyi.common.core.controller.BaseController;
|
|
||||||
import com.ruoyi.common.core.domain.AjaxResult;
|
|
||||||
import com.ruoyi.common.core.domain.entity.SysDictData;
|
|
||||||
import com.ruoyi.common.core.page.TableDataInfo;
|
|
||||||
import com.ruoyi.common.enums.BusinessType;
|
|
||||||
import com.ruoyi.common.utils.StringUtils;
|
|
||||||
import com.ruoyi.common.utils.poi.ExcelUtil;
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
|
||||||
import org.springframework.security.access.prepost.PreAuthorize;
|
|
||||||
import org.springframework.validation.annotation.Validated;
|
|
||||||
import org.springframework.web.bind.annotation.*;
|
|
||||||
|
|
||||||
import javax.servlet.http.HttpServletResponse;
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 数据字典信息
|
|
||||||
*
|
|
||||||
* @author ruoyi
|
|
||||||
*/
|
|
||||||
@RestController
|
|
||||||
@RequestMapping("/csa/base/dict/data")
|
|
||||||
public class CsaDictDataController extends BaseController
|
|
||||||
{
|
|
||||||
@Autowired
|
|
||||||
private ICsaDictDataService dictDataService;
|
|
||||||
|
|
||||||
@Autowired
|
|
||||||
private ICsaDictTypeService dictTypeService;
|
|
||||||
|
|
||||||
@PreAuthorize("@ss.hasPermi('system:dict:list')")
|
|
||||||
@GetMapping("/list")
|
|
||||||
public TableDataInfo list(SysDictData dictData)
|
|
||||||
{
|
|
||||||
startPage();
|
|
||||||
List<SysDictData> list = dictDataService.selectDictDataList(dictData);
|
|
||||||
return getDataTable(list);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Log(title = "字典数据", businessType = BusinessType.EXPORT)
|
|
||||||
@PreAuthorize("@ss.hasPermi('system:dict:export')")
|
|
||||||
@PostMapping("/export")
|
|
||||||
public void export(HttpServletResponse response, SysDictData dictData)
|
|
||||||
{
|
|
||||||
List<SysDictData> list = dictDataService.selectDictDataList(dictData);
|
|
||||||
ExcelUtil<SysDictData> util = new ExcelUtil<SysDictData>(SysDictData.class);
|
|
||||||
util.exportExcel(response, list, "字典数据");
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 查询字典数据详细
|
|
||||||
*/
|
|
||||||
@PreAuthorize("@ss.hasPermi('system:dict:query')")
|
|
||||||
@GetMapping(value = "/{dictCode}")
|
|
||||||
public AjaxResult getInfo(@PathVariable Long dictCode)
|
|
||||||
{
|
|
||||||
return AjaxResult.success(dictDataService.selectDictDataById(dictCode));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 根据字典类型查询字典数据信息
|
|
||||||
*/
|
|
||||||
@GetMapping(value = "/type/{dictType}")
|
|
||||||
public AjaxResult dictType(@PathVariable String dictType)
|
|
||||||
{
|
|
||||||
List<SysDictData> data = dictTypeService.selectDictDataByType(dictType);
|
|
||||||
if (StringUtils.isNull(data))
|
|
||||||
{
|
|
||||||
data = new ArrayList<SysDictData>();
|
|
||||||
}
|
|
||||||
return AjaxResult.success(data);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 新增字典类型
|
|
||||||
*/
|
|
||||||
@PreAuthorize("@ss.hasPermi('system:dict:add')")
|
|
||||||
@Log(title = "字典数据", businessType = BusinessType.INSERT)
|
|
||||||
@PostMapping
|
|
||||||
public AjaxResult add(@Validated @RequestBody SysDictData dict)
|
|
||||||
{
|
|
||||||
dict.setCreateBy(getUsername());
|
|
||||||
return toAjax(dictDataService.insertDictData(dict));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 修改保存字典类型
|
|
||||||
*/
|
|
||||||
@PreAuthorize("@ss.hasPermi('system:dict:edit')")
|
|
||||||
@Log(title = "字典数据", businessType = BusinessType.UPDATE)
|
|
||||||
@PutMapping
|
|
||||||
public AjaxResult edit(@Validated @RequestBody SysDictData dict)
|
|
||||||
{
|
|
||||||
dict.setUpdateBy(getUsername());
|
|
||||||
return toAjax(dictDataService.updateDictData(dict));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 删除字典类型
|
|
||||||
*/
|
|
||||||
@PreAuthorize("@ss.hasPermi('system:dict:remove')")
|
|
||||||
@Log(title = "字典类型", businessType = BusinessType.DELETE)
|
|
||||||
@DeleteMapping("/{dictCodes}")
|
|
||||||
public AjaxResult remove(@PathVariable Long[] dictCodes)
|
|
||||||
{
|
|
||||||
dictDataService.deleteDictDataByIds(dictCodes);
|
|
||||||
return success();
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,126 +0,0 @@
|
|||||||
package com.jlt.csa.controller.base;
|
|
||||||
|
|
||||||
import com.jlt.csa.service.base.ICsaDictTypeService;
|
|
||||||
import com.ruoyi.common.annotation.Log;
|
|
||||||
import com.ruoyi.common.constant.UserConstants;
|
|
||||||
import com.ruoyi.common.core.controller.BaseController;
|
|
||||||
import com.ruoyi.common.core.domain.AjaxResult;
|
|
||||||
import com.ruoyi.common.core.domain.entity.SysDictType;
|
|
||||||
import com.ruoyi.common.core.page.TableDataInfo;
|
|
||||||
import com.ruoyi.common.enums.BusinessType;
|
|
||||||
import com.ruoyi.common.utils.poi.ExcelUtil;
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
|
||||||
import org.springframework.security.access.prepost.PreAuthorize;
|
|
||||||
import org.springframework.validation.annotation.Validated;
|
|
||||||
import org.springframework.web.bind.annotation.*;
|
|
||||||
|
|
||||||
import javax.servlet.http.HttpServletResponse;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 数据字典信息
|
|
||||||
*
|
|
||||||
* @author ruoyi
|
|
||||||
*/
|
|
||||||
@RestController
|
|
||||||
@RequestMapping("/csa/base/dict/type")
|
|
||||||
public class CsaDictTypeController extends BaseController
|
|
||||||
{
|
|
||||||
@Autowired
|
|
||||||
private ICsaDictTypeService dictTypeService;
|
|
||||||
|
|
||||||
@PreAuthorize("@ss.hasPermi('system:dict:list')")
|
|
||||||
@GetMapping("/list")
|
|
||||||
public TableDataInfo list(SysDictType dictType)
|
|
||||||
{
|
|
||||||
startPage();
|
|
||||||
List<SysDictType> list = dictTypeService.selectDictTypeList(dictType);
|
|
||||||
return getDataTable(list);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Log(title = "字典类型", businessType = BusinessType.EXPORT)
|
|
||||||
@PreAuthorize("@ss.hasPermi('system:dict:export')")
|
|
||||||
@PostMapping("/export")
|
|
||||||
public void export(HttpServletResponse response, SysDictType dictType)
|
|
||||||
{
|
|
||||||
List<SysDictType> list = dictTypeService.selectDictTypeList(dictType);
|
|
||||||
ExcelUtil<SysDictType> util = new ExcelUtil<SysDictType>(SysDictType.class);
|
|
||||||
util.exportExcel(response, list, "字典类型");
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 查询字典类型详细
|
|
||||||
*/
|
|
||||||
@PreAuthorize("@ss.hasPermi('system:dict:query')")
|
|
||||||
@GetMapping(value = "/{dictId}")
|
|
||||||
public AjaxResult getInfo(@PathVariable Long dictId)
|
|
||||||
{
|
|
||||||
return AjaxResult.success(dictTypeService.selectDictTypeById(dictId));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 新增字典类型
|
|
||||||
*/
|
|
||||||
@PreAuthorize("@ss.hasPermi('system:dict:add')")
|
|
||||||
@Log(title = "字典类型", businessType = BusinessType.INSERT)
|
|
||||||
@PostMapping
|
|
||||||
public AjaxResult add(@Validated @RequestBody SysDictType dict)
|
|
||||||
{
|
|
||||||
if (UserConstants.NOT_UNIQUE.equals(dictTypeService.checkDictTypeUnique(dict)))
|
|
||||||
{
|
|
||||||
return AjaxResult.error("新增字典'" + dict.getDictName() + "'失败,字典类型已存在");
|
|
||||||
}
|
|
||||||
dict.setCreateBy(getUsername());
|
|
||||||
return toAjax(dictTypeService.insertDictType(dict));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 修改字典类型
|
|
||||||
*/
|
|
||||||
@PreAuthorize("@ss.hasPermi('system:dict:edit')")
|
|
||||||
@Log(title = "字典类型", businessType = BusinessType.UPDATE)
|
|
||||||
@PutMapping
|
|
||||||
public AjaxResult edit(@Validated @RequestBody SysDictType dict)
|
|
||||||
{
|
|
||||||
if (UserConstants.NOT_UNIQUE.equals(dictTypeService.checkDictTypeUnique(dict)))
|
|
||||||
{
|
|
||||||
return AjaxResult.error("修改字典'" + dict.getDictName() + "'失败,字典类型已存在");
|
|
||||||
}
|
|
||||||
dict.setUpdateBy(getUsername());
|
|
||||||
return toAjax(dictTypeService.updateDictType(dict));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 删除字典类型
|
|
||||||
*/
|
|
||||||
@PreAuthorize("@ss.hasPermi('system:dict:remove')")
|
|
||||||
@Log(title = "字典类型", businessType = BusinessType.DELETE)
|
|
||||||
@DeleteMapping("/{dictIds}")
|
|
||||||
public AjaxResult remove(@PathVariable Long[] dictIds)
|
|
||||||
{
|
|
||||||
dictTypeService.deleteDictTypeByIds(dictIds);
|
|
||||||
return success();
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 刷新字典缓存
|
|
||||||
*/
|
|
||||||
@PreAuthorize("@ss.hasPermi('system:dict:remove')")
|
|
||||||
@Log(title = "字典类型", businessType = BusinessType.CLEAN)
|
|
||||||
@DeleteMapping("/refreshCache")
|
|
||||||
public AjaxResult refreshCache()
|
|
||||||
{
|
|
||||||
dictTypeService.resetDictCache();
|
|
||||||
return AjaxResult.success();
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 获取字典选择框列表
|
|
||||||
*/
|
|
||||||
@GetMapping("/optionselect")
|
|
||||||
public AjaxResult optionselect()
|
|
||||||
{
|
|
||||||
List<SysDictType> dictTypes = dictTypeService.selectDictTypeAll();
|
|
||||||
return AjaxResult.success(dictTypes);
|
|
||||||
}
|
|
||||||
}
|
|
@ -6,17 +6,17 @@ import com.ruoyi.common.annotation.Excel;
|
|||||||
import com.ruoyi.common.core.domain.BaseEntity;
|
import com.ruoyi.common.core.domain.BaseEntity;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 农场分区对象 csa_zone
|
* 农场分区对象 csa_farm_zone
|
||||||
*
|
*
|
||||||
* @author 郏磊涛
|
* @author 郏磊涛
|
||||||
* @date 2022-03-27
|
* @date 2022-03-28
|
||||||
*/
|
*/
|
||||||
public class Zone extends BaseEntity
|
public class FarmZone extends BaseEntity
|
||||||
{
|
{
|
||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
/** 分区代码 */
|
/** 分区id */
|
||||||
private String code;
|
private Long id;
|
||||||
|
|
||||||
/** 分区类型 */
|
/** 分区类型 */
|
||||||
@Excel(name = "分区类型")
|
@Excel(name = "分区类型")
|
||||||
@ -26,21 +26,21 @@ public class Zone extends BaseEntity
|
|||||||
@Excel(name = "分区名称")
|
@Excel(name = "分区名称")
|
||||||
private String name;
|
private String name;
|
||||||
|
|
||||||
/** 状态(0正常 1停用) */
|
/** 状态 */
|
||||||
@Excel(name = "状态", readConverterExp = "0=正常,1=停用")
|
@Excel(name = "状态")
|
||||||
private String status;
|
private String status;
|
||||||
|
|
||||||
/** 删除标志(0代表存在 2代表删除) */
|
/** 删除标志 */
|
||||||
private String delFlag;
|
private String delFlag;
|
||||||
|
|
||||||
public void setCode(String code)
|
public void setId(Long id)
|
||||||
{
|
{
|
||||||
this.code = code;
|
this.id = id;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getCode()
|
public Long getId()
|
||||||
{
|
{
|
||||||
return code;
|
return id;
|
||||||
}
|
}
|
||||||
public void setType(String type)
|
public void setType(String type)
|
||||||
{
|
{
|
||||||
@ -82,7 +82,7 @@ public class Zone extends BaseEntity
|
|||||||
@Override
|
@Override
|
||||||
public String toString() {
|
public String toString() {
|
||||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||||
.append("code", getCode())
|
.append("id", getId())
|
||||||
.append("type", getType())
|
.append("type", getType())
|
||||||
.append("name", getName())
|
.append("name", getName())
|
||||||
.append("status", getStatus())
|
.append("status", getStatus())
|
@ -8,25 +8,25 @@ import com.ruoyi.common.core.domain.BaseEntity;
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 菜地划分对象 csa_garden
|
* 菜地划分对象 csa_garden
|
||||||
*
|
*
|
||||||
* @author 郏磊涛
|
* @author 郏磊涛
|
||||||
* @date 2022-03-24
|
* @date 2022-03-29
|
||||||
*/
|
*/
|
||||||
public class Garden extends BaseEntity
|
public class Garden extends BaseEntity
|
||||||
{
|
{
|
||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
/** $column.columnComment */
|
/** 菜地id */
|
||||||
private Long id;
|
private Long id;
|
||||||
|
|
||||||
|
/** 农场分区 */
|
||||||
|
@Excel(name = "农场分区")
|
||||||
|
private Long zoneId;
|
||||||
|
|
||||||
/** 菜地编号 */
|
/** 菜地编号 */
|
||||||
@Excel(name = "菜地编号")
|
@Excel(name = "菜地编号")
|
||||||
private String code;
|
private String code;
|
||||||
|
|
||||||
/** 分区代码 */
|
|
||||||
@Excel(name = "分区代码")
|
|
||||||
private String zoneCode;
|
|
||||||
|
|
||||||
/** 菜地名称 */
|
/** 菜地名称 */
|
||||||
@Excel(name = "菜地名称")
|
@Excel(name = "菜地名称")
|
||||||
private String name;
|
private String name;
|
||||||
@ -35,157 +35,164 @@ public class Garden extends BaseEntity
|
|||||||
@Excel(name = "平方米")
|
@Excel(name = "平方米")
|
||||||
private BigDecimal m2;
|
private BigDecimal m2;
|
||||||
|
|
||||||
/** 会员id */
|
/** 会员 */
|
||||||
|
@Excel(name = "会员")
|
||||||
private Long memberId;
|
private Long memberId;
|
||||||
|
|
||||||
/** 菜地管理员id */
|
/** 菜地管理员 */
|
||||||
|
@Excel(name = "菜地管理员")
|
||||||
private Long managerId;
|
private Long managerId;
|
||||||
|
|
||||||
/** 工人id */
|
/** 工人 */
|
||||||
|
@Excel(name = "工人")
|
||||||
private Long workerId;
|
private Long workerId;
|
||||||
|
|
||||||
/** 客服人员id */
|
/** 客服人员 */
|
||||||
|
@Excel(name = "客服人员")
|
||||||
private Long contacterId;
|
private Long contacterId;
|
||||||
|
|
||||||
/** 耕作状态 */
|
/** 耕作状态 */
|
||||||
|
@Excel(name = "耕作状态")
|
||||||
private String isFarming;
|
private String isFarming;
|
||||||
|
|
||||||
/** 售出状态 */
|
/** 售出状态 */
|
||||||
|
@Excel(name = "售出状态")
|
||||||
private String isSelled;
|
private String isSelled;
|
||||||
|
|
||||||
/** 竣工状态 */
|
/** 竣工状态 */
|
||||||
@Excel(name = "竣工状态")
|
@Excel(name = "竣工状态")
|
||||||
private String isCompleted;
|
private String isCompleted;
|
||||||
|
|
||||||
/** 状态(0正常 1停用) */
|
/** 状态 */
|
||||||
|
@Excel(name = "状态")
|
||||||
private String status;
|
private String status;
|
||||||
|
|
||||||
/** 删除标志(0代表存在 2代表删除) */
|
/** 删除标志 */
|
||||||
private String delFlag;
|
private String delFlag;
|
||||||
|
|
||||||
public void setId(Long id)
|
public void setId(Long id)
|
||||||
{
|
{
|
||||||
this.id = id;
|
this.id = id;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Long getId()
|
public Long getId()
|
||||||
{
|
{
|
||||||
return id;
|
return id;
|
||||||
}
|
}
|
||||||
public void setCode(String code)
|
public void setZoneId(Long zoneId)
|
||||||
|
{
|
||||||
|
this.zoneId = zoneId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Long getZoneId()
|
||||||
|
{
|
||||||
|
return zoneId;
|
||||||
|
}
|
||||||
|
public void setCode(String code)
|
||||||
{
|
{
|
||||||
this.code = code;
|
this.code = code;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getCode()
|
public String getCode()
|
||||||
{
|
{
|
||||||
return code;
|
return code;
|
||||||
}
|
}
|
||||||
public void setZoneCode(String zoneCode)
|
public void setName(String name)
|
||||||
{
|
|
||||||
this.zoneCode = zoneCode;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getZoneCode()
|
|
||||||
{
|
|
||||||
return zoneCode;
|
|
||||||
}
|
|
||||||
public void setName(String name)
|
|
||||||
{
|
{
|
||||||
this.name = name;
|
this.name = name;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getName()
|
public String getName()
|
||||||
{
|
{
|
||||||
return name;
|
return name;
|
||||||
}
|
}
|
||||||
public void setM2(BigDecimal m2)
|
public void setM2(BigDecimal m2)
|
||||||
{
|
{
|
||||||
this.m2 = m2;
|
this.m2 = m2;
|
||||||
}
|
}
|
||||||
|
|
||||||
public BigDecimal getM2()
|
public BigDecimal getM2()
|
||||||
{
|
{
|
||||||
return m2;
|
return m2;
|
||||||
}
|
}
|
||||||
public void setMemberId(Long memberId)
|
public void setMemberId(Long memberId)
|
||||||
{
|
{
|
||||||
this.memberId = memberId;
|
this.memberId = memberId;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Long getMemberId()
|
public Long getMemberId()
|
||||||
{
|
{
|
||||||
return memberId;
|
return memberId;
|
||||||
}
|
}
|
||||||
public void setManagerId(Long managerId)
|
public void setManagerId(Long managerId)
|
||||||
{
|
{
|
||||||
this.managerId = managerId;
|
this.managerId = managerId;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Long getManagerId()
|
public Long getManagerId()
|
||||||
{
|
{
|
||||||
return managerId;
|
return managerId;
|
||||||
}
|
}
|
||||||
public void setWorkerId(Long workerId)
|
public void setWorkerId(Long workerId)
|
||||||
{
|
{
|
||||||
this.workerId = workerId;
|
this.workerId = workerId;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Long getWorkerId()
|
public Long getWorkerId()
|
||||||
{
|
{
|
||||||
return workerId;
|
return workerId;
|
||||||
}
|
}
|
||||||
public void setContacterId(Long contacterId)
|
public void setContacterId(Long contacterId)
|
||||||
{
|
{
|
||||||
this.contacterId = contacterId;
|
this.contacterId = contacterId;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Long getContacterId()
|
public Long getContacterId()
|
||||||
{
|
{
|
||||||
return contacterId;
|
return contacterId;
|
||||||
}
|
}
|
||||||
public void setIsFarming(String isFarming)
|
public void setIsFarming(String isFarming)
|
||||||
{
|
{
|
||||||
this.isFarming = isFarming;
|
this.isFarming = isFarming;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getIsFarming()
|
public String getIsFarming()
|
||||||
{
|
{
|
||||||
return isFarming;
|
return isFarming;
|
||||||
}
|
}
|
||||||
public void setIsSelled(String isSelled)
|
public void setIsSelled(String isSelled)
|
||||||
{
|
{
|
||||||
this.isSelled = isSelled;
|
this.isSelled = isSelled;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getIsSelled()
|
public String getIsSelled()
|
||||||
{
|
{
|
||||||
return isSelled;
|
return isSelled;
|
||||||
}
|
}
|
||||||
public void setIsCompleted(String isCompleted)
|
public void setIsCompleted(String isCompleted)
|
||||||
{
|
{
|
||||||
this.isCompleted = isCompleted;
|
this.isCompleted = isCompleted;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getIsCompleted()
|
public String getIsCompleted()
|
||||||
{
|
{
|
||||||
return isCompleted;
|
return isCompleted;
|
||||||
}
|
}
|
||||||
public void setStatus(String status)
|
public void setStatus(String status)
|
||||||
{
|
{
|
||||||
this.status = status;
|
this.status = status;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getStatus()
|
public String getStatus()
|
||||||
{
|
{
|
||||||
return status;
|
return status;
|
||||||
}
|
}
|
||||||
public void setDelFlag(String delFlag)
|
public void setDelFlag(String delFlag)
|
||||||
{
|
{
|
||||||
this.delFlag = delFlag;
|
this.delFlag = delFlag;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getDelFlag()
|
public String getDelFlag()
|
||||||
{
|
{
|
||||||
return delFlag;
|
return delFlag;
|
||||||
}
|
}
|
||||||
@ -193,25 +200,25 @@ public class Garden extends BaseEntity
|
|||||||
@Override
|
@Override
|
||||||
public String toString() {
|
public String toString() {
|
||||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||||
.append("id", getId())
|
.append("id", getId())
|
||||||
.append("code", getCode())
|
.append("zoneId", getZoneId())
|
||||||
.append("zoneCode", getZoneCode())
|
.append("code", getCode())
|
||||||
.append("name", getName())
|
.append("name", getName())
|
||||||
.append("m2", getM2())
|
.append("m2", getM2())
|
||||||
.append("memberId", getMemberId())
|
.append("memberId", getMemberId())
|
||||||
.append("managerId", getManagerId())
|
.append("managerId", getManagerId())
|
||||||
.append("workerId", getWorkerId())
|
.append("workerId", getWorkerId())
|
||||||
.append("contacterId", getContacterId())
|
.append("contacterId", getContacterId())
|
||||||
.append("isFarming", getIsFarming())
|
.append("isFarming", getIsFarming())
|
||||||
.append("isSelled", getIsSelled())
|
.append("isSelled", getIsSelled())
|
||||||
.append("isCompleted", getIsCompleted())
|
.append("isCompleted", getIsCompleted())
|
||||||
.append("status", getStatus())
|
.append("status", getStatus())
|
||||||
.append("delFlag", getDelFlag())
|
.append("delFlag", getDelFlag())
|
||||||
.append("createBy", getCreateBy())
|
.append("createBy", getCreateBy())
|
||||||
.append("createTime", getCreateTime())
|
.append("createTime", getCreateTime())
|
||||||
.append("updateBy", getUpdateBy())
|
.append("updateBy", getUpdateBy())
|
||||||
.append("updateTime", getUpdateTime())
|
.append("updateTime", getUpdateTime())
|
||||||
.append("remark", getRemark())
|
.append("remark", getRemark())
|
||||||
.toString();
|
.toString();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -0,0 +1,61 @@
|
|||||||
|
package com.jlt.csa.mapper;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import com.jlt.csa.domain.FarmZone;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 农场分区Mapper接口
|
||||||
|
*
|
||||||
|
* @author 郏磊涛
|
||||||
|
* @date 2022-03-28
|
||||||
|
*/
|
||||||
|
public interface FarmZoneMapper
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* 查询农场分区
|
||||||
|
*
|
||||||
|
* @param id 农场分区主键
|
||||||
|
* @return 农场分区
|
||||||
|
*/
|
||||||
|
public FarmZone selectFarmZoneById(Long id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询农场分区列表
|
||||||
|
*
|
||||||
|
* @param farmZone 农场分区
|
||||||
|
* @return 农场分区集合
|
||||||
|
*/
|
||||||
|
public List<FarmZone> selectFarmZoneList(FarmZone farmZone);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增农场分区
|
||||||
|
*
|
||||||
|
* @param farmZone 农场分区
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int insertFarmZone(FarmZone farmZone);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改农场分区
|
||||||
|
*
|
||||||
|
* @param farmZone 农场分区
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int updateFarmZone(FarmZone farmZone);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除农场分区
|
||||||
|
*
|
||||||
|
* @param id 农场分区主键
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int deleteFarmZoneById(Long id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除农场分区
|
||||||
|
*
|
||||||
|
* @param ids 需要删除的数据主键集合
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int deleteFarmZoneByIds(Long[] ids);
|
||||||
|
}
|
@ -2,18 +2,19 @@ package com.jlt.csa.mapper;
|
|||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import com.jlt.csa.domain.Garden;
|
import com.jlt.csa.domain.Garden;
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 菜地划分Mapper接口
|
* 菜地划分Mapper接口
|
||||||
*
|
*
|
||||||
* @author 郏磊涛
|
* @author 郏磊涛
|
||||||
* @date 2022-03-24
|
* @date 2022-03-29
|
||||||
*/
|
*/
|
||||||
public interface GardenMapper
|
public interface GardenMapper
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* 查询菜地划分
|
* 查询菜地划分
|
||||||
*
|
*
|
||||||
* @param id 菜地划分主键
|
* @param id 菜地划分主键
|
||||||
* @return 菜地划分
|
* @return 菜地划分
|
||||||
*/
|
*/
|
||||||
@ -21,7 +22,7 @@ public interface GardenMapper
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询菜地划分列表
|
* 查询菜地划分列表
|
||||||
*
|
*
|
||||||
* @param garden 菜地划分
|
* @param garden 菜地划分
|
||||||
* @return 菜地划分集合
|
* @return 菜地划分集合
|
||||||
*/
|
*/
|
||||||
@ -29,7 +30,7 @@ public interface GardenMapper
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 新增菜地划分
|
* 新增菜地划分
|
||||||
*
|
*
|
||||||
* @param garden 菜地划分
|
* @param garden 菜地划分
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
@ -37,15 +38,24 @@ public interface GardenMapper
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 修改菜地划分
|
* 修改菜地划分
|
||||||
*
|
*
|
||||||
* @param garden 菜地划分
|
* @param garden 菜地划分
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
public int updateGarden(Garden garden);
|
public int updateGarden(Garden garden);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 更新多个菜地状态
|
||||||
|
*
|
||||||
|
* @param garden 菜地
|
||||||
|
* @param ids 菜地id集合
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int updateGardenStatus(@Param("garden") Garden garden, @Param("ids") Long[] ids);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 删除菜地划分
|
* 删除菜地划分
|
||||||
*
|
*
|
||||||
* @param id 菜地划分主键
|
* @param id 菜地划分主键
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
@ -53,7 +63,7 @@ public interface GardenMapper
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 批量删除菜地划分
|
* 批量删除菜地划分
|
||||||
*
|
*
|
||||||
* @param ids 需要删除的数据主键集合
|
* @param ids 需要删除的数据主键集合
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
|
@ -1,61 +0,0 @@
|
|||||||
package com.jlt.csa.mapper;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
import com.jlt.csa.domain.Zone;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 农场分区Mapper接口
|
|
||||||
*
|
|
||||||
* @author 郏磊涛
|
|
||||||
* @date 2022-03-27
|
|
||||||
*/
|
|
||||||
public interface ZoneMapper
|
|
||||||
{
|
|
||||||
/**
|
|
||||||
* 查询农场分区
|
|
||||||
*
|
|
||||||
* @param code 农场分区主键
|
|
||||||
* @return 农场分区
|
|
||||||
*/
|
|
||||||
public Zone selectZoneByCode(String code);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 查询农场分区列表
|
|
||||||
*
|
|
||||||
* @param zone 农场分区
|
|
||||||
* @return 农场分区集合
|
|
||||||
*/
|
|
||||||
public List<Zone> selectZoneList(Zone zone);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 新增农场分区
|
|
||||||
*
|
|
||||||
* @param zone 农场分区
|
|
||||||
* @return 结果
|
|
||||||
*/
|
|
||||||
public int insertZone(Zone zone);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 修改农场分区
|
|
||||||
*
|
|
||||||
* @param zone 农场分区
|
|
||||||
* @return 结果
|
|
||||||
*/
|
|
||||||
public int updateZone(Zone zone);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 删除农场分区
|
|
||||||
*
|
|
||||||
* @param code 农场分区主键
|
|
||||||
* @return 结果
|
|
||||||
*/
|
|
||||||
public int deleteZoneByCode(String code);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 批量删除农场分区
|
|
||||||
*
|
|
||||||
* @param codes 需要删除的数据主键集合
|
|
||||||
* @return 结果
|
|
||||||
*/
|
|
||||||
public int deleteZoneByCodes(String[] codes);
|
|
||||||
}
|
|
@ -1,96 +0,0 @@
|
|||||||
package com.jlt.csa.mapper.base;
|
|
||||||
|
|
||||||
import com.ruoyi.common.core.domain.entity.SysDictData;
|
|
||||||
import org.apache.ibatis.annotations.Param;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 字典表 数据层
|
|
||||||
*
|
|
||||||
* @author ruoyi
|
|
||||||
*/
|
|
||||||
public interface CsaDictDataMapper
|
|
||||||
{
|
|
||||||
/**
|
|
||||||
* 根据条件分页查询字典数据
|
|
||||||
*
|
|
||||||
* @param dictData 字典数据信息
|
|
||||||
* @return 字典数据集合信息
|
|
||||||
*/
|
|
||||||
public List<SysDictData> selectDictDataList(SysDictData dictData);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 根据字典类型查询字典数据
|
|
||||||
*
|
|
||||||
* @param dictType 字典类型
|
|
||||||
* @return 字典数据集合信息
|
|
||||||
*/
|
|
||||||
public List<SysDictData> selectDictDataByType(String dictType);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 根据字典类型和字典键值查询字典数据信息
|
|
||||||
*
|
|
||||||
* @param dictType 字典类型
|
|
||||||
* @param dictValue 字典键值
|
|
||||||
* @return 字典标签
|
|
||||||
*/
|
|
||||||
public String selectDictLabel(@Param("dictType") String dictType, @Param("dictValue") String dictValue);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 根据字典数据ID查询信息
|
|
||||||
*
|
|
||||||
* @param dictCode 字典数据ID
|
|
||||||
* @return 字典数据
|
|
||||||
*/
|
|
||||||
public SysDictData selectDictDataById(Long dictCode);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 查询字典数据
|
|
||||||
*
|
|
||||||
* @param dictType 字典类型
|
|
||||||
* @return 字典数据
|
|
||||||
*/
|
|
||||||
public int countDictDataByType(String dictType);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 通过字典ID删除字典数据信息
|
|
||||||
*
|
|
||||||
* @param dictCode 字典数据ID
|
|
||||||
* @return 结果
|
|
||||||
*/
|
|
||||||
public int deleteDictDataById(Long dictCode);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 批量删除字典数据信息
|
|
||||||
*
|
|
||||||
* @param dictCodes 需要删除的字典数据ID
|
|
||||||
* @return 结果
|
|
||||||
*/
|
|
||||||
public int deleteDictDataByIds(Long[] dictCodes);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 新增字典数据信息
|
|
||||||
*
|
|
||||||
* @param dictData 字典数据信息
|
|
||||||
* @return 结果
|
|
||||||
*/
|
|
||||||
public int insertDictData(SysDictData dictData);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 修改字典数据信息
|
|
||||||
*
|
|
||||||
* @param dictData 字典数据信息
|
|
||||||
* @return 结果
|
|
||||||
*/
|
|
||||||
public int updateDictData(SysDictData dictData);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 同步修改字典类型
|
|
||||||
*
|
|
||||||
* @param oldDictType 旧字典类型
|
|
||||||
* @param newDictType 新旧字典类型
|
|
||||||
* @return 结果
|
|
||||||
*/
|
|
||||||
public int updateDictDataType(@Param("oldDictType") String oldDictType, @Param("newDictType") String newDictType);
|
|
||||||
}
|
|
@ -1,86 +0,0 @@
|
|||||||
package com.jlt.csa.mapper.base;
|
|
||||||
|
|
||||||
import com.ruoyi.common.core.domain.entity.SysDictType;
|
|
||||||
import org.apache.ibatis.annotations.Mapper;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 字典表 数据层
|
|
||||||
*
|
|
||||||
* @author ruoyi
|
|
||||||
*/
|
|
||||||
@Mapper
|
|
||||||
public interface CsaDictTypeMapper
|
|
||||||
{
|
|
||||||
/**
|
|
||||||
* 根据条件分页查询字典类型
|
|
||||||
*
|
|
||||||
* @param dictType 字典类型信息
|
|
||||||
* @return 字典类型集合信息
|
|
||||||
*/
|
|
||||||
public List<SysDictType> selectDictTypeList(SysDictType dictType);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 根据所有字典类型
|
|
||||||
*
|
|
||||||
* @return 字典类型集合信息
|
|
||||||
*/
|
|
||||||
public List<SysDictType> selectDictTypeAll();
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 根据字典类型ID查询信息
|
|
||||||
*
|
|
||||||
* @param dictId 字典类型ID
|
|
||||||
* @return 字典类型
|
|
||||||
*/
|
|
||||||
public SysDictType selectDictTypeById(Long dictId);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 根据字典类型查询信息
|
|
||||||
*
|
|
||||||
* @param dictType 字典类型
|
|
||||||
* @return 字典类型
|
|
||||||
*/
|
|
||||||
public SysDictType selectDictTypeByType(String dictType);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 通过字典ID删除字典信息
|
|
||||||
*
|
|
||||||
* @param dictId 字典ID
|
|
||||||
* @return 结果
|
|
||||||
*/
|
|
||||||
public int deleteDictTypeById(Long dictId);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 批量删除字典类型信息
|
|
||||||
*
|
|
||||||
* @param dictIds 需要删除的字典ID
|
|
||||||
* @return 结果
|
|
||||||
*/
|
|
||||||
public int deleteDictTypeByIds(Long[] dictIds);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 新增字典类型信息
|
|
||||||
*
|
|
||||||
* @param dictType 字典类型信息
|
|
||||||
* @return 结果
|
|
||||||
*/
|
|
||||||
public int insertDictType(SysDictType dictType);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 修改字典类型信息
|
|
||||||
*
|
|
||||||
* @param dictType 字典类型信息
|
|
||||||
* @return 结果
|
|
||||||
*/
|
|
||||||
public int updateDictType(SysDictType dictType);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 校验字典类型称是否唯一
|
|
||||||
*
|
|
||||||
* @param dictType 字典类型
|
|
||||||
* @return 结果
|
|
||||||
*/
|
|
||||||
public SysDictType checkDictTypeUnique(String dictType);
|
|
||||||
}
|
|
@ -0,0 +1,61 @@
|
|||||||
|
package com.jlt.csa.service;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import com.jlt.csa.domain.FarmZone;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 农场分区Service接口
|
||||||
|
*
|
||||||
|
* @author 郏磊涛
|
||||||
|
* @date 2022-03-28
|
||||||
|
*/
|
||||||
|
public interface IFarmZoneService
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* 查询农场分区
|
||||||
|
*
|
||||||
|
* @param id 农场分区主键
|
||||||
|
* @return 农场分区
|
||||||
|
*/
|
||||||
|
public FarmZone selectFarmZoneById(Long id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询农场分区列表
|
||||||
|
*
|
||||||
|
* @param farmZone 农场分区
|
||||||
|
* @return 农场分区集合
|
||||||
|
*/
|
||||||
|
public List<FarmZone> selectFarmZoneList(FarmZone farmZone);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增农场分区
|
||||||
|
*
|
||||||
|
* @param farmZone 农场分区
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int insertFarmZone(FarmZone farmZone);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改农场分区
|
||||||
|
*
|
||||||
|
* @param farmZone 农场分区
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int updateFarmZone(FarmZone farmZone);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除农场分区
|
||||||
|
*
|
||||||
|
* @param ids 需要删除的农场分区主键集合
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int deleteFarmZoneByIds(Long[] ids);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除农场分区信息
|
||||||
|
*
|
||||||
|
* @param id 农场分区主键
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int deleteFarmZoneById(Long id);
|
||||||
|
}
|
@ -5,15 +5,15 @@ import com.jlt.csa.domain.Garden;
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 菜地划分Service接口
|
* 菜地划分Service接口
|
||||||
*
|
*
|
||||||
* @author 郏磊涛
|
* @author 郏磊涛
|
||||||
* @date 2022-03-24
|
* @date 2022-03-29
|
||||||
*/
|
*/
|
||||||
public interface IGardenService
|
public interface IGardenService
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* 查询菜地划分
|
* 查询菜地划分
|
||||||
*
|
*
|
||||||
* @param id 菜地划分主键
|
* @param id 菜地划分主键
|
||||||
* @return 菜地划分
|
* @return 菜地划分
|
||||||
*/
|
*/
|
||||||
@ -21,7 +21,7 @@ public interface IGardenService
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询菜地划分列表
|
* 查询菜地划分列表
|
||||||
*
|
*
|
||||||
* @param garden 菜地划分
|
* @param garden 菜地划分
|
||||||
* @return 菜地划分集合
|
* @return 菜地划分集合
|
||||||
*/
|
*/
|
||||||
@ -29,23 +29,32 @@ public interface IGardenService
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 新增菜地划分
|
* 新增菜地划分
|
||||||
*
|
*
|
||||||
* @param garden 菜地划分
|
* @param garden 菜地划分
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
public int insertGarden(Garden garden);
|
public int insertGarden(Garden garden);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 修改菜地划分
|
* 修改菜地
|
||||||
*
|
*
|
||||||
* @param garden 菜地划分
|
* @param garden 菜地
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
public int updateGarden(Garden garden);
|
public int updateGarden(Garden garden);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量修改菜地状态
|
||||||
|
*
|
||||||
|
* @param garden 菜地划分
|
||||||
|
* @param ids 需要更改的菜地id集合
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int updateGardenStatus(Garden garden, Long[] ids);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 批量删除菜地划分
|
* 批量删除菜地划分
|
||||||
*
|
*
|
||||||
* @param ids 需要删除的菜地划分主键集合
|
* @param ids 需要删除的菜地划分主键集合
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
@ -53,7 +62,7 @@ public interface IGardenService
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 删除菜地划分信息
|
* 删除菜地划分信息
|
||||||
*
|
*
|
||||||
* @param id 菜地划分主键
|
* @param id 菜地划分主键
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
|
@ -1,61 +0,0 @@
|
|||||||
package com.jlt.csa.service;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
import com.jlt.csa.domain.Zone;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 农场分区Service接口
|
|
||||||
*
|
|
||||||
* @author 郏磊涛
|
|
||||||
* @date 2022-03-27
|
|
||||||
*/
|
|
||||||
public interface IZoneService
|
|
||||||
{
|
|
||||||
/**
|
|
||||||
* 查询农场分区
|
|
||||||
*
|
|
||||||
* @param code 农场分区主键
|
|
||||||
* @return 农场分区
|
|
||||||
*/
|
|
||||||
public Zone selectZoneByCode(String code);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 查询农场分区列表
|
|
||||||
*
|
|
||||||
* @param zone 农场分区
|
|
||||||
* @return 农场分区集合
|
|
||||||
*/
|
|
||||||
public List<Zone> selectZoneList(Zone zone);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 新增农场分区
|
|
||||||
*
|
|
||||||
* @param zone 农场分区
|
|
||||||
* @return 结果
|
|
||||||
*/
|
|
||||||
public int insertZone(Zone zone);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 修改农场分区
|
|
||||||
*
|
|
||||||
* @param zone 农场分区
|
|
||||||
* @return 结果
|
|
||||||
*/
|
|
||||||
public int updateZone(Zone zone);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 批量删除农场分区
|
|
||||||
*
|
|
||||||
* @param codes 需要删除的农场分区主键集合
|
|
||||||
* @return 结果
|
|
||||||
*/
|
|
||||||
public int deleteZoneByCodes(String[] codes);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 删除农场分区信息
|
|
||||||
*
|
|
||||||
* @param code 农场分区主键
|
|
||||||
* @return 结果
|
|
||||||
*/
|
|
||||||
public int deleteZoneByCode(String code);
|
|
||||||
}
|
|
@ -1,61 +0,0 @@
|
|||||||
package com.jlt.csa.service.base;
|
|
||||||
|
|
||||||
import com.ruoyi.common.core.domain.entity.SysDictData;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 字典 业务层
|
|
||||||
*
|
|
||||||
* @author ruoyi
|
|
||||||
*/
|
|
||||||
public interface ICsaDictDataService
|
|
||||||
{
|
|
||||||
/**
|
|
||||||
* 根据条件分页查询字典数据
|
|
||||||
*
|
|
||||||
* @param dictData 字典数据信息
|
|
||||||
* @return 字典数据集合信息
|
|
||||||
*/
|
|
||||||
public List<SysDictData> selectDictDataList(SysDictData dictData);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 根据字典类型和字典键值查询字典数据信息
|
|
||||||
*
|
|
||||||
* @param dictType 字典类型
|
|
||||||
* @param dictValue 字典键值
|
|
||||||
* @return 字典标签
|
|
||||||
*/
|
|
||||||
public String selectDictLabel(String dictType, String dictValue);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 根据字典数据ID查询信息
|
|
||||||
*
|
|
||||||
* @param dictCode 字典数据ID
|
|
||||||
* @return 字典数据
|
|
||||||
*/
|
|
||||||
public SysDictData selectDictDataById(Long dictCode);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 批量删除字典数据信息
|
|
||||||
*
|
|
||||||
* @param dictCodes 需要删除的字典数据ID
|
|
||||||
*/
|
|
||||||
public void deleteDictDataByIds(Long[] dictCodes);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 新增保存字典数据信息
|
|
||||||
*
|
|
||||||
* @param dictData 字典数据信息
|
|
||||||
* @return 结果
|
|
||||||
*/
|
|
||||||
public int insertDictData(SysDictData dictData);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 修改保存字典数据信息
|
|
||||||
*
|
|
||||||
* @param dictData 字典数据信息
|
|
||||||
* @return 结果
|
|
||||||
*/
|
|
||||||
public int updateDictData(SysDictData dictData);
|
|
||||||
}
|
|
@ -1,99 +0,0 @@
|
|||||||
package com.jlt.csa.service.base;
|
|
||||||
|
|
||||||
import com.ruoyi.common.core.domain.entity.SysDictData;
|
|
||||||
import com.ruoyi.common.core.domain.entity.SysDictType;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 字典 业务层
|
|
||||||
*
|
|
||||||
* @author ruoyi
|
|
||||||
*/
|
|
||||||
public interface ICsaDictTypeService
|
|
||||||
{
|
|
||||||
/**
|
|
||||||
* 根据条件分页查询字典类型
|
|
||||||
*
|
|
||||||
* @param dictType 字典类型信息
|
|
||||||
* @return 字典类型集合信息
|
|
||||||
*/
|
|
||||||
public List<SysDictType> selectDictTypeList(SysDictType dictType);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 根据所有字典类型
|
|
||||||
*
|
|
||||||
* @return 字典类型集合信息
|
|
||||||
*/
|
|
||||||
public List<SysDictType> selectDictTypeAll();
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 根据字典类型查询字典数据
|
|
||||||
*
|
|
||||||
* @param dictType 字典类型
|
|
||||||
* @return 字典数据集合信息
|
|
||||||
*/
|
|
||||||
public List<SysDictData> selectDictDataByType(String dictType);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 根据字典类型ID查询信息
|
|
||||||
*
|
|
||||||
* @param dictId 字典类型ID
|
|
||||||
* @return 字典类型
|
|
||||||
*/
|
|
||||||
public SysDictType selectDictTypeById(Long dictId);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 根据字典类型查询信息
|
|
||||||
*
|
|
||||||
* @param dictType 字典类型
|
|
||||||
* @return 字典类型
|
|
||||||
*/
|
|
||||||
public SysDictType selectDictTypeByType(String dictType);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 批量删除字典信息
|
|
||||||
*
|
|
||||||
* @param dictIds 需要删除的字典ID
|
|
||||||
*/
|
|
||||||
public void deleteDictTypeByIds(Long[] dictIds);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 加载字典缓存数据
|
|
||||||
*/
|
|
||||||
public void loadingDictCache();
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 清空字典缓存数据
|
|
||||||
*/
|
|
||||||
public void clearDictCache();
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 重置字典缓存数据
|
|
||||||
*/
|
|
||||||
public void resetDictCache();
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 新增保存字典类型信息
|
|
||||||
*
|
|
||||||
* @param dictType 字典类型信息
|
|
||||||
* @return 结果
|
|
||||||
*/
|
|
||||||
public int insertDictType(SysDictType dictType);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 修改保存字典类型信息
|
|
||||||
*
|
|
||||||
* @param dictType 字典类型信息
|
|
||||||
* @return 结果
|
|
||||||
*/
|
|
||||||
public int updateDictType(SysDictType dictType);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 校验字典类型称是否唯一
|
|
||||||
*
|
|
||||||
* @param dictType 字典类型
|
|
||||||
* @return 结果
|
|
||||||
*/
|
|
||||||
public String checkDictTypeUnique(SysDictType dictType);
|
|
||||||
}
|
|
@ -0,0 +1,96 @@
|
|||||||
|
package com.jlt.csa.service.impl;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import com.ruoyi.common.utils.DateUtils;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import com.jlt.csa.mapper.FarmZoneMapper;
|
||||||
|
import com.jlt.csa.domain.FarmZone;
|
||||||
|
import com.jlt.csa.service.IFarmZoneService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 农场分区Service业务层处理
|
||||||
|
*
|
||||||
|
* @author 郏磊涛
|
||||||
|
* @date 2022-03-28
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
public class FarmZoneServiceImpl implements IFarmZoneService
|
||||||
|
{
|
||||||
|
@Autowired
|
||||||
|
private FarmZoneMapper farmZoneMapper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询农场分区
|
||||||
|
*
|
||||||
|
* @param id 农场分区主键
|
||||||
|
* @return 农场分区
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public FarmZone selectFarmZoneById(Long id)
|
||||||
|
{
|
||||||
|
return farmZoneMapper.selectFarmZoneById(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询农场分区列表
|
||||||
|
*
|
||||||
|
* @param farmZone 农场分区
|
||||||
|
* @return 农场分区
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public List<FarmZone> selectFarmZoneList(FarmZone farmZone)
|
||||||
|
{
|
||||||
|
return farmZoneMapper.selectFarmZoneList(farmZone);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增农场分区
|
||||||
|
*
|
||||||
|
* @param farmZone 农场分区
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int insertFarmZone(FarmZone farmZone)
|
||||||
|
{
|
||||||
|
farmZone.setCreateTime(DateUtils.getNowDate());
|
||||||
|
return farmZoneMapper.insertFarmZone(farmZone);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改农场分区
|
||||||
|
*
|
||||||
|
* @param farmZone 农场分区
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int updateFarmZone(FarmZone farmZone)
|
||||||
|
{
|
||||||
|
farmZone.setUpdateTime(DateUtils.getNowDate());
|
||||||
|
return farmZoneMapper.updateFarmZone(farmZone);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除农场分区
|
||||||
|
*
|
||||||
|
* @param ids 需要删除的农场分区主键
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int deleteFarmZoneByIds(Long[] ids)
|
||||||
|
{
|
||||||
|
return farmZoneMapper.deleteFarmZoneByIds(ids);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除农场分区信息
|
||||||
|
*
|
||||||
|
* @param id 农场分区主键
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int deleteFarmZoneById(Long id)
|
||||||
|
{
|
||||||
|
return farmZoneMapper.deleteFarmZoneById(id);
|
||||||
|
}
|
||||||
|
}
|
@ -10,19 +10,19 @@ import com.jlt.csa.service.IGardenService;
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 菜地划分Service业务层处理
|
* 菜地划分Service业务层处理
|
||||||
*
|
*
|
||||||
* @author 郏磊涛
|
* @author 郏磊涛
|
||||||
* @date 2022-03-24
|
* @date 2022-03-29
|
||||||
*/
|
*/
|
||||||
@Service
|
@Service
|
||||||
public class GardenServiceImpl implements IGardenService
|
public class GardenServiceImpl implements IGardenService
|
||||||
{
|
{
|
||||||
@Autowired
|
@Autowired
|
||||||
private GardenMapper gardenMapper;
|
private GardenMapper gardenMapper;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询菜地划分
|
* 查询菜地划分
|
||||||
*
|
*
|
||||||
* @param id 菜地划分主键
|
* @param id 菜地划分主键
|
||||||
* @return 菜地划分
|
* @return 菜地划分
|
||||||
*/
|
*/
|
||||||
@ -34,7 +34,7 @@ public class GardenServiceImpl implements IGardenService
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询菜地划分列表
|
* 查询菜地划分列表
|
||||||
*
|
*
|
||||||
* @param garden 菜地划分
|
* @param garden 菜地划分
|
||||||
* @return 菜地划分
|
* @return 菜地划分
|
||||||
*/
|
*/
|
||||||
@ -46,7 +46,7 @@ public class GardenServiceImpl implements IGardenService
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 新增菜地划分
|
* 新增菜地划分
|
||||||
*
|
*
|
||||||
* @param garden 菜地划分
|
* @param garden 菜地划分
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
@ -59,7 +59,7 @@ public class GardenServiceImpl implements IGardenService
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 修改菜地划分
|
* 修改菜地划分
|
||||||
*
|
*
|
||||||
* @param garden 菜地划分
|
* @param garden 菜地划分
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
@ -70,9 +70,21 @@ public class GardenServiceImpl implements IGardenService
|
|||||||
return gardenMapper.updateGarden(garden);
|
return gardenMapper.updateGarden(garden);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量修改菜地状态
|
||||||
|
*
|
||||||
|
* @param garden 菜地划分
|
||||||
|
* @param ids 需要更改的菜地id集合
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int updateGardenStatus(Garden garden, Long[] ids) {
|
||||||
|
garden.setUpdateTime(DateUtils.getNowDate());
|
||||||
|
return gardenMapper.updateGardenStatus(garden, ids);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 批量删除菜地划分
|
* 批量删除菜地划分
|
||||||
*
|
*
|
||||||
* @param ids 需要删除的菜地划分主键
|
* @param ids 需要删除的菜地划分主键
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
@ -84,7 +96,7 @@ public class GardenServiceImpl implements IGardenService
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 删除菜地划分信息
|
* 删除菜地划分信息
|
||||||
*
|
*
|
||||||
* @param id 菜地划分主键
|
* @param id 菜地划分主键
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
|
@ -1,96 +0,0 @@
|
|||||||
package com.jlt.csa.service.impl;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
import com.ruoyi.common.utils.DateUtils;
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
|
||||||
import org.springframework.stereotype.Service;
|
|
||||||
import com.jlt.csa.mapper.ZoneMapper;
|
|
||||||
import com.jlt.csa.domain.Zone;
|
|
||||||
import com.jlt.csa.service.IZoneService;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 农场分区Service业务层处理
|
|
||||||
*
|
|
||||||
* @author 郏磊涛
|
|
||||||
* @date 2022-03-27
|
|
||||||
*/
|
|
||||||
@Service
|
|
||||||
public class ZoneServiceImpl implements IZoneService
|
|
||||||
{
|
|
||||||
@Autowired
|
|
||||||
private ZoneMapper zoneMapper;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 查询农场分区
|
|
||||||
*
|
|
||||||
* @param code 农场分区主键
|
|
||||||
* @return 农场分区
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public Zone selectZoneByCode(String code)
|
|
||||||
{
|
|
||||||
return zoneMapper.selectZoneByCode(code);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 查询农场分区列表
|
|
||||||
*
|
|
||||||
* @param zone 农场分区
|
|
||||||
* @return 农场分区
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public List<Zone> selectZoneList(Zone zone)
|
|
||||||
{
|
|
||||||
return zoneMapper.selectZoneList(zone);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 新增农场分区
|
|
||||||
*
|
|
||||||
* @param zone 农场分区
|
|
||||||
* @return 结果
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public int insertZone(Zone zone)
|
|
||||||
{
|
|
||||||
zone.setCreateTime(DateUtils.getNowDate());
|
|
||||||
return zoneMapper.insertZone(zone);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 修改农场分区
|
|
||||||
*
|
|
||||||
* @param zone 农场分区
|
|
||||||
* @return 结果
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public int updateZone(Zone zone)
|
|
||||||
{
|
|
||||||
zone.setUpdateTime(DateUtils.getNowDate());
|
|
||||||
return zoneMapper.updateZone(zone);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 批量删除农场分区
|
|
||||||
*
|
|
||||||
* @param codes 需要删除的农场分区主键
|
|
||||||
* @return 结果
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public int deleteZoneByCodes(String[] codes)
|
|
||||||
{
|
|
||||||
return zoneMapper.deleteZoneByCodes(codes);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 删除农场分区信息
|
|
||||||
*
|
|
||||||
* @param code 农场分区主键
|
|
||||||
* @return 结果
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public int deleteZoneByCode(String code)
|
|
||||||
{
|
|
||||||
return zoneMapper.deleteZoneByCode(code);
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,112 +0,0 @@
|
|||||||
package com.jlt.csa.service.impl.base;
|
|
||||||
|
|
||||||
import com.jlt.csa.mapper.base.CsaDictDataMapper;
|
|
||||||
import com.jlt.csa.service.base.ICsaDictDataService;
|
|
||||||
import com.ruoyi.common.core.domain.entity.SysDictData;
|
|
||||||
import com.ruoyi.common.utils.DictUtils;
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
|
||||||
import org.springframework.stereotype.Service;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 字典 业务层处理
|
|
||||||
*
|
|
||||||
* @author ruoyi
|
|
||||||
*/
|
|
||||||
@Service
|
|
||||||
public class CsaDictDataServiceImpl implements ICsaDictDataService
|
|
||||||
{
|
|
||||||
@Autowired
|
|
||||||
private CsaDictDataMapper dictDataMapper;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 根据条件分页查询字典数据
|
|
||||||
*
|
|
||||||
* @param dictData 字典数据信息
|
|
||||||
* @return 字典数据集合信息
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public List<SysDictData> selectDictDataList(SysDictData dictData)
|
|
||||||
{
|
|
||||||
return dictDataMapper.selectDictDataList(dictData);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 根据字典类型和字典键值查询字典数据信息
|
|
||||||
*
|
|
||||||
* @param dictType 字典类型
|
|
||||||
* @param dictValue 字典键值
|
|
||||||
* @return 字典标签
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public String selectDictLabel(String dictType, String dictValue)
|
|
||||||
{
|
|
||||||
return dictDataMapper.selectDictLabel(dictType, dictValue);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 根据字典数据ID查询信息
|
|
||||||
*
|
|
||||||
* @param dictCode 字典数据ID
|
|
||||||
* @return 字典数据
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public SysDictData selectDictDataById(Long dictCode)
|
|
||||||
{
|
|
||||||
return dictDataMapper.selectDictDataById(dictCode);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 批量删除字典数据信息
|
|
||||||
*
|
|
||||||
* @param dictCodes 需要删除的字典数据ID
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public void deleteDictDataByIds(Long[] dictCodes)
|
|
||||||
{
|
|
||||||
for (Long dictCode : dictCodes)
|
|
||||||
{
|
|
||||||
SysDictData data = selectDictDataById(dictCode);
|
|
||||||
dictDataMapper.deleteDictDataById(dictCode);
|
|
||||||
List<SysDictData> dictDatas = dictDataMapper.selectDictDataByType(data.getDictType());
|
|
||||||
DictUtils.setDictCache(data.getDictType(), dictDatas);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 新增保存字典数据信息
|
|
||||||
*
|
|
||||||
* @param data 字典数据信息
|
|
||||||
* @return 结果
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public int insertDictData(SysDictData data)
|
|
||||||
{
|
|
||||||
int row = dictDataMapper.insertDictData(data);
|
|
||||||
if (row > 0)
|
|
||||||
{
|
|
||||||
List<SysDictData> dictDatas = dictDataMapper.selectDictDataByType(data.getDictType());
|
|
||||||
DictUtils.setDictCache(data.getDictType(), dictDatas);
|
|
||||||
}
|
|
||||||
return row;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 修改保存字典数据信息
|
|
||||||
*
|
|
||||||
* @param data 字典数据信息
|
|
||||||
* @return 结果
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public int updateDictData(SysDictData data)
|
|
||||||
{
|
|
||||||
int row = dictDataMapper.updateDictData(data);
|
|
||||||
if (row > 0)
|
|
||||||
{
|
|
||||||
List<SysDictData> dictDatas = dictDataMapper.selectDictDataByType(data.getDictType());
|
|
||||||
DictUtils.setDictCache(data.getDictType(), dictDatas);
|
|
||||||
}
|
|
||||||
return row;
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,224 +0,0 @@
|
|||||||
package com.jlt.csa.service.impl.base;
|
|
||||||
|
|
||||||
import com.jlt.csa.mapper.base.CsaDictDataMapper;
|
|
||||||
import com.jlt.csa.mapper.base.CsaDictTypeMapper;
|
|
||||||
import com.jlt.csa.service.base.ICsaDictTypeService;
|
|
||||||
import com.ruoyi.common.constant.UserConstants;
|
|
||||||
import com.ruoyi.common.core.domain.entity.SysDictData;
|
|
||||||
import com.ruoyi.common.core.domain.entity.SysDictType;
|
|
||||||
import com.ruoyi.common.exception.ServiceException;
|
|
||||||
import com.ruoyi.common.utils.DictUtils;
|
|
||||||
import com.ruoyi.common.utils.StringUtils;
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
|
||||||
import org.springframework.stereotype.Service;
|
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
|
||||||
|
|
||||||
import javax.annotation.PostConstruct;
|
|
||||||
import java.util.Comparator;
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.Map;
|
|
||||||
import java.util.stream.Collectors;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 字典 业务层处理
|
|
||||||
*
|
|
||||||
* @author ruoyi
|
|
||||||
*/
|
|
||||||
@Service
|
|
||||||
public class CsaDictTypeServiceImpl implements ICsaDictTypeService
|
|
||||||
{
|
|
||||||
@Autowired
|
|
||||||
private CsaDictTypeMapper dictTypeMapper;
|
|
||||||
|
|
||||||
@Autowired
|
|
||||||
private CsaDictDataMapper dictDataMapper;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 项目启动时,初始化字典到缓存
|
|
||||||
*/
|
|
||||||
@PostConstruct
|
|
||||||
public void init()
|
|
||||||
{
|
|
||||||
loadingDictCache();
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 根据条件分页查询字典类型
|
|
||||||
*
|
|
||||||
* @param dictType 字典类型信息
|
|
||||||
* @return 字典类型集合信息
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public List<SysDictType> selectDictTypeList(SysDictType dictType)
|
|
||||||
{
|
|
||||||
return dictTypeMapper.selectDictTypeList(dictType);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 根据所有字典类型
|
|
||||||
*
|
|
||||||
* @return 字典类型集合信息
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public List<SysDictType> selectDictTypeAll()
|
|
||||||
{
|
|
||||||
return dictTypeMapper.selectDictTypeAll();
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 根据字典类型查询字典数据
|
|
||||||
*
|
|
||||||
* @param dictType 字典类型
|
|
||||||
* @return 字典数据集合信息
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public List<SysDictData> selectDictDataByType(String dictType)
|
|
||||||
{
|
|
||||||
List<SysDictData> dictDatas = DictUtils.getDictCache(dictType);
|
|
||||||
if (StringUtils.isNotEmpty(dictDatas))
|
|
||||||
{
|
|
||||||
return dictDatas;
|
|
||||||
}
|
|
||||||
dictDatas = dictDataMapper.selectDictDataByType(dictType);
|
|
||||||
if (StringUtils.isNotEmpty(dictDatas))
|
|
||||||
{
|
|
||||||
DictUtils.setDictCache(dictType, dictDatas);
|
|
||||||
return dictDatas;
|
|
||||||
}
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 根据字典类型ID查询信息
|
|
||||||
*
|
|
||||||
* @param dictId 字典类型ID
|
|
||||||
* @return 字典类型
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public SysDictType selectDictTypeById(Long dictId)
|
|
||||||
{
|
|
||||||
return dictTypeMapper.selectDictTypeById(dictId);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 根据字典类型查询信息
|
|
||||||
*
|
|
||||||
* @param dictType 字典类型
|
|
||||||
* @return 字典类型
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public SysDictType selectDictTypeByType(String dictType)
|
|
||||||
{
|
|
||||||
return dictTypeMapper.selectDictTypeByType(dictType);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 批量删除字典类型信息
|
|
||||||
*
|
|
||||||
* @param dictIds 需要删除的字典ID
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public void deleteDictTypeByIds(Long[] dictIds)
|
|
||||||
{
|
|
||||||
for (Long dictId : dictIds)
|
|
||||||
{
|
|
||||||
SysDictType dictType = selectDictTypeById(dictId);
|
|
||||||
if (dictDataMapper.countDictDataByType(dictType.getDictType()) > 0)
|
|
||||||
{
|
|
||||||
throw new ServiceException(String.format("%1$s已分配,不能删除", dictType.getDictName()));
|
|
||||||
}
|
|
||||||
dictTypeMapper.deleteDictTypeById(dictId);
|
|
||||||
DictUtils.removeDictCache(dictType.getDictType());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 加载字典缓存数据
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public void loadingDictCache()
|
|
||||||
{
|
|
||||||
SysDictData dictData = new SysDictData();
|
|
||||||
dictData.setStatus("0");
|
|
||||||
Map<String, List<SysDictData>> dictDataMap = dictDataMapper.selectDictDataList(dictData).stream().collect(Collectors.groupingBy(SysDictData::getDictType));
|
|
||||||
for (Map.Entry<String, List<SysDictData>> entry : dictDataMap.entrySet())
|
|
||||||
{
|
|
||||||
DictUtils.setDictCache(entry.getKey(), entry.getValue().stream().sorted(Comparator.comparing(SysDictData::getDictSort)).collect(Collectors.toList()));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 清空字典缓存数据
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public void clearDictCache()
|
|
||||||
{
|
|
||||||
DictUtils.clearDictCache();
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 重置字典缓存数据
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public void resetDictCache()
|
|
||||||
{
|
|
||||||
clearDictCache();
|
|
||||||
loadingDictCache();
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 新增保存字典类型信息
|
|
||||||
*
|
|
||||||
* @param dict 字典类型信息
|
|
||||||
* @return 结果
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public int insertDictType(SysDictType dict)
|
|
||||||
{
|
|
||||||
int row = dictTypeMapper.insertDictType(dict);
|
|
||||||
if (row > 0)
|
|
||||||
{
|
|
||||||
DictUtils.setDictCache(dict.getDictType(), null);
|
|
||||||
}
|
|
||||||
return row;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 修改保存字典类型信息
|
|
||||||
*
|
|
||||||
* @param dict 字典类型信息
|
|
||||||
* @return 结果
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
@Transactional
|
|
||||||
public int updateDictType(SysDictType dict)
|
|
||||||
{
|
|
||||||
SysDictType oldDict = dictTypeMapper.selectDictTypeById(dict.getDictId());
|
|
||||||
dictDataMapper.updateDictDataType(oldDict.getDictType(), dict.getDictType());
|
|
||||||
int row = dictTypeMapper.updateDictType(dict);
|
|
||||||
if (row > 0)
|
|
||||||
{
|
|
||||||
List<SysDictData> dictDatas = dictDataMapper.selectDictDataByType(dict.getDictType());
|
|
||||||
DictUtils.setDictCache(dict.getDictType(), dictDatas);
|
|
||||||
}
|
|
||||||
return row;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 校验字典类型称是否唯一
|
|
||||||
*
|
|
||||||
* @param dict 字典类型
|
|
||||||
* @return 结果
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public String checkDictTypeUnique(SysDictType dict)
|
|
||||||
{
|
|
||||||
Long dictId = StringUtils.isNull(dict.getDictId()) ? -1L : dict.getDictId();
|
|
||||||
SysDictType dictType = dictTypeMapper.checkDictTypeUnique(dict.getDictType());
|
|
||||||
if (StringUtils.isNotNull(dictType) && dictType.getDictId().longValue() != dictId.longValue())
|
|
||||||
{
|
|
||||||
return UserConstants.NOT_UNIQUE;
|
|
||||||
}
|
|
||||||
return UserConstants.UNIQUE;
|
|
||||||
}
|
|
||||||
}
|
|
@ -2,10 +2,10 @@
|
|||||||
<!DOCTYPE mapper
|
<!DOCTYPE mapper
|
||||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
<mapper namespace="com.jlt.csa.mapper.ZoneMapper">
|
<mapper namespace="com.jlt.csa.mapper.FarmZoneMapper">
|
||||||
|
|
||||||
<resultMap type="Zone" id="ZoneResult">
|
<resultMap type="FarmZone" id="FarmZoneResult">
|
||||||
<result property="code" column="code" />
|
<result property="id" column="id" />
|
||||||
<result property="type" column="type" />
|
<result property="type" column="type" />
|
||||||
<result property="name" column="name" />
|
<result property="name" column="name" />
|
||||||
<result property="status" column="status" />
|
<result property="status" column="status" />
|
||||||
@ -17,28 +17,27 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
<result property="remark" column="remark" />
|
<result property="remark" column="remark" />
|
||||||
</resultMap>
|
</resultMap>
|
||||||
|
|
||||||
<sql id="selectZoneVo">
|
<sql id="selectFarmZoneVo">
|
||||||
select code, type, name, status, del_flag, create_by, create_time, update_by, update_time, remark from csa_zone
|
select id, type, name, status, del_flag, create_by, create_time, update_by, update_time, remark from csa_farm_zone
|
||||||
</sql>
|
</sql>
|
||||||
|
|
||||||
<select id="selectZoneList" parameterType="Zone" resultMap="ZoneResult">
|
<select id="selectFarmZoneList" parameterType="FarmZone" resultMap="FarmZoneResult">
|
||||||
<include refid="selectZoneVo"/>
|
<include refid="selectFarmZoneVo"/>
|
||||||
<where>
|
<where>
|
||||||
<if test="type != null and type != ''"> and type = #{type}</if>
|
<if test="type != null and type != ''"> and type = #{type}</if>
|
||||||
<if test="name != null and name != ''"> and name = #{name}</if>
|
<if test="name != null and name != ''"> and name = #{name}</if>
|
||||||
<if test="status != null and status != ''"> and status = #{status}</if>
|
<if test="status != null and status != ''"> and status = #{status}</if>
|
||||||
</where>
|
</where>
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="selectZoneByCode" parameterType="String" resultMap="ZoneResult">
|
<select id="selectFarmZoneById" parameterType="Long" resultMap="FarmZoneResult">
|
||||||
<include refid="selectZoneVo"/>
|
<include refid="selectFarmZoneVo"/>
|
||||||
where code = #{code}
|
where id = #{id}
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<insert id="insertZone" parameterType="Zone">
|
<insert id="insertFarmZone" parameterType="FarmZone" useGeneratedKeys="true" keyProperty="id">
|
||||||
insert into csa_zone
|
insert into csa_farm_zone
|
||||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||||
<if test="code != null">code,</if>
|
|
||||||
<if test="type != null and type != ''">type,</if>
|
<if test="type != null and type != ''">type,</if>
|
||||||
<if test="name != null and name != ''">name,</if>
|
<if test="name != null and name != ''">name,</if>
|
||||||
<if test="status != null">status,</if>
|
<if test="status != null">status,</if>
|
||||||
@ -50,7 +49,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
<if test="remark != null">remark,</if>
|
<if test="remark != null">remark,</if>
|
||||||
</trim>
|
</trim>
|
||||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||||
<if test="code != null">#{code},</if>
|
|
||||||
<if test="type != null and type != ''">#{type},</if>
|
<if test="type != null and type != ''">#{type},</if>
|
||||||
<if test="name != null and name != ''">#{name},</if>
|
<if test="name != null and name != ''">#{name},</if>
|
||||||
<if test="status != null">#{status},</if>
|
<if test="status != null">#{status},</if>
|
||||||
@ -63,8 +61,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
</trim>
|
</trim>
|
||||||
</insert>
|
</insert>
|
||||||
|
|
||||||
<update id="updateZone" parameterType="Zone">
|
<update id="updateFarmZone" parameterType="FarmZone">
|
||||||
update csa_zone
|
update csa_farm_zone
|
||||||
<trim prefix="SET" suffixOverrides=",">
|
<trim prefix="SET" suffixOverrides=",">
|
||||||
<if test="type != null and type != ''">type = #{type},</if>
|
<if test="type != null and type != ''">type = #{type},</if>
|
||||||
<if test="name != null and name != ''">name = #{name},</if>
|
<if test="name != null and name != ''">name = #{name},</if>
|
||||||
@ -76,17 +74,17 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
<if test="updateTime != null">update_time = #{updateTime},</if>
|
<if test="updateTime != null">update_time = #{updateTime},</if>
|
||||||
<if test="remark != null">remark = #{remark},</if>
|
<if test="remark != null">remark = #{remark},</if>
|
||||||
</trim>
|
</trim>
|
||||||
where code = #{code}
|
where id = #{id}
|
||||||
</update>
|
</update>
|
||||||
|
|
||||||
<delete id="deleteZoneByCode" parameterType="String">
|
<delete id="deleteFarmZoneById" parameterType="Long">
|
||||||
delete from csa_zone where code = #{code}
|
delete from csa_farm_zone where id = #{id}
|
||||||
</delete>
|
</delete>
|
||||||
|
|
||||||
<delete id="deleteZoneByCodes" parameterType="String">
|
<delete id="deleteFarmZoneByIds" parameterType="String">
|
||||||
delete from csa_zone where code in
|
delete from csa_farm_zone where id in
|
||||||
<foreach item="code" collection="array" open="(" separator="," close=")">
|
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||||
#{code}
|
#{id}
|
||||||
</foreach>
|
</foreach>
|
||||||
</delete>
|
</delete>
|
||||||
</mapper>
|
</mapper>
|
@ -1,13 +1,13 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8" ?>
|
<?xml version="1.0" encoding="UTF-8" ?>
|
||||||
<!DOCTYPE mapper
|
<!DOCTYPE mapper
|
||||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
<mapper namespace="com.jlt.csa.mapper.GardenMapper">
|
<mapper namespace="com.jlt.csa.mapper.GardenMapper">
|
||||||
|
|
||||||
<resultMap type="Garden" id="GardenResult">
|
<resultMap type="Garden" id="GardenResult">
|
||||||
<result property="id" column="id" />
|
<result property="id" column="id" />
|
||||||
|
<result property="zoneId" column="zone_id" />
|
||||||
<result property="code" column="code" />
|
<result property="code" column="code" />
|
||||||
<result property="zoneCode" column="zone_code" />
|
|
||||||
<result property="name" column="name" />
|
<result property="name" column="name" />
|
||||||
<result property="m2" column="m2" />
|
<result property="m2" column="m2" />
|
||||||
<result property="memberId" column="member_id" />
|
<result property="memberId" column="member_id" />
|
||||||
@ -27,15 +27,16 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
</resultMap>
|
</resultMap>
|
||||||
|
|
||||||
<sql id="selectGardenVo">
|
<sql id="selectGardenVo">
|
||||||
select id, code, zone_code, name, m2, member_id, manager_id, worker_id, contacter_id, is_farming, is_selled, is_completed, status, del_flag, create_by, create_time, update_by, update_time, remark from csa_garden
|
select id, zone_id, code, name, m2, member_id, manager_id, worker_id, contacter_id, is_farming, is_selled, is_completed, status, del_flag, create_by, create_time, update_by, update_time, remark from csa_garden
|
||||||
</sql>
|
</sql>
|
||||||
|
|
||||||
<select id="selectGardenList" parameterType="Garden" resultMap="GardenResult">
|
<select id="selectGardenList" parameterType="Garden" resultMap="GardenResult">
|
||||||
<include refid="selectGardenVo"/>
|
<include refid="selectGardenVo"/>
|
||||||
<where>
|
<where>
|
||||||
|
<if test="zoneId != null "> and zone_id = #{zoneId}</if>
|
||||||
<if test="code != null and code != ''"> and code = #{code}</if>
|
<if test="code != null and code != ''"> and code = #{code}</if>
|
||||||
<if test="zoneCode != null and zoneCode != ''"> and zone_code = #{zoneCode}</if>
|
|
||||||
<if test="name != null and name != ''"> and name like concat('%', #{name}, '%')</if>
|
<if test="name != null and name != ''"> and name like concat('%', #{name}, '%')</if>
|
||||||
|
<if test="m2 != null "> and m2 = #{m2}</if>
|
||||||
<if test="memberId != null "> and member_id = #{memberId}</if>
|
<if test="memberId != null "> and member_id = #{memberId}</if>
|
||||||
<if test="managerId != null "> and manager_id = #{managerId}</if>
|
<if test="managerId != null "> and manager_id = #{managerId}</if>
|
||||||
<if test="workerId != null "> and worker_id = #{workerId}</if>
|
<if test="workerId != null "> and worker_id = #{workerId}</if>
|
||||||
@ -43,29 +44,30 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
<if test="isFarming != null and isFarming != ''"> and is_farming = #{isFarming}</if>
|
<if test="isFarming != null and isFarming != ''"> and is_farming = #{isFarming}</if>
|
||||||
<if test="isSelled != null and isSelled != ''"> and is_selled = #{isSelled}</if>
|
<if test="isSelled != null and isSelled != ''"> and is_selled = #{isSelled}</if>
|
||||||
<if test="isCompleted != null and isCompleted != ''"> and is_completed = #{isCompleted}</if>
|
<if test="isCompleted != null and isCompleted != ''"> and is_completed = #{isCompleted}</if>
|
||||||
|
<if test="status != null and status != ''"> and status = #{status}</if>
|
||||||
</where>
|
</where>
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="selectGardenById" parameterType="Long" resultMap="GardenResult">
|
<select id="selectGardenById" parameterType="Long" resultMap="GardenResult">
|
||||||
<include refid="selectGardenVo"/>
|
<include refid="selectGardenVo"/>
|
||||||
where id = #{id}
|
where id = #{id}
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<insert id="insertGarden" parameterType="Garden">
|
<insert id="insertGarden" parameterType="Garden">
|
||||||
insert into csa_garden
|
insert into csa_garden
|
||||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||||
<if test="id != null">id,</if>
|
<if test="id != null">id,</if>
|
||||||
|
<if test="zoneId != null">zone_id,</if>
|
||||||
<if test="code != null and code != ''">code,</if>
|
<if test="code != null and code != ''">code,</if>
|
||||||
<if test="zoneCode != null and zoneCode != ''">zone_code,</if>
|
|
||||||
<if test="name != null and name != ''">name,</if>
|
<if test="name != null and name != ''">name,</if>
|
||||||
<if test="m2 != null">m2,</if>
|
<if test="m2 != null">m2,</if>
|
||||||
<if test="memberId != null">member_id,</if>
|
<if test="memberId != null">member_id,</if>
|
||||||
<if test="managerId != null">manager_id,</if>
|
<if test="managerId != null">manager_id,</if>
|
||||||
<if test="workerId != null">worker_id,</if>
|
<if test="workerId != null">worker_id,</if>
|
||||||
<if test="contacterId != null">contacter_id,</if>
|
<if test="contacterId != null">contacter_id,</if>
|
||||||
<if test="isFarming != null">is_farming,</if>
|
<if test="isFarming != null and isFarming != ''">is_farming,</if>
|
||||||
<if test="isSelled != null">is_selled,</if>
|
<if test="isSelled != null and isSelled != ''">is_selled,</if>
|
||||||
<if test="isCompleted != null">is_completed,</if>
|
<if test="isCompleted != null and isCompleted != ''">is_completed,</if>
|
||||||
<if test="status != null">status,</if>
|
<if test="status != null">status,</if>
|
||||||
<if test="delFlag != null">del_flag,</if>
|
<if test="delFlag != null">del_flag,</if>
|
||||||
<if test="createBy != null">create_by,</if>
|
<if test="createBy != null">create_by,</if>
|
||||||
@ -73,20 +75,20 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
<if test="updateBy != null">update_by,</if>
|
<if test="updateBy != null">update_by,</if>
|
||||||
<if test="updateTime != null">update_time,</if>
|
<if test="updateTime != null">update_time,</if>
|
||||||
<if test="remark != null">remark,</if>
|
<if test="remark != null">remark,</if>
|
||||||
</trim>
|
</trim>
|
||||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||||
<if test="id != null">#{id},</if>
|
<if test="id != null">#{id},</if>
|
||||||
|
<if test="zoneId != null">#{zoneId},</if>
|
||||||
<if test="code != null and code != ''">#{code},</if>
|
<if test="code != null and code != ''">#{code},</if>
|
||||||
<if test="zoneCode != null and zoneCode != ''">#{zoneCode},</if>
|
|
||||||
<if test="name != null and name != ''">#{name},</if>
|
<if test="name != null and name != ''">#{name},</if>
|
||||||
<if test="m2 != null">#{m2},</if>
|
<if test="m2 != null">#{m2},</if>
|
||||||
<if test="memberId != null">#{memberId},</if>
|
<if test="memberId != null">#{memberId},</if>
|
||||||
<if test="managerId != null">#{managerId},</if>
|
<if test="managerId != null">#{managerId},</if>
|
||||||
<if test="workerId != null">#{workerId},</if>
|
<if test="workerId != null">#{workerId},</if>
|
||||||
<if test="contacterId != null">#{contacterId},</if>
|
<if test="contacterId != null">#{contacterId},</if>
|
||||||
<if test="isFarming != null">#{isFarming},</if>
|
<if test="isFarming != null and isFarming != ''">#{isFarming},</if>
|
||||||
<if test="isSelled != null">#{isSelled},</if>
|
<if test="isSelled != null and isSelled != ''">#{isSelled},</if>
|
||||||
<if test="isCompleted != null">#{isCompleted},</if>
|
<if test="isCompleted != null and isCompleted != ''">#{isCompleted},</if>
|
||||||
<if test="status != null">#{status},</if>
|
<if test="status != null">#{status},</if>
|
||||||
<if test="delFlag != null">#{delFlag},</if>
|
<if test="delFlag != null">#{delFlag},</if>
|
||||||
<if test="createBy != null">#{createBy},</if>
|
<if test="createBy != null">#{createBy},</if>
|
||||||
@ -94,23 +96,23 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
<if test="updateBy != null">#{updateBy},</if>
|
<if test="updateBy != null">#{updateBy},</if>
|
||||||
<if test="updateTime != null">#{updateTime},</if>
|
<if test="updateTime != null">#{updateTime},</if>
|
||||||
<if test="remark != null">#{remark},</if>
|
<if test="remark != null">#{remark},</if>
|
||||||
</trim>
|
</trim>
|
||||||
</insert>
|
</insert>
|
||||||
|
|
||||||
<update id="updateGarden" parameterType="Garden">
|
<update id="updateGarden" parameterType="Garden">
|
||||||
update csa_garden
|
update csa_garden
|
||||||
<trim prefix="SET" suffixOverrides=",">
|
<trim prefix="SET" suffixOverrides=",">
|
||||||
|
<if test="zoneId != null">zone_id = #{zoneId},</if>
|
||||||
<if test="code != null and code != ''">code = #{code},</if>
|
<if test="code != null and code != ''">code = #{code},</if>
|
||||||
<if test="zoneCode != null and zoneCode != ''">zone_code = #{zoneCode},</if>
|
<if test="name != null and name != ''">#{name},</if>
|
||||||
<if test="name != null and name != ''">name = #{name},</if>
|
|
||||||
<if test="m2 != null">m2 = #{m2},</if>
|
<if test="m2 != null">m2 = #{m2},</if>
|
||||||
<if test="memberId != null">member_id = #{memberId},</if>
|
<if test="memberId != null">member_id = #{memberId},</if>
|
||||||
<if test="managerId != null">manager_id = #{managerId},</if>
|
<if test="managerId != null">manager_id = #{managerId},</if>
|
||||||
<if test="workerId != null">worker_id = #{workerId},</if>
|
<if test="workerId != null">worker_id = #{workerId},</if>
|
||||||
<if test="contacterId != null">contacter_id = #{contacterId},</if>
|
<if test="contacterId != null">contacter_id = #{contacterId},</if>
|
||||||
<if test="isFarming != null">is_farming = #{isFarming},</if>
|
<if test="isFarming != null and isFarming != ''">is_farming = #{isFarming},</if>
|
||||||
<if test="isSelled != null">is_selled = #{isSelled},</if>
|
<if test="isSelled != null and isSelled != ''">is_selled = #{isSelled},</if>
|
||||||
<if test="isCompleted != null">is_completed = #{isCompleted},</if>
|
<if test="isCompleted != null and isCompleted != ''">is_completed = #{isCompleted},</if>
|
||||||
<if test="status != null">status = #{status},</if>
|
<if test="status != null">status = #{status},</if>
|
||||||
<if test="delFlag != null">del_flag = #{delFlag},</if>
|
<if test="delFlag != null">del_flag = #{delFlag},</if>
|
||||||
<if test="createBy != null">create_by = #{createBy},</if>
|
<if test="createBy != null">create_by = #{createBy},</if>
|
||||||
@ -122,12 +124,29 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
where id = #{id}
|
where id = #{id}
|
||||||
</update>
|
</update>
|
||||||
|
|
||||||
|
<update id="updateGardenStatus">
|
||||||
|
update csa_garden
|
||||||
|
<trim prefix="SET" suffixOverrides=",">
|
||||||
|
<if test="garden.isFarming != null and garden.isFarming != ''">is_farming = #{garden.isFarming},</if>
|
||||||
|
<if test="garden.isSelled != null and garden.isSelled != ''">is_selled = #{garden.isSelled},</if>
|
||||||
|
<if test="garden.isCompleted != null and garden.isCompleted != ''">is_completed = #{garden.isCompleted},</if>
|
||||||
|
<if test="garden.status != null">status = #{garden.status},</if>
|
||||||
|
<if test="garden.delFlag != null">del_flag = #{garden.delFlag},</if>
|
||||||
|
<if test="garden.updateBy != null">update_by = #{garden.updateBy},</if>
|
||||||
|
<if test="garden.updateTime != null">update_time = #{garden.updateTime},</if>
|
||||||
|
</trim>
|
||||||
|
where id in
|
||||||
|
<foreach item="id" collection="ids" open="(" separator="," close=")">
|
||||||
|
#{id}
|
||||||
|
</foreach>
|
||||||
|
</update>
|
||||||
|
|
||||||
<delete id="deleteGardenById" parameterType="Long">
|
<delete id="deleteGardenById" parameterType="Long">
|
||||||
delete from csa_garden where id = #{id}
|
delete from csa_garden where id = #{id}
|
||||||
</delete>
|
</delete>
|
||||||
|
|
||||||
<delete id="deleteGardenByIds" parameterType="String">
|
<delete id="deleteGardenByIds" parameterType="String">
|
||||||
delete from csa_garden where id in
|
delete from csa_garden where id in
|
||||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||||
#{id}
|
#{id}
|
||||||
</foreach>
|
</foreach>
|
||||||
|
@ -1,124 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8" ?>
|
|
||||||
<!DOCTYPE mapper
|
|
||||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
||||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
|
||||||
<mapper namespace="com.jlt.csa.mapper.base.CsaDictDataMapper">
|
|
||||||
|
|
||||||
<resultMap type="SysDictData" id="SysDictDataResult">
|
|
||||||
<id property="dictCode" column="dict_code" />
|
|
||||||
<result property="dictSort" column="dict_sort" />
|
|
||||||
<result property="dictLabel" column="dict_label" />
|
|
||||||
<result property="dictValue" column="dict_value" />
|
|
||||||
<result property="dictType" column="dict_type" />
|
|
||||||
<result property="cssClass" column="css_class" />
|
|
||||||
<result property="listClass" column="list_class" />
|
|
||||||
<result property="isDefault" column="is_default" />
|
|
||||||
<result property="status" column="status" />
|
|
||||||
<result property="createBy" column="create_by" />
|
|
||||||
<result property="createTime" column="create_time" />
|
|
||||||
<result property="updateBy" column="update_by" />
|
|
||||||
<result property="updateTime" column="update_time" />
|
|
||||||
</resultMap>
|
|
||||||
|
|
||||||
<sql id="selectDictDataVo">
|
|
||||||
select dict_code, dict_sort, dict_label, dict_value, dict_type, css_class, list_class, is_default, status, create_by, create_time, remark
|
|
||||||
from csa_dict_data
|
|
||||||
</sql>
|
|
||||||
|
|
||||||
<select id="selectDictDataList" parameterType="SysDictData" resultMap="SysDictDataResult">
|
|
||||||
<include refid="selectDictDataVo"/>
|
|
||||||
<where>
|
|
||||||
<if test="dictType != null and dictType != ''">
|
|
||||||
AND dict_type = #{dictType}
|
|
||||||
</if>
|
|
||||||
<if test="dictLabel != null and dictLabel != ''">
|
|
||||||
AND dict_label like concat('%', #{dictLabel}, '%')
|
|
||||||
</if>
|
|
||||||
<if test="status != null and status != ''">
|
|
||||||
AND status = #{status}
|
|
||||||
</if>
|
|
||||||
</where>
|
|
||||||
order by dict_sort asc
|
|
||||||
</select>
|
|
||||||
|
|
||||||
<select id="selectDictDataByType" parameterType="SysDictData" resultMap="SysDictDataResult">
|
|
||||||
<include refid="selectDictDataVo"/>
|
|
||||||
where status = '0' and dict_type = #{dictType} order by dict_sort asc
|
|
||||||
</select>
|
|
||||||
|
|
||||||
<select id="selectDictLabel" resultType="String">
|
|
||||||
select dict_label from csa_dict_data
|
|
||||||
where dict_type = #{dictType} and dict_value = #{dictValue}
|
|
||||||
</select>
|
|
||||||
|
|
||||||
<select id="selectDictDataById" parameterType="Long" resultMap="SysDictDataResult">
|
|
||||||
<include refid="selectDictDataVo"/>
|
|
||||||
where dict_code = #{dictCode}
|
|
||||||
</select>
|
|
||||||
|
|
||||||
<select id="countDictDataByType" resultType="Integer">
|
|
||||||
select count(1) from csa_dict_data where dict_type=#{dictType}
|
|
||||||
</select>
|
|
||||||
|
|
||||||
<delete id="deleteDictDataById" parameterType="Long">
|
|
||||||
delete from csa_dict_data where dict_code = #{dictCode}
|
|
||||||
</delete>
|
|
||||||
|
|
||||||
<delete id="deleteDictDataByIds" parameterType="Long">
|
|
||||||
delete from csa_dict_data where dict_code in
|
|
||||||
<foreach collection="array" item="dictCode" open="(" separator="," close=")">
|
|
||||||
#{dictCode}
|
|
||||||
</foreach>
|
|
||||||
</delete>
|
|
||||||
|
|
||||||
<update id="updateDictData" parameterType="SysDictData">
|
|
||||||
update csa_dict_data
|
|
||||||
<set>
|
|
||||||
<if test="dictSort != null">dict_sort = #{dictSort},</if>
|
|
||||||
<if test="dictLabel != null and dictLabel != ''">dict_label = #{dictLabel},</if>
|
|
||||||
<if test="dictValue != null and dictValue != ''">dict_value = #{dictValue},</if>
|
|
||||||
<if test="dictType != null and dictType != ''">dict_type = #{dictType},</if>
|
|
||||||
<if test="cssClass != null">css_class = #{cssClass},</if>
|
|
||||||
<if test="listClass != null">list_class = #{listClass},</if>
|
|
||||||
<if test="isDefault != null and isDefault != ''">is_default = #{isDefault},</if>
|
|
||||||
<if test="status != null">status = #{status},</if>
|
|
||||||
<if test="remark != null">remark = #{remark},</if>
|
|
||||||
<if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
|
|
||||||
update_time = sysdate()
|
|
||||||
</set>
|
|
||||||
where dict_code = #{dictCode}
|
|
||||||
</update>
|
|
||||||
|
|
||||||
<update id="updateDictDataType" parameterType="String">
|
|
||||||
update csa_dict_data set dict_type = #{newDictType} where dict_type = #{oldDictType}
|
|
||||||
</update>
|
|
||||||
|
|
||||||
<insert id="insertDictData" parameterType="SysDictData">
|
|
||||||
insert into csa_dict_data(
|
|
||||||
<if test="dictSort != null">dict_sort,</if>
|
|
||||||
<if test="dictLabel != null and dictLabel != ''">dict_label,</if>
|
|
||||||
<if test="dictValue != null and dictValue != ''">dict_value,</if>
|
|
||||||
<if test="dictType != null and dictType != ''">dict_type,</if>
|
|
||||||
<if test="cssClass != null and cssClass != ''">css_class,</if>
|
|
||||||
<if test="listClass != null and listClass != ''">list_class,</if>
|
|
||||||
<if test="isDefault != null and isDefault != ''">is_default,</if>
|
|
||||||
<if test="status != null">status,</if>
|
|
||||||
<if test="remark != null and remark != ''">remark,</if>
|
|
||||||
<if test="createBy != null and createBy != ''">create_by,</if>
|
|
||||||
create_time
|
|
||||||
)values(
|
|
||||||
<if test="dictSort != null">#{dictSort},</if>
|
|
||||||
<if test="dictLabel != null and dictLabel != ''">#{dictLabel},</if>
|
|
||||||
<if test="dictValue != null and dictValue != ''">#{dictValue},</if>
|
|
||||||
<if test="dictType != null and dictType != ''">#{dictType},</if>
|
|
||||||
<if test="cssClass != null and cssClass != ''">#{cssClass},</if>
|
|
||||||
<if test="listClass != null and listClass != ''">#{listClass},</if>
|
|
||||||
<if test="isDefault != null and isDefault != ''">#{isDefault},</if>
|
|
||||||
<if test="status != null">#{status},</if>
|
|
||||||
<if test="remark != null and remark != ''">#{remark},</if>
|
|
||||||
<if test="createBy != null and createBy != ''">#{createBy},</if>
|
|
||||||
sysdate()
|
|
||||||
)
|
|
||||||
</insert>
|
|
||||||
|
|
||||||
</mapper>
|
|
@ -1,105 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8" ?>
|
|
||||||
<!DOCTYPE mapper
|
|
||||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
||||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
|
||||||
<mapper namespace="com.jlt.csa.mapper.base.CsaDictTypeMapper">
|
|
||||||
|
|
||||||
<resultMap type="SysDictType" id="SysDictTypeResult">
|
|
||||||
<id property="dictId" column="dict_id" />
|
|
||||||
<result property="dictName" column="dict_name" />
|
|
||||||
<result property="dictType" column="dict_type" />
|
|
||||||
<result property="status" column="status" />
|
|
||||||
<result property="createBy" column="create_by" />
|
|
||||||
<result property="createTime" column="create_time" />
|
|
||||||
<result property="updateBy" column="update_by" />
|
|
||||||
<result property="updateTime" column="update_time" />
|
|
||||||
</resultMap>
|
|
||||||
|
|
||||||
<sql id="selectDictTypeVo">
|
|
||||||
select dict_id, dict_name, dict_type, status, create_by, create_time, remark
|
|
||||||
from csa_dict_type
|
|
||||||
</sql>
|
|
||||||
|
|
||||||
<select id="selectDictTypeList" parameterType="SysDictType" resultMap="SysDictTypeResult">
|
|
||||||
<include refid="selectDictTypeVo"/>
|
|
||||||
<where>
|
|
||||||
<if test="dictName != null and dictName != ''">
|
|
||||||
AND dict_name like concat('%', #{dictName}, '%')
|
|
||||||
</if>
|
|
||||||
<if test="status != null and status != ''">
|
|
||||||
AND status = #{status}
|
|
||||||
</if>
|
|
||||||
<if test="dictType != null and dictType != ''">
|
|
||||||
AND dict_type like concat('%', #{dictType}, '%')
|
|
||||||
</if>
|
|
||||||
<if test="params.beginTime != null and params.beginTime != ''"><!-- 开始时间检索 -->
|
|
||||||
and date_format(create_time,'%y%m%d') >= date_format(#{params.beginTime},'%y%m%d')
|
|
||||||
</if>
|
|
||||||
<if test="params.endTime != null and params.endTime != ''"><!-- 结束时间检索 -->
|
|
||||||
and date_format(create_time,'%y%m%d') <= date_format(#{params.endTime},'%y%m%d')
|
|
||||||
</if>
|
|
||||||
</where>
|
|
||||||
</select>
|
|
||||||
|
|
||||||
<select id="selectDictTypeAll" resultMap="SysDictTypeResult">
|
|
||||||
<include refid="selectDictTypeVo"/>
|
|
||||||
</select>
|
|
||||||
|
|
||||||
<select id="selectDictTypeById" parameterType="Long" resultMap="SysDictTypeResult">
|
|
||||||
<include refid="selectDictTypeVo"/>
|
|
||||||
where dict_id = #{dictId}
|
|
||||||
</select>
|
|
||||||
|
|
||||||
<select id="selectDictTypeByType" parameterType="String" resultMap="SysDictTypeResult">
|
|
||||||
<include refid="selectDictTypeVo"/>
|
|
||||||
where dict_type = #{dictType}
|
|
||||||
</select>
|
|
||||||
|
|
||||||
<select id="checkDictTypeUnique" parameterType="String" resultMap="SysDictTypeResult">
|
|
||||||
<include refid="selectDictTypeVo"/>
|
|
||||||
where dict_type = #{dictType} limit 1
|
|
||||||
</select>
|
|
||||||
|
|
||||||
<delete id="deleteDictTypeById" parameterType="Long">
|
|
||||||
delete from csa_dict_type where dict_id = #{dictId}
|
|
||||||
</delete>
|
|
||||||
|
|
||||||
<delete id="deleteDictTypeByIds" parameterType="Long">
|
|
||||||
delete from csa_dict_type where dict_id in
|
|
||||||
<foreach collection="array" item="dictId" open="(" separator="," close=")">
|
|
||||||
#{dictId}
|
|
||||||
</foreach>
|
|
||||||
</delete>
|
|
||||||
|
|
||||||
<update id="updateDictType" parameterType="SysDictType">
|
|
||||||
update csa_dict_type
|
|
||||||
<set>
|
|
||||||
<if test="dictName != null and dictName != ''">dict_name = #{dictName},</if>
|
|
||||||
<if test="dictType != null and dictType != ''">dict_type = #{dictType},</if>
|
|
||||||
<if test="status != null">status = #{status},</if>
|
|
||||||
<if test="remark != null">remark = #{remark},</if>
|
|
||||||
<if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
|
|
||||||
update_time = sysdate()
|
|
||||||
</set>
|
|
||||||
where dict_id = #{dictId}
|
|
||||||
</update>
|
|
||||||
|
|
||||||
<insert id="insertDictType" parameterType="SysDictType">
|
|
||||||
insert into csa_dict_type(
|
|
||||||
<if test="dictName != null and dictName != ''">dict_name,</if>
|
|
||||||
<if test="dictType != null and dictType != ''">dict_type,</if>
|
|
||||||
<if test="status != null">status,</if>
|
|
||||||
<if test="remark != null and remark != ''">remark,</if>
|
|
||||||
<if test="createBy != null and createBy != ''">create_by,</if>
|
|
||||||
create_time
|
|
||||||
)values(
|
|
||||||
<if test="dictName != null and dictName != ''">#{dictName},</if>
|
|
||||||
<if test="dictType != null and dictType != ''">#{dictType},</if>
|
|
||||||
<if test="status != null">#{status},</if>
|
|
||||||
<if test="remark != null and remark != ''">#{remark},</if>
|
|
||||||
<if test="createBy != null and createBy != ''">#{createBy},</if>
|
|
||||||
sysdate()
|
|
||||||
)
|
|
||||||
</insert>
|
|
||||||
|
|
||||||
</mapper>
|
|
@ -94,11 +94,14 @@ token:
|
|||||||
# MyBatis配置
|
# MyBatis配置
|
||||||
mybatis:
|
mybatis:
|
||||||
# 搜索指定包别名
|
# 搜索指定包别名
|
||||||
typeAliasesPackage: com.ruoyi.**.domain,com.jlt.**.domain
|
typeAliasesPackage: com.ruoyi.**.domain, com.jlt.**.domain
|
||||||
# 配置mapper的扫描,找到所有的mapper.xml映射文件
|
# 配置mapper的扫描,找到所有的mapper.xml映射文件
|
||||||
mapperLocations: classpath*:mapper/**/*Mapper.xml
|
mapperLocations: classpath*:mapper/**/*Mapper.xml
|
||||||
# 加载全局的配置文件
|
# 加载全局的配置文件
|
||||||
configLocation: classpath:mybatis/mybatis-config.xml
|
configLocation: classpath:mybatis/mybatis-config.xml
|
||||||
|
# 在控制台显示sql输出
|
||||||
|
#configuration:
|
||||||
|
#log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
|
||||||
|
|
||||||
# PageHelper分页插件
|
# PageHelper分页插件
|
||||||
pagehelper:
|
pagehelper:
|
||||||
|
@ -73,6 +73,7 @@
|
|||||||
|
|
||||||
<!-- 系统模块日志级别控制 -->
|
<!-- 系统模块日志级别控制 -->
|
||||||
<logger name="com.ruoyi" level="info" />
|
<logger name="com.ruoyi" level="info" />
|
||||||
|
<logger name="com.jlt" level="debug" />
|
||||||
<!-- Spring日志级别控制 -->
|
<!-- Spring日志级别控制 -->
|
||||||
<logger name="org.springframework" level="warn" />
|
<logger name="org.springframework" level="warn" />
|
||||||
|
|
||||||
|
@ -10,9 +10,9 @@ export function listFarmzone(query) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 查询农场分区详细
|
// 查询农场分区详细
|
||||||
export function getFarmzone(code) {
|
export function getFarmzone(id) {
|
||||||
return request({
|
return request({
|
||||||
url: '/csa/farmzone/' + code,
|
url: '/csa/farmzone/' + id,
|
||||||
method: 'get'
|
method: 'get'
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
@ -36,9 +36,9 @@ export function updateFarmzone(data) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 删除农场分区
|
// 删除农场分区
|
||||||
export function delFarmzone(code) {
|
export function delFarmzone(id) {
|
||||||
return request({
|
return request({
|
||||||
url: '/csa/farmzone/' + code,
|
url: '/csa/farmzone/' + id,
|
||||||
method: 'delete'
|
method: 'delete'
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
@ -35,6 +35,16 @@ export function updateGarden(data) {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 批量修改菜地划分状态
|
||||||
|
export function updateGardenStatus(data, id) {
|
||||||
|
return request({
|
||||||
|
url: '/csa/garden/' + id,
|
||||||
|
method: 'put',
|
||||||
|
data: data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// 删除菜地划分
|
// 删除菜地划分
|
||||||
export function delGarden(id) {
|
export function delGarden(id) {
|
||||||
return request({
|
return request({
|
||||||
|
@ -1,6 +1,16 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="app-container">
|
<div class="app-container">
|
||||||
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
|
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
|
||||||
|
<el-form-item label="分区类型" prop="type">
|
||||||
|
<el-select v-model="queryParams.type" placeholder="请选择分区类型" clearable>
|
||||||
|
<el-option
|
||||||
|
v-for="dict in dict.type.csa_zone_type"
|
||||||
|
:key="dict.value"
|
||||||
|
:label="dict.label"
|
||||||
|
:value="dict.value"
|
||||||
|
/>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
<el-form-item label="分区名称" prop="name">
|
<el-form-item label="分区名称" prop="name">
|
||||||
<el-input
|
<el-input
|
||||||
v-model="queryParams.name"
|
v-model="queryParams.name"
|
||||||
@ -9,6 +19,16 @@
|
|||||||
@keyup.enter.native="handleQuery"
|
@keyup.enter.native="handleQuery"
|
||||||
/>
|
/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
<el-form-item label="状态" prop="status">
|
||||||
|
<el-select v-model="queryParams.status" placeholder="请选择状态" clearable>
|
||||||
|
<el-option
|
||||||
|
v-for="dict in dict.type.sys_normal_disable"
|
||||||
|
:key="dict.value"
|
||||||
|
:label="dict.label"
|
||||||
|
:value="dict.value"
|
||||||
|
/>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
|
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
|
||||||
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
|
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
|
||||||
@ -63,10 +83,17 @@
|
|||||||
|
|
||||||
<el-table v-loading="loading" :data="farmzoneList" @selection-change="handleSelectionChange">
|
<el-table v-loading="loading" :data="farmzoneList" @selection-change="handleSelectionChange">
|
||||||
<el-table-column type="selection" width="55" align="center" />
|
<el-table-column type="selection" width="55" align="center" />
|
||||||
<el-table-column label="分区代码" align="center" prop="code" />
|
<el-table-column label="分区类型" align="center" prop="type">
|
||||||
<el-table-column label="分区类型" align="center" prop="type" />
|
<template slot-scope="scope">
|
||||||
|
<dict-tag :options="dict.type.csa_zone_type" :value="scope.row.type"/>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
<el-table-column label="分区名称" align="center" prop="name" />
|
<el-table-column label="分区名称" align="center" prop="name" />
|
||||||
<el-table-column label="状态" align="center" prop="status" />
|
<el-table-column label="状态" align="center" prop="status">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<dict-tag :options="dict.type.sys_normal_disable" :value="scope.row.status"/>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
<el-table-column label="备注" align="center" prop="remark" />
|
<el-table-column label="备注" align="center" prop="remark" />
|
||||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
@ -87,7 +114,7 @@
|
|||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</el-table>
|
</el-table>
|
||||||
|
|
||||||
<pagination
|
<pagination
|
||||||
v-show="total>0"
|
v-show="total>0"
|
||||||
:total="total"
|
:total="total"
|
||||||
@ -97,16 +124,32 @@
|
|||||||
/>
|
/>
|
||||||
|
|
||||||
<!-- 添加或修改农场分区对话框 -->
|
<!-- 添加或修改农场分区对话框 -->
|
||||||
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
|
<el-dialog :title="title" :visible.sync="open" width="400px" append-to-body>
|
||||||
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
|
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
|
||||||
|
<el-form-item label="分区类型" prop="type">
|
||||||
|
<el-select v-model="form.type" placeholder="请选择分区类型">
|
||||||
|
<el-option
|
||||||
|
v-for="dict in dict.type.csa_zone_type"
|
||||||
|
:key="dict.value"
|
||||||
|
:label="dict.label"
|
||||||
|
:value="dict.value"
|
||||||
|
></el-option>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
<el-form-item label="分区名称" prop="name">
|
<el-form-item label="分区名称" prop="name">
|
||||||
<el-input v-model="form.name" placeholder="请输入分区名称" />
|
<el-input v-model="form.name" placeholder="请输入分区名称" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="删除标志" prop="delFlag">
|
|
||||||
<el-input v-model="form.delFlag" placeholder="请输入删除标志" />
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="备注" prop="remark">
|
<el-form-item label="备注" prop="remark">
|
||||||
<el-input v-model="form.remark" placeholder="请输入备注" />
|
<el-input v-model="form.remark" type="textarea" rows="3" placeholder="请输入备注" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="状态">
|
||||||
|
<el-radio-group v-model="form.status">
|
||||||
|
<el-radio
|
||||||
|
v-for="dict in dict.type.sys_normal_disable"
|
||||||
|
:key="dict.value"
|
||||||
|
:label="dict.value"
|
||||||
|
>{{dict.label}}</el-radio>
|
||||||
|
</el-radio-group>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-form>
|
</el-form>
|
||||||
<div slot="footer" class="dialog-footer">
|
<div slot="footer" class="dialog-footer">
|
||||||
@ -118,153 +161,156 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { listFarmzone, getFarmzone, delFarmzone, addFarmzone, updateFarmzone } from "@/api/csa/farmzone";
|
import { listFarmzone, getFarmzone, delFarmzone, addFarmzone, updateFarmzone } from "@/api/csa/farmzone";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "Farmzone",
|
name: "Farmzone",
|
||||||
data() {
|
dicts: ['csa_zone_type', 'sys_normal_disable'],
|
||||||
return {
|
data() {
|
||||||
// 遮罩层
|
return {
|
||||||
loading: true,
|
// 遮罩层
|
||||||
// 选中数组
|
loading: true,
|
||||||
ids: [],
|
// 选中数组
|
||||||
// 非单个禁用
|
ids: [],
|
||||||
single: true,
|
// 非单个禁用
|
||||||
// 非多个禁用
|
single: true,
|
||||||
multiple: true,
|
// 非多个禁用
|
||||||
// 显示搜索条件
|
multiple: true,
|
||||||
showSearch: true,
|
// 显示搜索条件
|
||||||
// 总条数
|
showSearch: true,
|
||||||
total: 0,
|
// 总条数
|
||||||
// 农场分区表格数据
|
total: 0,
|
||||||
farmzoneList: [],
|
// 农场分区表格数据
|
||||||
// 弹出层标题
|
farmzoneList: [],
|
||||||
title: "",
|
// 弹出层标题
|
||||||
// 是否显示弹出层
|
title: "",
|
||||||
open: false,
|
// 是否显示弹出层
|
||||||
// 查询参数
|
open: false,
|
||||||
queryParams: {
|
// 查询参数
|
||||||
pageNum: 1,
|
queryParams: {
|
||||||
pageSize: 10,
|
pageNum: 1,
|
||||||
type: null,
|
pageSize: 10,
|
||||||
name: null,
|
code: null,
|
||||||
status: null,
|
type: null,
|
||||||
},
|
name: null,
|
||||||
// 表单参数
|
status: null,
|
||||||
form: {},
|
},
|
||||||
// 表单校验
|
// 表单参数
|
||||||
rules: {
|
form: {},
|
||||||
type: [
|
// 表单校验
|
||||||
{ required: true, message: "分区类型不能为空", trigger: "change" }
|
rules: {
|
||||||
],
|
type: [
|
||||||
name: [
|
{ required: true, message: "分区类型不能为空", trigger: "change" }
|
||||||
{ required: true, message: "分区名称不能为空", trigger: "blur" }
|
],
|
||||||
],
|
name: [
|
||||||
}
|
{ required: true, message: "分区名称不能为空", trigger: "blur" }
|
||||||
};
|
],
|
||||||
},
|
}
|
||||||
created() {
|
|
||||||
this.getList();
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
/** 查询农场分区列表 */
|
|
||||||
getList() {
|
|
||||||
this.loading = true;
|
|
||||||
listFarmzone(this.queryParams).then(response => {
|
|
||||||
this.farmzoneList = response.rows;
|
|
||||||
this.total = response.total;
|
|
||||||
this.loading = false;
|
|
||||||
});
|
|
||||||
},
|
|
||||||
// 取消按钮
|
|
||||||
cancel() {
|
|
||||||
this.open = false;
|
|
||||||
this.reset();
|
|
||||||
},
|
|
||||||
// 表单重置
|
|
||||||
reset() {
|
|
||||||
this.form = {
|
|
||||||
code: null,
|
|
||||||
type: null,
|
|
||||||
name: null,
|
|
||||||
status: "0",
|
|
||||||
delFlag: null,
|
|
||||||
createBy: null,
|
|
||||||
createTime: null,
|
|
||||||
updateBy: null,
|
|
||||||
updateTime: null,
|
|
||||||
remark: null
|
|
||||||
};
|
};
|
||||||
this.resetForm("form");
|
|
||||||
},
|
},
|
||||||
/** 搜索按钮操作 */
|
created() {
|
||||||
handleQuery() {
|
|
||||||
this.queryParams.pageNum = 1;
|
|
||||||
this.getList();
|
this.getList();
|
||||||
},
|
},
|
||||||
/** 重置按钮操作 */
|
methods: {
|
||||||
resetQuery() {
|
/** 查询农场分区列表 */
|
||||||
this.resetForm("queryForm");
|
getList() {
|
||||||
this.handleQuery();
|
this.loading = true;
|
||||||
},
|
listFarmzone(this.queryParams).then(response => {
|
||||||
// 多选框选中数据
|
this.farmzoneList = response.rows;
|
||||||
handleSelectionChange(selection) {
|
this.total = response.total;
|
||||||
this.ids = selection.map(item => item.code)
|
this.loading = false;
|
||||||
this.single = selection.length!==1
|
});
|
||||||
this.multiple = !selection.length
|
},
|
||||||
},
|
// 取消按钮
|
||||||
/** 新增按钮操作 */
|
cancel() {
|
||||||
handleAdd() {
|
this.open = false;
|
||||||
this.reset();
|
this.reset();
|
||||||
this.open = true;
|
},
|
||||||
this.title = "添加农场分区";
|
// 表单重置
|
||||||
},
|
reset() {
|
||||||
/** 修改按钮操作 */
|
this.form = {
|
||||||
handleUpdate(row) {
|
id: null,
|
||||||
this.reset();
|
type: null,
|
||||||
const code = row.code || this.ids
|
name: null,
|
||||||
getFarmzone(code).then(response => {
|
status: "0",
|
||||||
this.form = response.data;
|
delFlag: null,
|
||||||
this.open = true;
|
createBy: null,
|
||||||
this.title = "修改农场分区";
|
createTime: null,
|
||||||
});
|
updateBy: null,
|
||||||
},
|
updateTime: null,
|
||||||
/** 提交按钮 */
|
remark: null
|
||||||
submitForm() {
|
};
|
||||||
this.$refs["form"].validate(valid => {
|
this.resetForm("form");
|
||||||
if (valid) {
|
},
|
||||||
if (this.form.code != null) {
|
/** 搜索按钮操作 */
|
||||||
updateFarmzone(this.form).then(response => {
|
handleQuery() {
|
||||||
this.$modal.msgSuccess("修改成功");
|
this.queryParams.pageNum = 1;
|
||||||
this.open = false;
|
|
||||||
this.getList();
|
|
||||||
});
|
|
||||||
} else {
|
|
||||||
addFarmzone(this.form).then(response => {
|
|
||||||
this.$modal.msgSuccess("新增成功");
|
|
||||||
this.open = false;
|
|
||||||
this.getList();
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
},
|
|
||||||
/** 删除按钮操作 */
|
|
||||||
handleDelete(row) {
|
|
||||||
const codes = row.code || this.ids;
|
|
||||||
this.$modal.confirm('是否确认删除农场分区编号为"' + codes + '"的数据项?').then(function() {
|
|
||||||
return delFarmzone(codes);
|
|
||||||
}).then(() => {
|
|
||||||
this.getList();
|
this.getList();
|
||||||
this.$modal.msgSuccess("删除成功");
|
},
|
||||||
}).catch(() => {});
|
/** 重置按钮操作 */
|
||||||
},
|
resetQuery() {
|
||||||
/** 导出按钮操作 */
|
this.resetForm("queryForm");
|
||||||
handleExport() {
|
this.handleQuery();
|
||||||
this.download('csa/farmzone/export', {
|
},
|
||||||
...this.queryParams
|
// 多选框选中数据
|
||||||
}, `farmzone_${new Date().getTime()}.xlsx`)
|
handleSelectionChange(selection) {
|
||||||
|
this.ids = selection.map(item => item.id)
|
||||||
|
this.single = selection.length!==1
|
||||||
|
this.multiple = !selection.length
|
||||||
|
},
|
||||||
|
/** 新增按钮操作 */
|
||||||
|
handleAdd() {
|
||||||
|
this.reset();
|
||||||
|
this.open = true;
|
||||||
|
this.title = "添加农场分区";
|
||||||
|
},
|
||||||
|
/** 修改按钮操作 */
|
||||||
|
handleUpdate(row) {
|
||||||
|
this.reset();
|
||||||
|
const id = row.id || this.ids
|
||||||
|
getFarmzone(id).then(response => {
|
||||||
|
this.form = response.data;
|
||||||
|
this.open = true;
|
||||||
|
this.title = "修改农场分区";
|
||||||
|
});
|
||||||
|
},
|
||||||
|
/** 提交按钮 */
|
||||||
|
submitForm() {
|
||||||
|
this.$refs["form"].validate(valid => {
|
||||||
|
if (valid) {
|
||||||
|
if (this.form.id != null) {
|
||||||
|
updateFarmzone(this.form).then(response => {
|
||||||
|
this.$modal.msgSuccess("修改成功");
|
||||||
|
this.open = false;
|
||||||
|
this.getList();
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
addFarmzone(this.form).then(response => {
|
||||||
|
this.$modal.msgSuccess("新增成功");
|
||||||
|
this.open = false;
|
||||||
|
this.getList();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
/** 删除按钮操作 */
|
||||||
|
handleDelete(row) {
|
||||||
|
const ids = row.id || this.ids;
|
||||||
|
const itemName = row.name;
|
||||||
|
this.$modal.confirm('是否确认删除【' + itemName + '】?').then(function() {
|
||||||
|
return delFarmzone(ids);
|
||||||
|
}).then(() => {
|
||||||
|
this.getList();
|
||||||
|
this.$modal.msgSuccess("删除成功");
|
||||||
|
}).catch(() => {});
|
||||||
|
},
|
||||||
|
/** 导出按钮操作 */
|
||||||
|
handleExport() {
|
||||||
|
this.download('csa/farmzone/export', {
|
||||||
|
...this.queryParams
|
||||||
|
}, `farmzone_${new Date().getTime()}.xlsx`)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
};
|
|
||||||
</script>
|
</script>
|
||||||
|
@ -1,7 +1,17 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="app-container">
|
<div class="app-container">
|
||||||
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
|
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
|
||||||
<el-form-item label="菜地编号" prop="code" label-width="100">
|
<el-form-item label="农场分区" prop="zoneId">
|
||||||
|
<el-select v-model="queryParams.zoneId" placeholder="请选择农场分区" clearable>
|
||||||
|
<el-option
|
||||||
|
v-for="zone in farmzoneList"
|
||||||
|
:key="zone.id"
|
||||||
|
:label="zone.name"
|
||||||
|
:value="zone.id"
|
||||||
|
/>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="菜地编号" prop="code">
|
||||||
<el-input
|
<el-input
|
||||||
v-model="queryParams.code"
|
v-model="queryParams.code"
|
||||||
placeholder="请输入菜地编号"
|
placeholder="请输入菜地编号"
|
||||||
@ -9,29 +19,15 @@
|
|||||||
@keyup.enter.native="handleQuery"
|
@keyup.enter.native="handleQuery"
|
||||||
/>
|
/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="分区代码" prop="zoneCode">
|
<el-form-item label="竣工" prop="isCompleted">
|
||||||
<el-input
|
<el-select v-model="queryParams.isCompleted" placeholder="请选择竣工" clearable>
|
||||||
v-model="queryParams.zoneCode"
|
<el-option
|
||||||
placeholder="请输入分区代码"
|
v-for="dict in dict.type.sys_yes_no"
|
||||||
clearable
|
:key="dict.value"
|
||||||
@keyup.enter.native="handleQuery"
|
:label="dict.label"
|
||||||
/>
|
:value="dict.value"
|
||||||
</el-form-item>
|
/>
|
||||||
<el-form-item label="菜地名称" prop="name">
|
</el-select>
|
||||||
<el-input
|
|
||||||
v-model="queryParams.name"
|
|
||||||
placeholder="请输入菜地名称"
|
|
||||||
clearable
|
|
||||||
@keyup.enter.native="handleQuery"
|
|
||||||
/>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="竣工状态" prop="isCompleted">
|
|
||||||
<el-input
|
|
||||||
v-model="queryParams.isCompleted"
|
|
||||||
placeholder="请输入竣工状态"
|
|
||||||
clearable
|
|
||||||
@keyup.enter.native="handleQuery"
|
|
||||||
/>
|
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
|
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
|
||||||
@ -82,16 +78,55 @@
|
|||||||
v-hasPermi="['csa:garden:export']"
|
v-hasPermi="['csa:garden:export']"
|
||||||
>导出</el-button>
|
>导出</el-button>
|
||||||
</el-col>
|
</el-col>
|
||||||
|
<el-col :span="1.5">
|
||||||
|
<el-button
|
||||||
|
type="success"
|
||||||
|
plain
|
||||||
|
icon="el-icon-finished"
|
||||||
|
size="mini"
|
||||||
|
@click="handleComplete"
|
||||||
|
v-hasPermi="['csa:garden:edit']"
|
||||||
|
>竣工</el-button>
|
||||||
|
</el-col>
|
||||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
||||||
</el-row>
|
</el-row>
|
||||||
|
|
||||||
<el-table v-loading="loading" :data="gardenList" @selection-change="handleSelectionChange">
|
<el-table v-loading="loading" :data="gardenList" @selection-change="handleSelectionChange">
|
||||||
<el-table-column type="selection" width="55" align="center" />
|
<el-table-column type="selection" width="55" align="center" />
|
||||||
<el-table-column label="菜地编号" align="center" prop="code" />
|
<el-table-column label="农场分区" align="center" prop="zoneId" />
|
||||||
<el-table-column label="分区代码" align="center" prop="zoneCode" />
|
<el-table-column label="菜地编号" align="center" prop="code">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<el-tag
|
||||||
|
:key="scope.row.code"
|
||||||
|
:type="scope.row.isCompleted == 'Y' ? 'success' : 'warning'" effect="plain">
|
||||||
|
{{ scope.row.code }}
|
||||||
|
</el-tag>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
<el-table-column label="菜地名称" align="center" prop="name" />
|
<el-table-column label="菜地名称" align="center" prop="name" />
|
||||||
<el-table-column label="平方米" align="center" prop="m2" />
|
<el-table-column label="平方米" align="center" prop="m2" />
|
||||||
<el-table-column label="竣工状态" align="center" prop="isCompleted" />
|
<el-table-column label="会员" align="center" prop="memberId" />
|
||||||
|
<el-table-column label="管理员" align="center" prop="managerId" />
|
||||||
|
<el-table-column label="耕作" align="center" prop="isFarming">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<dict-tag :options="dict.type.sys_yes_no" :value="scope.row.isFarming"/>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="售出" align="center" prop="isSelled">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<dict-tag :options="dict.type.sys_yes_no" :value="scope.row.isSelled"/>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="竣工" align="center" prop="isCompleted">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<dict-tag :options="dict.type.sys_yes_no" :value="scope.row.isCompleted"/>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="状态" align="center" prop="status">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<dict-tag :options="dict.type.sys_normal_disable" :value="scope.row.status"/>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
<el-table-column label="备注" align="center" prop="remark" />
|
<el-table-column label="备注" align="center" prop="remark" />
|
||||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
@ -99,6 +134,7 @@
|
|||||||
size="mini"
|
size="mini"
|
||||||
type="text"
|
type="text"
|
||||||
icon="el-icon-edit"
|
icon="el-icon-edit"
|
||||||
|
:disabled="scope.row.isCompleted == 'Y'"
|
||||||
@click="handleUpdate(scope.row)"
|
@click="handleUpdate(scope.row)"
|
||||||
v-hasPermi="['csa:garden:edit']"
|
v-hasPermi="['csa:garden:edit']"
|
||||||
>修改</el-button>
|
>修改</el-button>
|
||||||
@ -106,6 +142,7 @@
|
|||||||
size="mini"
|
size="mini"
|
||||||
type="text"
|
type="text"
|
||||||
icon="el-icon-delete"
|
icon="el-icon-delete"
|
||||||
|
:disabled="scope.row.isCompleted == 'Y'"
|
||||||
@click="handleDelete(scope.row)"
|
@click="handleDelete(scope.row)"
|
||||||
v-hasPermi="['csa:garden:remove']"
|
v-hasPermi="['csa:garden:remove']"
|
||||||
>删除</el-button>
|
>删除</el-button>
|
||||||
@ -124,20 +161,24 @@
|
|||||||
<!-- 添加或修改菜地划分对话框 -->
|
<!-- 添加或修改菜地划分对话框 -->
|
||||||
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
|
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
|
||||||
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
|
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
|
||||||
|
<el-form-item label="农场分区" prop="zoneId">
|
||||||
|
<el-select v-model="form.zoneId" placeholder="请选择农场分区" clearable>
|
||||||
|
<el-option
|
||||||
|
v-for="zone in farmzoneList"
|
||||||
|
:key="zone.id"
|
||||||
|
:label="zone.name"
|
||||||
|
:value="zone.id"
|
||||||
|
/>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
<el-form-item label="菜地编号" prop="code">
|
<el-form-item label="菜地编号" prop="code">
|
||||||
<el-input v-model="form.code" placeholder="请输入菜地编号" />
|
<el-input v-model="form.code" placeholder="请输入菜地编号" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="农场分区" prop="zoneCode">
|
|
||||||
<el-input v-model="form.zoneCode" placeholder="请输入分区代码" />
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="菜地名称" prop="name">
|
|
||||||
<el-input v-model="form.name" placeholder="请输入菜地名称" />
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="平方米" prop="m2">
|
<el-form-item label="平方米" prop="m2">
|
||||||
<el-input v-model="form.m2" placeholder="请输入平方米" />
|
<el-input v-model="form.m2" placeholder="请输入平方米" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="备注" prop="remark">
|
<el-form-item label="备注" prop="remark">
|
||||||
<el-input v-model="form.remark" type="textarea" placeholder="请输入内容" />
|
<el-input v-model="form.remark" type="textarea" placeholder="请输入备注" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-form>
|
</el-form>
|
||||||
<div slot="footer" class="dialog-footer">
|
<div slot="footer" class="dialog-footer">
|
||||||
@ -149,175 +190,175 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { listGarden, getGarden, delGarden, addGarden, updateGarden } from "@/api/csa/garden";
|
import { listFarmzone } from "@/api/csa/farmzone";
|
||||||
|
import { listGarden, getGarden, delGarden, addGarden, updateGarden, updateGardenStatus } from "@/api/csa/garden";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "Garden",
|
name: "Garden",
|
||||||
data() {
|
dicts: ['sys_normal_disable', 'sys_yes_no'],
|
||||||
return {
|
data() {
|
||||||
// 遮罩层
|
return {
|
||||||
loading: true,
|
// 遮罩层
|
||||||
// 选中数组
|
loading: true,
|
||||||
ids: [],
|
// 选中数组
|
||||||
// 非单个禁用
|
ids: [],
|
||||||
single: true,
|
// 非单个禁用
|
||||||
// 非多个禁用
|
single: true,
|
||||||
multiple: true,
|
// 非多个禁用
|
||||||
// 显示搜索条件
|
multiple: true,
|
||||||
showSearch: true,
|
// 显示搜索条件
|
||||||
// 总条数
|
showSearch: true,
|
||||||
total: 0,
|
// 总条数
|
||||||
// 菜地划分表格数据
|
total: 0,
|
||||||
gardenList: [],
|
// 农场分区列表
|
||||||
// 弹出层标题
|
farmzoneList: [],
|
||||||
title: "",
|
// 菜地划分表格数据
|
||||||
// 是否显示弹出层
|
gardenList: [],
|
||||||
open: false,
|
// 弹出层标题
|
||||||
// 查询参数
|
title: "",
|
||||||
queryParams: {
|
// 是否显示弹出层
|
||||||
pageNum: 1,
|
open: false,
|
||||||
pageSize: 10,
|
// 查询参数
|
||||||
code: null,
|
queryParams: {
|
||||||
zoneCode: null,
|
pageNum: 1,
|
||||||
name: null,
|
pageSize: 20,
|
||||||
memberId: null,
|
zoneId: null,
|
||||||
managerId: null,
|
code: null,
|
||||||
workerId: null,
|
isCompleted: null
|
||||||
contacterId: null,
|
},
|
||||||
isFarming: null,
|
// 表单参数
|
||||||
isSelled: null,
|
form: {},
|
||||||
isCompleted: null,
|
// 表单校验
|
||||||
},
|
rules: {
|
||||||
// 表单参数
|
zoneId: [
|
||||||
form: {},
|
{ required: true, message: "农场分区不能为空", trigger: "blur" }
|
||||||
// 表单校验
|
],
|
||||||
rules: {
|
code: [
|
||||||
code: [
|
{ required: true, message: "菜地编号不能为空", trigger: "blur" }
|
||||||
{ required: true, message: "菜地编号不能为空", trigger: "blur" }
|
],
|
||||||
],
|
m2: [
|
||||||
zoneCode: [
|
{ required: true, message: "平方米不能为空", trigger: "blur" }
|
||||||
{ required: true, message: "分区代码不能为空", trigger: "blur" }
|
]
|
||||||
],
|
}
|
||||||
name: [
|
|
||||||
{ required: true, message: "菜地名称不能为空", trigger: "blur" }
|
|
||||||
],
|
|
||||||
m2: [
|
|
||||||
{ required: true, message: "平方米不能为空", trigger: "blur" }
|
|
||||||
],
|
|
||||||
coins: [
|
|
||||||
{ required: true, message: "金币不能为空", trigger: "blur" }
|
|
||||||
],
|
|
||||||
}
|
|
||||||
};
|
|
||||||
},
|
|
||||||
created() {
|
|
||||||
this.getList();
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
/** 查询菜地划分列表 */
|
|
||||||
getList() {
|
|
||||||
this.loading = true;
|
|
||||||
listGarden(this.queryParams).then(response => {
|
|
||||||
this.gardenList = response.rows;
|
|
||||||
this.total = response.total;
|
|
||||||
this.loading = false;
|
|
||||||
});
|
|
||||||
},
|
|
||||||
// 取消按钮
|
|
||||||
cancel() {
|
|
||||||
this.open = false;
|
|
||||||
this.reset();
|
|
||||||
},
|
|
||||||
// 表单重置
|
|
||||||
reset() {
|
|
||||||
this.form = {
|
|
||||||
id: null,
|
|
||||||
code: null,
|
|
||||||
zoneCode: null,
|
|
||||||
name: null,
|
|
||||||
m2: null,
|
|
||||||
memberId: null,
|
|
||||||
managerId: null,
|
|
||||||
workerId: null,
|
|
||||||
contacterId: null,
|
|
||||||
coins: null,
|
|
||||||
isFarming: null,
|
|
||||||
isSelled: null,
|
|
||||||
isCompleted: null,
|
|
||||||
status: "0",
|
|
||||||
delFlag: null,
|
|
||||||
remark: null
|
|
||||||
};
|
};
|
||||||
this.resetForm("form");
|
|
||||||
},
|
},
|
||||||
/** 搜索按钮操作 */
|
created() {
|
||||||
handleQuery() {
|
this.getZoneList();
|
||||||
this.queryParams.pageNum = 1;
|
|
||||||
this.getList();
|
this.getList();
|
||||||
},
|
},
|
||||||
/** 重置按钮操作 */
|
methods: {
|
||||||
resetQuery() {
|
/** 查询农场分区列表 */
|
||||||
this.resetForm("queryForm");
|
getZoneList() {
|
||||||
this.handleQuery();
|
this.loading = true;
|
||||||
},
|
listFarmzone(null).then(response => {
|
||||||
// 多选框选中数据
|
this.farmzoneList = response.rows;
|
||||||
handleSelectionChange(selection) {
|
this.loading = false;
|
||||||
this.ids = selection.map(item => item.id)
|
});
|
||||||
this.single = selection.length!==1
|
},
|
||||||
this.multiple = !selection.length
|
/** 查询菜地划分列表 */
|
||||||
},
|
getList() {
|
||||||
/** 新增按钮操作 */
|
this.loading = true;
|
||||||
handleAdd() {
|
listGarden(this.queryParams).then(response => {
|
||||||
this.reset();
|
this.gardenList = response.rows;
|
||||||
this.open = true;
|
this.total = response.total;
|
||||||
this.title = "添加菜地划分";
|
this.loading = false;
|
||||||
},
|
});
|
||||||
/** 修改按钮操作 */
|
},
|
||||||
handleUpdate(row) {
|
// 取消按钮
|
||||||
this.reset();
|
cancel() {
|
||||||
const id = row.id || this.ids
|
this.open = false;
|
||||||
getGarden(id).then(response => {
|
this.reset();
|
||||||
this.form = response.data;
|
},
|
||||||
this.open = true;
|
// 表单重置
|
||||||
this.title = "修改菜地划分";
|
reset() {
|
||||||
});
|
this.form = {
|
||||||
},
|
id: null,
|
||||||
/** 提交按钮 */
|
zoneId: null,
|
||||||
submitForm() {
|
code: null,
|
||||||
this.$refs["form"].validate(valid => {
|
m2: null,
|
||||||
if (valid) {
|
isCompleted: "N",
|
||||||
if (this.form.id != null) {
|
remark: null
|
||||||
updateGarden(this.form).then(response => {
|
};
|
||||||
this.$modal.msgSuccess("修改成功");
|
this.resetForm("form");
|
||||||
this.open = false;
|
},
|
||||||
this.getList();
|
/** 搜索按钮操作 */
|
||||||
});
|
handleQuery() {
|
||||||
} else {
|
this.queryParams.pageNum = 1;
|
||||||
addGarden(this.form).then(response => {
|
|
||||||
this.$modal.msgSuccess("新增成功");
|
|
||||||
this.open = false;
|
|
||||||
this.getList();
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
},
|
|
||||||
/** 删除按钮操作 */
|
|
||||||
handleDelete(row) {
|
|
||||||
const ids = row.id || this.ids;
|
|
||||||
this.$modal.confirm('是否确认删除菜地Id为"' + ids + '"的数据项?').then(function() {
|
|
||||||
return delGarden(ids);
|
|
||||||
}).then(() => {
|
|
||||||
this.getList();
|
this.getList();
|
||||||
this.$modal.msgSuccess("删除成功");
|
},
|
||||||
}).catch(() => {});
|
/** 重置按钮操作 */
|
||||||
},
|
resetQuery() {
|
||||||
/** 导出按钮操作 */
|
this.resetForm("queryForm");
|
||||||
handleExport() {
|
this.handleQuery();
|
||||||
this.download('csa/garden/export', {
|
},
|
||||||
...this.queryParams
|
// 多选框选中数据
|
||||||
}, `garden_${new Date().getTime()}.xlsx`)
|
handleSelectionChange(selection) {
|
||||||
|
this.ids = selection.map(item => item.id)
|
||||||
|
this.single = selection.length!==1
|
||||||
|
this.multiple = !selection.length
|
||||||
|
},
|
||||||
|
/** 新增按钮操作 */
|
||||||
|
handleAdd() {
|
||||||
|
this.reset();
|
||||||
|
this.open = true;
|
||||||
|
this.title = "添加菜地划分";
|
||||||
|
},
|
||||||
|
/** 修改按钮操作 */
|
||||||
|
handleUpdate(row) {
|
||||||
|
this.reset();
|
||||||
|
const id = row.id || this.ids
|
||||||
|
getGarden(id).then(response => {
|
||||||
|
this.form = response.data;
|
||||||
|
this.open = true;
|
||||||
|
this.title = "修改菜地划分";
|
||||||
|
});
|
||||||
|
},
|
||||||
|
/** 提交按钮 */
|
||||||
|
submitForm() {
|
||||||
|
this.$refs["form"].validate(valid => {
|
||||||
|
if (valid) {
|
||||||
|
if (this.form.id != null) {
|
||||||
|
updateGarden(this.form).then(response => {
|
||||||
|
this.$modal.msgSuccess("修改成功");
|
||||||
|
this.open = false;
|
||||||
|
this.getList();
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
addGarden(this.form).then(response => {
|
||||||
|
this.$modal.msgSuccess("新增成功");
|
||||||
|
this.open = false;
|
||||||
|
this.getList();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
/** 删除按钮操作 */
|
||||||
|
handleDelete(row) {
|
||||||
|
const ids = row.id || this.ids;
|
||||||
|
this.$modal.confirm('是否确认删除选择的菜地?').then(function() {
|
||||||
|
return delGarden(ids);
|
||||||
|
}).then(() => {
|
||||||
|
this.getList();
|
||||||
|
this.$modal.msgSuccess("删除成功");
|
||||||
|
}).catch(() => {});
|
||||||
|
},
|
||||||
|
/** 导出按钮操作 */
|
||||||
|
handleExport() {
|
||||||
|
this.download('csa/garden/export', {
|
||||||
|
...this.queryParams
|
||||||
|
}, `garden_${new Date().getTime()}.xlsx`)
|
||||||
|
},
|
||||||
|
/** 设为竣工 */
|
||||||
|
handleComplete(row) {
|
||||||
|
const ids = row.id || this.ids;
|
||||||
|
this.$modal.confirm('竣工后分区、编号和面积将不可更改!是否要将选择的菜地设为竣工状态?').then(function() {
|
||||||
|
return updateGardenStatus({isCompleted: 'Y'}, ids);
|
||||||
|
}).then(() => {
|
||||||
|
this.getList();
|
||||||
|
this.$modal.msgSuccess("竣工设置成功");
|
||||||
|
}).catch(() => {});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
};
|
|
||||||
</script>
|
</script>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user