设置顶部导航菜单、固定头部。
添加园区规划的农场分区、菜地划分,其中菜地划分暂未调通。 备份csa.sql开发数据库。
This commit is contained in:
@ -0,0 +1,104 @@
|
||||
package com.jlt.csa.controller;
|
||||
|
||||
import java.util.List;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.PutMapping;
|
||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import com.ruoyi.common.annotation.Log;
|
||||
import com.ruoyi.common.core.controller.BaseController;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.common.enums.BusinessType;
|
||||
import com.jlt.csa.domain.Garden;
|
||||
import com.jlt.csa.service.IGardenService;
|
||||
import com.ruoyi.common.utils.poi.ExcelUtil;
|
||||
import com.ruoyi.common.core.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* 菜地划分Controller
|
||||
*
|
||||
* @author 郏磊涛
|
||||
* @date 2022-03-24
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/csa/garden")
|
||||
public class GardenController extends BaseController
|
||||
{
|
||||
@Autowired
|
||||
private IGardenService gardenService;
|
||||
|
||||
/**
|
||||
* 查询菜地划分列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('csa:garden:list')")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(Garden garden)
|
||||
{
|
||||
startPage();
|
||||
List<Garden> list = gardenService.selectGardenList(garden);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出菜地划分列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('csa:garden:export')")
|
||||
@Log(title = "菜地划分", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, Garden garden)
|
||||
{
|
||||
List<Garden> list = gardenService.selectGardenList(garden);
|
||||
ExcelUtil<Garden> util = new ExcelUtil<Garden>(Garden.class);
|
||||
util.exportExcel(response, list, "菜地划分数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取菜地划分详细信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('csa:garden:query')")
|
||||
@GetMapping(value = "/{id}")
|
||||
public AjaxResult getInfo(@PathVariable("id") Long id)
|
||||
{
|
||||
return AjaxResult.success(gardenService.selectGardenById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增菜地划分
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('csa:garden:add')")
|
||||
@Log(title = "菜地划分", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody Garden garden)
|
||||
{
|
||||
return toAjax(gardenService.insertGarden(garden));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改菜地划分
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('csa:garden:edit')")
|
||||
@Log(title = "菜地划分", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody Garden garden)
|
||||
{
|
||||
return toAjax(gardenService.updateGarden(garden));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除菜地划分
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('csa:garden:remove')")
|
||||
@Log(title = "菜地划分", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public AjaxResult remove(@PathVariable Long[] ids)
|
||||
{
|
||||
return toAjax(gardenService.deleteGardenByIds(ids));
|
||||
}
|
||||
}
|
@ -0,0 +1,104 @@
|
||||
package com.jlt.csa.controller;
|
||||
|
||||
import java.util.List;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.PutMapping;
|
||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import com.ruoyi.common.annotation.Log;
|
||||
import com.ruoyi.common.core.controller.BaseController;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.common.enums.BusinessType;
|
||||
import com.jlt.csa.domain.Zone;
|
||||
import com.jlt.csa.service.IZoneService;
|
||||
import com.ruoyi.common.utils.poi.ExcelUtil;
|
||||
import com.ruoyi.common.core.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* 农场分区Controller
|
||||
*
|
||||
* @author 郏磊涛
|
||||
* @date 2022-03-24
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/csa/zone")
|
||||
public class ZoneController extends BaseController
|
||||
{
|
||||
@Autowired
|
||||
private IZoneService zoneService;
|
||||
|
||||
/**
|
||||
* 查询农场分区列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('csa:zone:list')")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(Zone zone)
|
||||
{
|
||||
startPage();
|
||||
List<Zone> list = zoneService.selectZoneList(zone);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出农场分区列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('csa:zone:export')")
|
||||
@Log(title = "农场分区", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, Zone zone)
|
||||
{
|
||||
List<Zone> list = zoneService.selectZoneList(zone);
|
||||
ExcelUtil<Zone> util = new ExcelUtil<Zone>(Zone.class);
|
||||
util.exportExcel(response, list, "农场分区数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取农场分区详细信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('csa:zone:query')")
|
||||
@GetMapping(value = "/{code}")
|
||||
public AjaxResult getInfo(@PathVariable("code") String code)
|
||||
{
|
||||
return AjaxResult.success(zoneService.selectZoneByCode(code));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增农场分区
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('csa:zone:add')")
|
||||
@Log(title = "农场分区", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody Zone zone)
|
||||
{
|
||||
return toAjax(zoneService.insertZone(zone));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改农场分区
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('csa:zone:edit')")
|
||||
@Log(title = "农场分区", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody Zone zone)
|
||||
{
|
||||
return toAjax(zoneService.updateZone(zone));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除农场分区
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('csa:zone:remove')")
|
||||
@Log(title = "农场分区", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{codes}")
|
||||
public AjaxResult remove(@PathVariable String[] codes)
|
||||
{
|
||||
return toAjax(zoneService.deleteZoneByCodes(codes));
|
||||
}
|
||||
}
|
231
private-farm/src/main/java/com/jlt/csa/domain/Garden.java
Normal file
231
private-farm/src/main/java/com/jlt/csa/domain/Garden.java
Normal file
@ -0,0 +1,231 @@
|
||||
package com.jlt.csa.domain;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
import com.ruoyi.common.annotation.Excel;
|
||||
import com.ruoyi.common.core.domain.BaseEntity;
|
||||
|
||||
/**
|
||||
* 菜地划分对象 csa_garden
|
||||
*
|
||||
* @author 郏磊涛
|
||||
* @date 2022-03-24
|
||||
*/
|
||||
public class Garden extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** $column.columnComment */
|
||||
private Long id;
|
||||
|
||||
/** 菜地编号 */
|
||||
@Excel(name = "菜地编号")
|
||||
private String code;
|
||||
|
||||
/** 分区代码 */
|
||||
@Excel(name = "分区代码")
|
||||
private String zoneCode;
|
||||
|
||||
/** 菜地名称 */
|
||||
@Excel(name = "菜地名称")
|
||||
private String name;
|
||||
|
||||
/** 平方米 */
|
||||
@Excel(name = "平方米")
|
||||
private BigDecimal m2;
|
||||
|
||||
/** 会员id */
|
||||
private Long memberId;
|
||||
|
||||
/** 菜地管理员id */
|
||||
private Long managerId;
|
||||
|
||||
/** 工人id */
|
||||
private Long workerId;
|
||||
|
||||
/** 客服人员id */
|
||||
private Long contacterId;
|
||||
|
||||
/** 金币 */
|
||||
@Excel(name = "金币")
|
||||
private BigDecimal coins;
|
||||
|
||||
/** 耕作状态 */
|
||||
private String isFarming;
|
||||
|
||||
/** 售出状态 */
|
||||
private String isSelled;
|
||||
|
||||
/** 竣工状态 */
|
||||
@Excel(name = "竣工状态")
|
||||
private String isCompleted;
|
||||
|
||||
/** 状态(0正常 1停用) */
|
||||
private String status;
|
||||
|
||||
/** 删除标志(0代表存在 2代表删除) */
|
||||
private String delFlag;
|
||||
|
||||
public void setId(Long id)
|
||||
{
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public Long getId()
|
||||
{
|
||||
return id;
|
||||
}
|
||||
public void setCode(String code)
|
||||
{
|
||||
this.code = code;
|
||||
}
|
||||
|
||||
public String getCode()
|
||||
{
|
||||
return code;
|
||||
}
|
||||
public void setZoneCode(String zoneCode)
|
||||
{
|
||||
this.zoneCode = zoneCode;
|
||||
}
|
||||
|
||||
public String getZoneCode()
|
||||
{
|
||||
return zoneCode;
|
||||
}
|
||||
public void setName(String name)
|
||||
{
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public String getName()
|
||||
{
|
||||
return name;
|
||||
}
|
||||
public void setM2(BigDecimal m2)
|
||||
{
|
||||
this.m2 = m2;
|
||||
}
|
||||
|
||||
public BigDecimal getM2()
|
||||
{
|
||||
return m2;
|
||||
}
|
||||
public void setMemberId(Long memberId)
|
||||
{
|
||||
this.memberId = memberId;
|
||||
}
|
||||
|
||||
public Long getMemberId()
|
||||
{
|
||||
return memberId;
|
||||
}
|
||||
public void setManagerId(Long managerId)
|
||||
{
|
||||
this.managerId = managerId;
|
||||
}
|
||||
|
||||
public Long getManagerId()
|
||||
{
|
||||
return managerId;
|
||||
}
|
||||
public void setWorkerId(Long workerId)
|
||||
{
|
||||
this.workerId = workerId;
|
||||
}
|
||||
|
||||
public Long getWorkerId()
|
||||
{
|
||||
return workerId;
|
||||
}
|
||||
public void setContacterId(Long contacterId)
|
||||
{
|
||||
this.contacterId = contacterId;
|
||||
}
|
||||
|
||||
public Long getContacterId()
|
||||
{
|
||||
return contacterId;
|
||||
}
|
||||
public void setCoins(BigDecimal coins)
|
||||
{
|
||||
this.coins = coins;
|
||||
}
|
||||
|
||||
public BigDecimal getCoins()
|
||||
{
|
||||
return coins;
|
||||
}
|
||||
public void setIsFarming(String isFarming)
|
||||
{
|
||||
this.isFarming = isFarming;
|
||||
}
|
||||
|
||||
public String getIsFarming()
|
||||
{
|
||||
return isFarming;
|
||||
}
|
||||
public void setIsSelled(String isSelled)
|
||||
{
|
||||
this.isSelled = isSelled;
|
||||
}
|
||||
|
||||
public String getIsSelled()
|
||||
{
|
||||
return isSelled;
|
||||
}
|
||||
public void setIsCompleted(String isCompleted)
|
||||
{
|
||||
this.isCompleted = isCompleted;
|
||||
}
|
||||
|
||||
public String getIsCompleted()
|
||||
{
|
||||
return isCompleted;
|
||||
}
|
||||
public void setStatus(String status)
|
||||
{
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
public String getStatus()
|
||||
{
|
||||
return status;
|
||||
}
|
||||
public void setDelFlag(String delFlag)
|
||||
{
|
||||
this.delFlag = delFlag;
|
||||
}
|
||||
|
||||
public String getDelFlag()
|
||||
{
|
||||
return delFlag;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("id", getId())
|
||||
.append("code", getCode())
|
||||
.append("zoneCode", getZoneCode())
|
||||
.append("name", getName())
|
||||
.append("m2", getM2())
|
||||
.append("memberId", getMemberId())
|
||||
.append("managerId", getManagerId())
|
||||
.append("workerId", getWorkerId())
|
||||
.append("contacterId", getContacterId())
|
||||
.append("coins", getCoins())
|
||||
.append("isFarming", getIsFarming())
|
||||
.append("isSelled", getIsSelled())
|
||||
.append("isCompleted", getIsCompleted())
|
||||
.append("status", getStatus())
|
||||
.append("delFlag", getDelFlag())
|
||||
.append("createBy", getCreateBy())
|
||||
.append("createTime", getCreateTime())
|
||||
.append("updateBy", getUpdateBy())
|
||||
.append("updateTime", getUpdateTime())
|
||||
.append("remark", getRemark())
|
||||
.toString();
|
||||
}
|
||||
}
|
84
private-farm/src/main/java/com/jlt/csa/domain/Zone.java
Normal file
84
private-farm/src/main/java/com/jlt/csa/domain/Zone.java
Normal file
@ -0,0 +1,84 @@
|
||||
package com.jlt.csa.domain;
|
||||
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
import com.ruoyi.common.annotation.Excel;
|
||||
import com.ruoyi.common.core.domain.BaseEntity;
|
||||
|
||||
/**
|
||||
* 农场分区对象 csa_zone
|
||||
*
|
||||
* @author 郏磊涛
|
||||
* @date 2022-03-24
|
||||
*/
|
||||
public class Zone extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 分区代码 */
|
||||
@Excel(name = "分区代码")
|
||||
private String code;
|
||||
|
||||
/** 分区名称 */
|
||||
@Excel(name = "分区名称")
|
||||
private String name;
|
||||
|
||||
/** 状态 */
|
||||
@Excel(name = "状态")
|
||||
private String status;
|
||||
|
||||
/** 删除标志 */
|
||||
private String delFlag;
|
||||
|
||||
public void setCode(String code)
|
||||
{
|
||||
this.code = code;
|
||||
}
|
||||
|
||||
public String getCode()
|
||||
{
|
||||
return code;
|
||||
}
|
||||
public void setName(String name)
|
||||
{
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public String getName()
|
||||
{
|
||||
return name;
|
||||
}
|
||||
public void setStatus(String status)
|
||||
{
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
public String getStatus()
|
||||
{
|
||||
return status;
|
||||
}
|
||||
public void setDelFlag(String delFlag)
|
||||
{
|
||||
this.delFlag = delFlag;
|
||||
}
|
||||
|
||||
public String getDelFlag()
|
||||
{
|
||||
return delFlag;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("code", getCode())
|
||||
.append("name", getName())
|
||||
.append("status", getStatus())
|
||||
.append("delFlag", getDelFlag())
|
||||
.append("createBy", getCreateBy())
|
||||
.append("createTime", getCreateTime())
|
||||
.append("updateBy", getUpdateBy())
|
||||
.append("updateTime", getUpdateTime())
|
||||
.append("remark", getRemark())
|
||||
.toString();
|
||||
}
|
||||
}
|
@ -0,0 +1,61 @@
|
||||
package com.jlt.csa.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import com.jlt.csa.domain.Garden;
|
||||
|
||||
/**
|
||||
* 菜地划分Mapper接口
|
||||
*
|
||||
* @author 郏磊涛
|
||||
* @date 2022-03-24
|
||||
*/
|
||||
public interface GardenMapper
|
||||
{
|
||||
/**
|
||||
* 查询菜地划分
|
||||
*
|
||||
* @param id 菜地划分主键
|
||||
* @return 菜地划分
|
||||
*/
|
||||
public Garden selectGardenById(Long id);
|
||||
|
||||
/**
|
||||
* 查询菜地划分列表
|
||||
*
|
||||
* @param garden 菜地划分
|
||||
* @return 菜地划分集合
|
||||
*/
|
||||
public List<Garden> selectGardenList(Garden garden);
|
||||
|
||||
/**
|
||||
* 新增菜地划分
|
||||
*
|
||||
* @param garden 菜地划分
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertGarden(Garden garden);
|
||||
|
||||
/**
|
||||
* 修改菜地划分
|
||||
*
|
||||
* @param garden 菜地划分
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateGarden(Garden garden);
|
||||
|
||||
/**
|
||||
* 删除菜地划分
|
||||
*
|
||||
* @param id 菜地划分主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteGardenById(Long id);
|
||||
|
||||
/**
|
||||
* 批量删除菜地划分
|
||||
*
|
||||
* @param ids 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteGardenByIds(Long[] ids);
|
||||
}
|
@ -0,0 +1,61 @@
|
||||
package com.jlt.csa.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import com.jlt.csa.domain.Zone;
|
||||
|
||||
/**
|
||||
* 农场分区Mapper接口
|
||||
*
|
||||
* @author 郏磊涛
|
||||
* @date 2022-03-24
|
||||
*/
|
||||
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);
|
||||
}
|
@ -0,0 +1,61 @@
|
||||
package com.jlt.csa.service;
|
||||
|
||||
import java.util.List;
|
||||
import com.jlt.csa.domain.Garden;
|
||||
|
||||
/**
|
||||
* 菜地划分Service接口
|
||||
*
|
||||
* @author 郏磊涛
|
||||
* @date 2022-03-24
|
||||
*/
|
||||
public interface IGardenService
|
||||
{
|
||||
/**
|
||||
* 查询菜地划分
|
||||
*
|
||||
* @param id 菜地划分主键
|
||||
* @return 菜地划分
|
||||
*/
|
||||
public Garden selectGardenById(Long id);
|
||||
|
||||
/**
|
||||
* 查询菜地划分列表
|
||||
*
|
||||
* @param garden 菜地划分
|
||||
* @return 菜地划分集合
|
||||
*/
|
||||
public List<Garden> selectGardenList(Garden garden);
|
||||
|
||||
/**
|
||||
* 新增菜地划分
|
||||
*
|
||||
* @param garden 菜地划分
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertGarden(Garden garden);
|
||||
|
||||
/**
|
||||
* 修改菜地划分
|
||||
*
|
||||
* @param garden 菜地划分
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateGarden(Garden garden);
|
||||
|
||||
/**
|
||||
* 批量删除菜地划分
|
||||
*
|
||||
* @param ids 需要删除的菜地划分主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteGardenByIds(Long[] ids);
|
||||
|
||||
/**
|
||||
* 删除菜地划分信息
|
||||
*
|
||||
* @param id 菜地划分主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteGardenById(Long id);
|
||||
}
|
@ -0,0 +1,61 @@
|
||||
package com.jlt.csa.service;
|
||||
|
||||
import java.util.List;
|
||||
import com.jlt.csa.domain.Zone;
|
||||
|
||||
/**
|
||||
* 农场分区Service接口
|
||||
*
|
||||
* @author 郏磊涛
|
||||
* @date 2022-03-24
|
||||
*/
|
||||
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);
|
||||
}
|
@ -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.GardenMapper;
|
||||
import com.jlt.csa.domain.Garden;
|
||||
import com.jlt.csa.service.IGardenService;
|
||||
|
||||
/**
|
||||
* 菜地划分Service业务层处理
|
||||
*
|
||||
* @author 郏磊涛
|
||||
* @date 2022-03-24
|
||||
*/
|
||||
@Service
|
||||
public class GardenServiceImpl implements IGardenService
|
||||
{
|
||||
@Autowired
|
||||
private GardenMapper gardenMapper;
|
||||
|
||||
/**
|
||||
* 查询菜地划分
|
||||
*
|
||||
* @param id 菜地划分主键
|
||||
* @return 菜地划分
|
||||
*/
|
||||
@Override
|
||||
public Garden selectGardenById(Long id)
|
||||
{
|
||||
return gardenMapper.selectGardenById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询菜地划分列表
|
||||
*
|
||||
* @param garden 菜地划分
|
||||
* @return 菜地划分
|
||||
*/
|
||||
@Override
|
||||
public List<Garden> selectGardenList(Garden garden)
|
||||
{
|
||||
return gardenMapper.selectGardenList(garden);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增菜地划分
|
||||
*
|
||||
* @param garden 菜地划分
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertGarden(Garden garden)
|
||||
{
|
||||
garden.setCreateTime(DateUtils.getNowDate());
|
||||
return gardenMapper.insertGarden(garden);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改菜地划分
|
||||
*
|
||||
* @param garden 菜地划分
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateGarden(Garden garden)
|
||||
{
|
||||
garden.setUpdateTime(DateUtils.getNowDate());
|
||||
return gardenMapper.updateGarden(garden);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除菜地划分
|
||||
*
|
||||
* @param ids 需要删除的菜地划分主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteGardenByIds(Long[] ids)
|
||||
{
|
||||
return gardenMapper.deleteGardenByIds(ids);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除菜地划分信息
|
||||
*
|
||||
* @param id 菜地划分主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteGardenById(Long id)
|
||||
{
|
||||
return gardenMapper.deleteGardenById(id);
|
||||
}
|
||||
}
|
@ -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.ZoneMapper;
|
||||
import com.jlt.csa.domain.Zone;
|
||||
import com.jlt.csa.service.IZoneService;
|
||||
|
||||
/**
|
||||
* 农场分区Service业务层处理
|
||||
*
|
||||
* @author 郏磊涛
|
||||
* @date 2022-03-24
|
||||
*/
|
||||
@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);
|
||||
}
|
||||
}
|
139
private-farm/src/main/resources/mapper/csa/GardenMapper.xml
Normal file
139
private-farm/src/main/resources/mapper/csa/GardenMapper.xml
Normal file
@ -0,0 +1,139 @@
|
||||
<?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.GardenMapper">
|
||||
|
||||
<resultMap type="Garden" id="GardenResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="code" column="code" />
|
||||
<result property="zoneCode" column="zone_code" />
|
||||
<result property="name" column="name" />
|
||||
<result property="m2" column="m2" />
|
||||
<result property="memberId" column="member_id" />
|
||||
<result property="managerId" column="manager_id" />
|
||||
<result property="workerId" column="worker_id" />
|
||||
<result property="contacterId" column="contacter_id" />
|
||||
<result property="coins" column="coins" />
|
||||
<result property="isFarming" column="is_farming" />
|
||||
<result property="isSelled" column="is_selled" />
|
||||
<result property="isCompleted" column="is_completed" />
|
||||
<result property="status" column="status" />
|
||||
<result property="delFlag" column="del_flag" />
|
||||
<result property="createBy" column="create_by" />
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="updateBy" column="update_by" />
|
||||
<result property="updateTime" column="update_time" />
|
||||
<result property="remark" column="remark" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectGardenVo">
|
||||
select id, code, zone_code, name, m2, member_id, manager_id, worker_id, contacter_id, coins, is_farming, is_selled, is_completed, status, del_flag, create_by, create_time, update_by, update_time, remark from csa_garden
|
||||
</sql>
|
||||
|
||||
<select id="selectGardenList" parameterType="Garden" resultMap="GardenResult">
|
||||
<include refid="selectGardenVo"/>
|
||||
<where>
|
||||
<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="memberId != null "> and member_id = #{memberId}</if>
|
||||
<if test="managerId != null "> and manager_id = #{managerId}</if>
|
||||
<if test="workerId != null "> and worker_id = #{workerId}</if>
|
||||
<if test="contacterId != null "> and contacter_id = #{contacterId}</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="isCompleted != null and isCompleted != ''"> and is_completed = #{isCompleted}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectGardenById" parameterType="Long" resultMap="GardenResult">
|
||||
<include refid="selectGardenVo"/>
|
||||
where id = #{id}
|
||||
</select>
|
||||
|
||||
<insert id="insertGarden" parameterType="Garden">
|
||||
insert into csa_garden
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">id,</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="m2 != null">m2,</if>
|
||||
<if test="memberId != null">member_id,</if>
|
||||
<if test="managerId != null">manager_id,</if>
|
||||
<if test="workerId != null">worker_id,</if>
|
||||
<if test="contacterId != null">contacter_id,</if>
|
||||
<if test="coins != null">coins,</if>
|
||||
<if test="isFarming != null">is_farming,</if>
|
||||
<if test="isSelled != null">is_selled,</if>
|
||||
<if test="isCompleted != null">is_completed,</if>
|
||||
<if test="status != null">status,</if>
|
||||
<if test="delFlag != null">del_flag,</if>
|
||||
<if test="createBy != null">create_by,</if>
|
||||
<if test="createTime != null">create_time,</if>
|
||||
<if test="updateBy != null">update_by,</if>
|
||||
<if test="updateTime != null">update_time,</if>
|
||||
<if test="remark != null">remark,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">#{id},</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="m2 != null">#{m2},</if>
|
||||
<if test="memberId != null">#{memberId},</if>
|
||||
<if test="managerId != null">#{managerId},</if>
|
||||
<if test="workerId != null">#{workerId},</if>
|
||||
<if test="contacterId != null">#{contacterId},</if>
|
||||
<if test="coins != null">#{coins},</if>
|
||||
<if test="isFarming != null">#{isFarming},</if>
|
||||
<if test="isSelled != null">#{isSelled},</if>
|
||||
<if test="isCompleted != null">#{isCompleted},</if>
|
||||
<if test="status != null">#{status},</if>
|
||||
<if test="delFlag != null">#{delFlag},</if>
|
||||
<if test="createBy != null">#{createBy},</if>
|
||||
<if test="createTime != null">#{createTime},</if>
|
||||
<if test="updateBy != null">#{updateBy},</if>
|
||||
<if test="updateTime != null">#{updateTime},</if>
|
||||
<if test="remark != null">#{remark},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateGarden" parameterType="Garden">
|
||||
update csa_garden
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<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 = #{name},</if>
|
||||
<if test="m2 != null">m2 = #{m2},</if>
|
||||
<if test="memberId != null">member_id = #{memberId},</if>
|
||||
<if test="managerId != null">manager_id = #{managerId},</if>
|
||||
<if test="workerId != null">worker_id = #{workerId},</if>
|
||||
<if test="contacterId != null">contacter_id = #{contacterId},</if>
|
||||
<if test="coins != null">coins = #{coins},</if>
|
||||
<if test="isFarming != null">is_farming = #{isFarming},</if>
|
||||
<if test="isSelled != null">is_selled = #{isSelled},</if>
|
||||
<if test="isCompleted != null">is_completed = #{isCompleted},</if>
|
||||
<if test="status != null">status = #{status},</if>
|
||||
<if test="delFlag != null">del_flag = #{delFlag},</if>
|
||||
<if test="createBy != null">create_by = #{createBy},</if>
|
||||
<if test="createTime != null">create_time = #{createTime},</if>
|
||||
<if test="updateBy != null">update_by = #{updateBy},</if>
|
||||
<if test="updateTime != null">update_time = #{updateTime},</if>
|
||||
<if test="remark != null">remark = #{remark},</if>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<delete id="deleteGardenById" parameterType="Long">
|
||||
delete from csa_garden where id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteGardenByIds" parameterType="String">
|
||||
delete from csa_garden where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
</mapper>
|
87
private-farm/src/main/resources/mapper/csa/ZoneMapper.xml
Normal file
87
private-farm/src/main/resources/mapper/csa/ZoneMapper.xml
Normal file
@ -0,0 +1,87 @@
|
||||
<?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.ZoneMapper">
|
||||
|
||||
<resultMap type="Zone" id="ZoneResult">
|
||||
<result property="code" column="code" />
|
||||
<result property="name" column="name" />
|
||||
<result property="status" column="status" />
|
||||
<result property="delFlag" column="del_flag" />
|
||||
<result property="createBy" column="create_by" />
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="updateBy" column="update_by" />
|
||||
<result property="updateTime" column="update_time" />
|
||||
<result property="remark" column="remark" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectZoneVo">
|
||||
select code, name, status, del_flag, create_by, create_time, update_by, update_time, remark from csa_zone
|
||||
</sql>
|
||||
|
||||
<select id="selectZoneList" parameterType="Zone" resultMap="ZoneResult">
|
||||
<include refid="selectZoneVo"/>
|
||||
<where>
|
||||
<if test="code != null and code != ''"> and code = #{code}</if>
|
||||
<if test="name != null and name != ''"> and name = #{name}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectZoneByCode" parameterType="String" resultMap="ZoneResult">
|
||||
<include refid="selectZoneVo"/>
|
||||
where code = #{code}
|
||||
</select>
|
||||
|
||||
<insert id="insertZone" parameterType="Zone">
|
||||
insert into csa_zone
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="code != null and code != ''">code,</if>
|
||||
<if test="name != null and name != ''">name,</if>
|
||||
<if test="status != null">status,</if>
|
||||
<if test="delFlag != null">del_flag,</if>
|
||||
<if test="createBy != null">create_by,</if>
|
||||
<if test="createTime != null">create_time,</if>
|
||||
<if test="updateBy != null">update_by,</if>
|
||||
<if test="updateTime != null">update_time,</if>
|
||||
<if test="remark != null">remark,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="code != null and code != ''">#{code},</if>
|
||||
<if test="name != null and name != ''">#{name},</if>
|
||||
<if test="status != null">#{status},</if>
|
||||
<if test="delFlag != null">#{delFlag},</if>
|
||||
<if test="createBy != null">#{createBy},</if>
|
||||
<if test="createTime != null">#{createTime},</if>
|
||||
<if test="updateBy != null">#{updateBy},</if>
|
||||
<if test="updateTime != null">#{updateTime},</if>
|
||||
<if test="remark != null">#{remark},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateZone" parameterType="Zone">
|
||||
update csa_zone
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="name != null and name != ''">name = #{name},</if>
|
||||
<if test="status != null">status = #{status},</if>
|
||||
<if test="delFlag != null">del_flag = #{delFlag},</if>
|
||||
<if test="createBy != null">create_by = #{createBy},</if>
|
||||
<if test="createTime != null">create_time = #{createTime},</if>
|
||||
<if test="updateBy != null">update_by = #{updateBy},</if>
|
||||
<if test="updateTime != null">update_time = #{updateTime},</if>
|
||||
<if test="remark != null">remark = #{remark},</if>
|
||||
</trim>
|
||||
where code = #{code}
|
||||
</update>
|
||||
|
||||
<delete id="deleteZoneByCode" parameterType="String">
|
||||
delete from csa_zone where code = #{code}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteZoneByCodes" parameterType="String">
|
||||
delete from csa_zone where code in
|
||||
<foreach item="code" collection="array" open="(" separator="," close=")">
|
||||
#{code}
|
||||
</foreach>
|
||||
</delete>
|
||||
</mapper>
|
Reference in New Issue
Block a user