新增会员签约,初创版无需制作会员卡,使用收费凭据或协议编号添加合约,经审核后激活会员。
重新生成农场会员,更新id字段。
This commit is contained in:
@ -1,104 +0,0 @@
|
||||
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.CsaFarmer;
|
||||
import com.jlt.csa.service.ICsaFarmerService;
|
||||
import com.ruoyi.common.utils.poi.ExcelUtil;
|
||||
import com.ruoyi.common.core.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* 私家农场会员Controller
|
||||
*
|
||||
* @author JiaLeitao
|
||||
* @date 2022-03-26
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/csa/farmer")
|
||||
public class CsaFarmerController extends BaseController
|
||||
{
|
||||
@Autowired
|
||||
private ICsaFarmerService csaFarmerService;
|
||||
|
||||
/**
|
||||
* 查询私家农场会员列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('csa:farmer:list')")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(CsaFarmer csaFarmer)
|
||||
{
|
||||
startPage();
|
||||
List<CsaFarmer> list = csaFarmerService.selectCsaFarmerList(csaFarmer);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出私家农场会员列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('csa:farmer:export')")
|
||||
@Log(title = "私家农场会员", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, CsaFarmer csaFarmer)
|
||||
{
|
||||
List<CsaFarmer> list = csaFarmerService.selectCsaFarmerList(csaFarmer);
|
||||
ExcelUtil<CsaFarmer> util = new ExcelUtil<CsaFarmer>(CsaFarmer.class);
|
||||
util.exportExcel(response, list, "私家农场会员数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取私家农场会员详细信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('csa:farmer:query')")
|
||||
@GetMapping(value = "/{id}")
|
||||
public AjaxResult getInfo(@PathVariable("id") Long id)
|
||||
{
|
||||
return AjaxResult.success(csaFarmerService.selectCsaFarmerById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增私家农场会员
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('csa:farmer:add')")
|
||||
@Log(title = "私家农场会员", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody CsaFarmer csaFarmer)
|
||||
{
|
||||
return toAjax(csaFarmerService.insertCsaFarmer(csaFarmer));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改私家农场会员
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('csa:farmer:edit')")
|
||||
@Log(title = "私家农场会员", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody CsaFarmer csaFarmer)
|
||||
{
|
||||
return toAjax(csaFarmerService.updateCsaFarmer(csaFarmer));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除私家农场会员
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('csa:farmer:remove')")
|
||||
@Log(title = "私家农场会员", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public AjaxResult remove(@PathVariable Long[] ids)
|
||||
{
|
||||
return toAjax(csaFarmerService.deleteCsaFarmerByIds(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.FarmerContract;
|
||||
import com.jlt.csa.service.IFarmerContractService;
|
||||
import com.ruoyi.common.utils.poi.ExcelUtil;
|
||||
import com.ruoyi.common.core.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* 会员签约Controller
|
||||
*
|
||||
* @author 郏磊涛
|
||||
* @date 2022-04-01
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/csa/contract")
|
||||
public class FarmerContractController extends BaseController
|
||||
{
|
||||
@Autowired
|
||||
private IFarmerContractService farmerContractService;
|
||||
|
||||
/**
|
||||
* 查询会员签约列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('csa:contract:list')")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(FarmerContract farmerContract)
|
||||
{
|
||||
startPage();
|
||||
List<FarmerContract> list = farmerContractService.selectFarmerContractList(farmerContract);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出会员签约列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('csa:contract:export')")
|
||||
@Log(title = "会员签约", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, FarmerContract farmerContract)
|
||||
{
|
||||
List<FarmerContract> list = farmerContractService.selectFarmerContractList(farmerContract);
|
||||
ExcelUtil<FarmerContract> util = new ExcelUtil<FarmerContract>(FarmerContract.class);
|
||||
util.exportExcel(response, list, "会员签约数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取会员签约详细信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('csa:contract:query')")
|
||||
@GetMapping(value = "/{contractId}")
|
||||
public AjaxResult getInfo(@PathVariable("contractId") Long contractId)
|
||||
{
|
||||
return AjaxResult.success(farmerContractService.selectFarmerContractByContractId(contractId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增会员签约
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('csa:contract:add')")
|
||||
@Log(title = "会员签约", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody FarmerContract farmerContract)
|
||||
{
|
||||
return toAjax(farmerContractService.insertFarmerContract(farmerContract));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改会员签约
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('csa:contract:edit')")
|
||||
@Log(title = "会员签约", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody FarmerContract farmerContract)
|
||||
{
|
||||
return toAjax(farmerContractService.updateFarmerContract(farmerContract));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除会员签约
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('csa:contract:remove')")
|
||||
@Log(title = "会员签约", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{contractIds}")
|
||||
public AjaxResult remove(@PathVariable Long[] contractIds)
|
||||
{
|
||||
return toAjax(farmerContractService.deleteFarmerContractByContractIds(contractIds));
|
||||
}
|
||||
}
|
@ -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.Farmer;
|
||||
import com.jlt.csa.service.IFarmerService;
|
||||
import com.ruoyi.common.utils.poi.ExcelUtil;
|
||||
import com.ruoyi.common.core.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* 农场会员Controller
|
||||
*
|
||||
* @author JiaLeitao
|
||||
* @date 2022-04-01
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/csa/farmer")
|
||||
public class FarmerController extends BaseController
|
||||
{
|
||||
@Autowired
|
||||
private IFarmerService farmerService;
|
||||
|
||||
/**
|
||||
* 查询农场会员列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('csa:farmer:list')")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(Farmer farmer)
|
||||
{
|
||||
startPage();
|
||||
List<Farmer> list = farmerService.selectFarmerList(farmer);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出农场会员列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('csa:farmer:export')")
|
||||
@Log(title = "农场会员", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, Farmer farmer)
|
||||
{
|
||||
List<Farmer> list = farmerService.selectFarmerList(farmer);
|
||||
ExcelUtil<Farmer> util = new ExcelUtil<Farmer>(Farmer.class);
|
||||
util.exportExcel(response, list, "农场会员数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取农场会员详细信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('csa:farmer:query')")
|
||||
@GetMapping(value = "/{farmerId}")
|
||||
public AjaxResult getInfo(@PathVariable("farmerId") Long farmerId)
|
||||
{
|
||||
return AjaxResult.success(farmerService.selectFarmerByFarmerId(farmerId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增农场会员
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('csa:farmer:add')")
|
||||
@Log(title = "农场会员", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody Farmer farmer)
|
||||
{
|
||||
return toAjax(farmerService.insertFarmer(farmer));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改农场会员
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('csa:farmer:edit')")
|
||||
@Log(title = "农场会员", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody Farmer farmer)
|
||||
{
|
||||
return toAjax(farmerService.updateFarmer(farmer));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除农场会员
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('csa:farmer:remove')")
|
||||
@Log(title = "农场会员", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{farmerIds}")
|
||||
public AjaxResult remove(@PathVariable Long[] farmerIds)
|
||||
{
|
||||
return toAjax(farmerService.deleteFarmerByFarmerIds(farmerIds));
|
||||
}
|
||||
}
|
@ -9,17 +9,17 @@ import com.ruoyi.common.annotation.Excel;
|
||||
import com.ruoyi.common.core.domain.BaseEntity;
|
||||
|
||||
/**
|
||||
* 私家农场会员对象 csa_farmer
|
||||
* 农场会员对象 csa_farmer
|
||||
*
|
||||
* @author JiaLeitao
|
||||
* @date 2022-03-26
|
||||
* @date 2022-04-01
|
||||
*/
|
||||
public class CsaFarmer extends BaseEntity
|
||||
public class Farmer extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 会员id */
|
||||
private Long id;
|
||||
private Long farmerId;
|
||||
|
||||
/** 会员姓名 */
|
||||
@Excel(name = "会员姓名")
|
||||
@ -43,7 +43,7 @@ public class CsaFarmer extends BaseEntity
|
||||
|
||||
/** 拱棚年限余额 */
|
||||
@Excel(name = "拱棚年限余额")
|
||||
private Integer archedYears;
|
||||
private Long archedYears;
|
||||
|
||||
/** 加入日期 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
@ -59,21 +59,20 @@ public class CsaFarmer extends BaseEntity
|
||||
@Excel(name = "是否过期")
|
||||
private String isExpire;
|
||||
|
||||
/** 状态(0正常 1停用) */
|
||||
@Excel(name = "状态", readConverterExp = "0=正常,1=停用")
|
||||
/** 状态 */
|
||||
private String status;
|
||||
|
||||
/** 删除标志(0代表存在 2代表删除) */
|
||||
/** 删除标志 */
|
||||
private String delFlag;
|
||||
|
||||
public void setId(Long id)
|
||||
public void setFarmerId(Long farmerId)
|
||||
{
|
||||
this.id = id;
|
||||
this.farmerId = farmerId;
|
||||
}
|
||||
|
||||
public Long getId()
|
||||
public Long getFarmerId()
|
||||
{
|
||||
return id;
|
||||
return farmerId;
|
||||
}
|
||||
public void setName(String name)
|
||||
{
|
||||
@ -120,12 +119,12 @@ public class CsaFarmer extends BaseEntity
|
||||
{
|
||||
return weight;
|
||||
}
|
||||
public void setArchedYears(Integer archedYears)
|
||||
public void setArchedYears(Long archedYears)
|
||||
{
|
||||
this.archedYears = archedYears;
|
||||
}
|
||||
|
||||
public Integer getArchedYears()
|
||||
public Long getArchedYears()
|
||||
{
|
||||
return archedYears;
|
||||
}
|
||||
@ -178,7 +177,7 @@ public class CsaFarmer extends BaseEntity
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("id", getId())
|
||||
.append("farmerId", getFarmerId())
|
||||
.append("name", getName())
|
||||
.append("gender", getGender())
|
||||
.append("coins", getCoins())
|
@ -0,0 +1,214 @@
|
||||
package com.jlt.csa.domain;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
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_farmer_contract
|
||||
*
|
||||
* @author 郏磊涛
|
||||
* @date 2022-04-01
|
||||
*/
|
||||
public class FarmerContract extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 合约id */
|
||||
private Long contractId;
|
||||
|
||||
/** 会员id */
|
||||
@Excel(name = "会员id")
|
||||
private Long farmerId;
|
||||
|
||||
/** 会员姓名 */
|
||||
@Excel(name = "会员姓名")
|
||||
private String memberName;
|
||||
|
||||
/** 合约金币 */
|
||||
@Excel(name = "合约金币")
|
||||
private BigDecimal coins;
|
||||
|
||||
/** 合约账户金额 */
|
||||
@Excel(name = "合约账户金额")
|
||||
private BigDecimal balance;
|
||||
|
||||
/** 合约重量 */
|
||||
@Excel(name = "合约重量")
|
||||
private BigDecimal weight;
|
||||
|
||||
/** 合约拱棚年限 */
|
||||
@Excel(name = "合约拱棚年限")
|
||||
private Long archedYears;
|
||||
|
||||
/** 激活方式 */
|
||||
@Excel(name = "激活方式")
|
||||
private String activateMode;
|
||||
|
||||
/** 加入凭据号码 */
|
||||
@Excel(name = "加入凭据号码")
|
||||
private String joinCredentialNo;
|
||||
|
||||
/** 加入日期 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
@Excel(name = "加入日期", width = 30, dateFormat = "yyyy-MM-dd")
|
||||
private Date joinDate;
|
||||
|
||||
/** 到期日期 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
@Excel(name = "到期日期", width = 30, dateFormat = "yyyy-MM-dd")
|
||||
private Date dueDate;
|
||||
|
||||
/** 状态(0正常 1停用) */
|
||||
@Excel(name = "状态", readConverterExp = "0=正常,1=停用")
|
||||
private String status;
|
||||
|
||||
/** 删除标志(0代表存在 2代表删除) */
|
||||
private String delFlag;
|
||||
|
||||
public void setContractId(Long contractId)
|
||||
{
|
||||
this.contractId = contractId;
|
||||
}
|
||||
|
||||
public Long getContractId()
|
||||
{
|
||||
return contractId;
|
||||
}
|
||||
public void setFarmerId(Long farmerId)
|
||||
{
|
||||
this.farmerId = farmerId;
|
||||
}
|
||||
|
||||
public Long getFarmerId()
|
||||
{
|
||||
return farmerId;
|
||||
}
|
||||
public void setMemberName(String memberName)
|
||||
{
|
||||
this.memberName = memberName;
|
||||
}
|
||||
|
||||
public String getMemberName()
|
||||
{
|
||||
return memberName;
|
||||
}
|
||||
public void setCoins(BigDecimal coins)
|
||||
{
|
||||
this.coins = coins;
|
||||
}
|
||||
|
||||
public BigDecimal getCoins()
|
||||
{
|
||||
return coins;
|
||||
}
|
||||
public void setBalance(BigDecimal balance)
|
||||
{
|
||||
this.balance = balance;
|
||||
}
|
||||
|
||||
public BigDecimal getBalance()
|
||||
{
|
||||
return balance;
|
||||
}
|
||||
public void setWeight(BigDecimal weight)
|
||||
{
|
||||
this.weight = weight;
|
||||
}
|
||||
|
||||
public BigDecimal getWeight()
|
||||
{
|
||||
return weight;
|
||||
}
|
||||
public void setArchedYears(Long archedYears)
|
||||
{
|
||||
this.archedYears = archedYears;
|
||||
}
|
||||
|
||||
public Long getArchedYears()
|
||||
{
|
||||
return archedYears;
|
||||
}
|
||||
public void setActivateMode(String activateMode)
|
||||
{
|
||||
this.activateMode = activateMode;
|
||||
}
|
||||
|
||||
public String getActivateMode()
|
||||
{
|
||||
return activateMode;
|
||||
}
|
||||
public void setJoinCredentialNo(String joinCredentialNo)
|
||||
{
|
||||
this.joinCredentialNo = joinCredentialNo;
|
||||
}
|
||||
|
||||
public String getJoinCredentialNo()
|
||||
{
|
||||
return joinCredentialNo;
|
||||
}
|
||||
public void setJoinDate(Date joinDate)
|
||||
{
|
||||
this.joinDate = joinDate;
|
||||
}
|
||||
|
||||
public Date getJoinDate()
|
||||
{
|
||||
return joinDate;
|
||||
}
|
||||
public void setDueDate(Date dueDate)
|
||||
{
|
||||
this.dueDate = dueDate;
|
||||
}
|
||||
|
||||
public Date getDueDate()
|
||||
{
|
||||
return dueDate;
|
||||
}
|
||||
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("contractId", getContractId())
|
||||
.append("farmerId", getFarmerId())
|
||||
.append("memberName", getMemberName())
|
||||
.append("coins", getCoins())
|
||||
.append("balance", getBalance())
|
||||
.append("weight", getWeight())
|
||||
.append("archedYears", getArchedYears())
|
||||
.append("activateMode", getActivateMode())
|
||||
.append("joinCredentialNo", getJoinCredentialNo())
|
||||
.append("joinDate", getJoinDate())
|
||||
.append("dueDate", getDueDate())
|
||||
.append("status", getStatus())
|
||||
.append("delFlag", getDelFlag())
|
||||
.append("createBy", getCreateBy())
|
||||
.append("createTime", getCreateTime())
|
||||
.append("updateBy", getUpdateBy())
|
||||
.append("updateTime", getUpdateTime())
|
||||
.append("remark", getRemark())
|
||||
.toString();
|
||||
}
|
||||
}
|
@ -1,61 +0,0 @@
|
||||
package com.jlt.csa.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import com.jlt.csa.domain.CsaFarmer;
|
||||
|
||||
/**
|
||||
* 私家农场会员Mapper接口
|
||||
*
|
||||
* @author JiaLeitao
|
||||
* @date 2022-03-26
|
||||
*/
|
||||
public interface CsaFarmerMapper
|
||||
{
|
||||
/**
|
||||
* 查询私家农场会员
|
||||
*
|
||||
* @param id 私家农场会员主键
|
||||
* @return 私家农场会员
|
||||
*/
|
||||
public CsaFarmer selectCsaFarmerById(Long id);
|
||||
|
||||
/**
|
||||
* 查询私家农场会员列表
|
||||
*
|
||||
* @param csaFarmer 私家农场会员
|
||||
* @return 私家农场会员集合
|
||||
*/
|
||||
public List<CsaFarmer> selectCsaFarmerList(CsaFarmer csaFarmer);
|
||||
|
||||
/**
|
||||
* 新增私家农场会员
|
||||
*
|
||||
* @param csaFarmer 私家农场会员
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertCsaFarmer(CsaFarmer csaFarmer);
|
||||
|
||||
/**
|
||||
* 修改私家农场会员
|
||||
*
|
||||
* @param csaFarmer 私家农场会员
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateCsaFarmer(CsaFarmer csaFarmer);
|
||||
|
||||
/**
|
||||
* 删除私家农场会员
|
||||
*
|
||||
* @param id 私家农场会员主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteCsaFarmerById(Long id);
|
||||
|
||||
/**
|
||||
* 批量删除私家农场会员
|
||||
*
|
||||
* @param ids 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteCsaFarmerByIds(Long[] ids);
|
||||
}
|
@ -0,0 +1,61 @@
|
||||
package com.jlt.csa.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import com.jlt.csa.domain.FarmerContract;
|
||||
|
||||
/**
|
||||
* 会员签约Mapper接口
|
||||
*
|
||||
* @author 郏磊涛
|
||||
* @date 2022-04-01
|
||||
*/
|
||||
public interface FarmerContractMapper
|
||||
{
|
||||
/**
|
||||
* 查询会员签约
|
||||
*
|
||||
* @param contractId 会员签约主键
|
||||
* @return 会员签约
|
||||
*/
|
||||
public FarmerContract selectFarmerContractByContractId(Long contractId);
|
||||
|
||||
/**
|
||||
* 查询会员签约列表
|
||||
*
|
||||
* @param farmerContract 会员签约
|
||||
* @return 会员签约集合
|
||||
*/
|
||||
public List<FarmerContract> selectFarmerContractList(FarmerContract farmerContract);
|
||||
|
||||
/**
|
||||
* 新增会员签约
|
||||
*
|
||||
* @param farmerContract 会员签约
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertFarmerContract(FarmerContract farmerContract);
|
||||
|
||||
/**
|
||||
* 修改会员签约
|
||||
*
|
||||
* @param farmerContract 会员签约
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateFarmerContract(FarmerContract farmerContract);
|
||||
|
||||
/**
|
||||
* 删除会员签约
|
||||
*
|
||||
* @param contractId 会员签约主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteFarmerContractByContractId(Long contractId);
|
||||
|
||||
/**
|
||||
* 批量删除会员签约
|
||||
*
|
||||
* @param contractIds 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteFarmerContractByContractIds(Long[] contractIds);
|
||||
}
|
@ -0,0 +1,61 @@
|
||||
package com.jlt.csa.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import com.jlt.csa.domain.Farmer;
|
||||
|
||||
/**
|
||||
* 农场会员Mapper接口
|
||||
*
|
||||
* @author JiaLeitao
|
||||
* @date 2022-04-01
|
||||
*/
|
||||
public interface FarmerMapper
|
||||
{
|
||||
/**
|
||||
* 查询农场会员
|
||||
*
|
||||
* @param farmerId 农场会员主键
|
||||
* @return 农场会员
|
||||
*/
|
||||
public Farmer selectFarmerByFarmerId(Long farmerId);
|
||||
|
||||
/**
|
||||
* 查询农场会员列表
|
||||
*
|
||||
* @param farmer 农场会员
|
||||
* @return 农场会员集合
|
||||
*/
|
||||
public List<Farmer> selectFarmerList(Farmer farmer);
|
||||
|
||||
/**
|
||||
* 新增农场会员
|
||||
*
|
||||
* @param farmer 农场会员
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertFarmer(Farmer farmer);
|
||||
|
||||
/**
|
||||
* 修改农场会员
|
||||
*
|
||||
* @param farmer 农场会员
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateFarmer(Farmer farmer);
|
||||
|
||||
/**
|
||||
* 删除农场会员
|
||||
*
|
||||
* @param farmerId 农场会员主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteFarmerByFarmerId(Long farmerId);
|
||||
|
||||
/**
|
||||
* 批量删除农场会员
|
||||
*
|
||||
* @param farmerIds 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteFarmerByFarmerIds(Long[] farmerIds);
|
||||
}
|
@ -1,61 +0,0 @@
|
||||
package com.jlt.csa.service;
|
||||
|
||||
import java.util.List;
|
||||
import com.jlt.csa.domain.CsaFarmer;
|
||||
|
||||
/**
|
||||
* 私家农场会员Service接口
|
||||
*
|
||||
* @author JiaLeitao
|
||||
* @date 2022-03-26
|
||||
*/
|
||||
public interface ICsaFarmerService
|
||||
{
|
||||
/**
|
||||
* 查询私家农场会员
|
||||
*
|
||||
* @param id 私家农场会员主键
|
||||
* @return 私家农场会员
|
||||
*/
|
||||
public CsaFarmer selectCsaFarmerById(Long id);
|
||||
|
||||
/**
|
||||
* 查询私家农场会员列表
|
||||
*
|
||||
* @param csaFarmer 私家农场会员
|
||||
* @return 私家农场会员集合
|
||||
*/
|
||||
public List<CsaFarmer> selectCsaFarmerList(CsaFarmer csaFarmer);
|
||||
|
||||
/**
|
||||
* 新增私家农场会员
|
||||
*
|
||||
* @param csaFarmer 私家农场会员
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertCsaFarmer(CsaFarmer csaFarmer);
|
||||
|
||||
/**
|
||||
* 修改私家农场会员
|
||||
*
|
||||
* @param csaFarmer 私家农场会员
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateCsaFarmer(CsaFarmer csaFarmer);
|
||||
|
||||
/**
|
||||
* 批量删除私家农场会员
|
||||
*
|
||||
* @param ids 需要删除的私家农场会员主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteCsaFarmerByIds(Long[] ids);
|
||||
|
||||
/**
|
||||
* 删除私家农场会员信息
|
||||
*
|
||||
* @param id 私家农场会员主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteCsaFarmerById(Long id);
|
||||
}
|
@ -0,0 +1,61 @@
|
||||
package com.jlt.csa.service;
|
||||
|
||||
import java.util.List;
|
||||
import com.jlt.csa.domain.FarmerContract;
|
||||
|
||||
/**
|
||||
* 会员签约Service接口
|
||||
*
|
||||
* @author 郏磊涛
|
||||
* @date 2022-04-01
|
||||
*/
|
||||
public interface IFarmerContractService
|
||||
{
|
||||
/**
|
||||
* 查询会员签约
|
||||
*
|
||||
* @param contractId 会员签约主键
|
||||
* @return 会员签约
|
||||
*/
|
||||
public FarmerContract selectFarmerContractByContractId(Long contractId);
|
||||
|
||||
/**
|
||||
* 查询会员签约列表
|
||||
*
|
||||
* @param farmerContract 会员签约
|
||||
* @return 会员签约集合
|
||||
*/
|
||||
public List<FarmerContract> selectFarmerContractList(FarmerContract farmerContract);
|
||||
|
||||
/**
|
||||
* 新增会员签约
|
||||
*
|
||||
* @param farmerContract 会员签约
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertFarmerContract(FarmerContract farmerContract);
|
||||
|
||||
/**
|
||||
* 修改会员签约
|
||||
*
|
||||
* @param farmerContract 会员签约
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateFarmerContract(FarmerContract farmerContract);
|
||||
|
||||
/**
|
||||
* 批量删除会员签约
|
||||
*
|
||||
* @param contractIds 需要删除的会员签约主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteFarmerContractByContractIds(Long[] contractIds);
|
||||
|
||||
/**
|
||||
* 删除会员签约信息
|
||||
*
|
||||
* @param contractId 会员签约主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteFarmerContractByContractId(Long contractId);
|
||||
}
|
@ -0,0 +1,61 @@
|
||||
package com.jlt.csa.service;
|
||||
|
||||
import java.util.List;
|
||||
import com.jlt.csa.domain.Farmer;
|
||||
|
||||
/**
|
||||
* 农场会员Service接口
|
||||
*
|
||||
* @author JiaLeitao
|
||||
* @date 2022-04-01
|
||||
*/
|
||||
public interface IFarmerService
|
||||
{
|
||||
/**
|
||||
* 查询农场会员
|
||||
*
|
||||
* @param farmerId 农场会员主键
|
||||
* @return 农场会员
|
||||
*/
|
||||
public Farmer selectFarmerByFarmerId(Long farmerId);
|
||||
|
||||
/**
|
||||
* 查询农场会员列表
|
||||
*
|
||||
* @param farmer 农场会员
|
||||
* @return 农场会员集合
|
||||
*/
|
||||
public List<Farmer> selectFarmerList(Farmer farmer);
|
||||
|
||||
/**
|
||||
* 新增农场会员
|
||||
*
|
||||
* @param farmer 农场会员
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertFarmer(Farmer farmer);
|
||||
|
||||
/**
|
||||
* 修改农场会员
|
||||
*
|
||||
* @param farmer 农场会员
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateFarmer(Farmer farmer);
|
||||
|
||||
/**
|
||||
* 批量删除农场会员
|
||||
*
|
||||
* @param farmerIds 需要删除的农场会员主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteFarmerByFarmerIds(Long[] farmerIds);
|
||||
|
||||
/**
|
||||
* 删除农场会员信息
|
||||
*
|
||||
* @param farmerId 农场会员主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteFarmerByFarmerId(Long farmerId);
|
||||
}
|
@ -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.CsaFarmerMapper;
|
||||
import com.jlt.csa.domain.CsaFarmer;
|
||||
import com.jlt.csa.service.ICsaFarmerService;
|
||||
|
||||
/**
|
||||
* 私家农场会员Service业务层处理
|
||||
*
|
||||
* @author JiaLeitao
|
||||
* @date 2022-03-26
|
||||
*/
|
||||
@Service
|
||||
public class CsaFarmerServiceImpl implements ICsaFarmerService
|
||||
{
|
||||
@Autowired
|
||||
private CsaFarmerMapper csaFarmerMapper;
|
||||
|
||||
/**
|
||||
* 查询私家农场会员
|
||||
*
|
||||
* @param id 私家农场会员主键
|
||||
* @return 私家农场会员
|
||||
*/
|
||||
@Override
|
||||
public CsaFarmer selectCsaFarmerById(Long id)
|
||||
{
|
||||
return csaFarmerMapper.selectCsaFarmerById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询私家农场会员列表
|
||||
*
|
||||
* @param csaFarmer 私家农场会员
|
||||
* @return 私家农场会员
|
||||
*/
|
||||
@Override
|
||||
public List<CsaFarmer> selectCsaFarmerList(CsaFarmer csaFarmer)
|
||||
{
|
||||
return csaFarmerMapper.selectCsaFarmerList(csaFarmer);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增私家农场会员
|
||||
*
|
||||
* @param csaFarmer 私家农场会员
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertCsaFarmer(CsaFarmer csaFarmer)
|
||||
{
|
||||
csaFarmer.setCreateTime(DateUtils.getNowDate());
|
||||
return csaFarmerMapper.insertCsaFarmer(csaFarmer);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改私家农场会员
|
||||
*
|
||||
* @param csaFarmer 私家农场会员
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateCsaFarmer(CsaFarmer csaFarmer)
|
||||
{
|
||||
csaFarmer.setUpdateTime(DateUtils.getNowDate());
|
||||
return csaFarmerMapper.updateCsaFarmer(csaFarmer);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除私家农场会员
|
||||
*
|
||||
* @param ids 需要删除的私家农场会员主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteCsaFarmerByIds(Long[] ids)
|
||||
{
|
||||
return csaFarmerMapper.deleteCsaFarmerByIds(ids);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除私家农场会员信息
|
||||
*
|
||||
* @param id 私家农场会员主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteCsaFarmerById(Long id)
|
||||
{
|
||||
return csaFarmerMapper.deleteCsaFarmerById(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.FarmerContractMapper;
|
||||
import com.jlt.csa.domain.FarmerContract;
|
||||
import com.jlt.csa.service.IFarmerContractService;
|
||||
|
||||
/**
|
||||
* 会员签约Service业务层处理
|
||||
*
|
||||
* @author 郏磊涛
|
||||
* @date 2022-04-01
|
||||
*/
|
||||
@Service
|
||||
public class FarmerContractServiceImpl implements IFarmerContractService
|
||||
{
|
||||
@Autowired
|
||||
private FarmerContractMapper farmerContractMapper;
|
||||
|
||||
/**
|
||||
* 查询会员签约
|
||||
*
|
||||
* @param contractId 会员签约主键
|
||||
* @return 会员签约
|
||||
*/
|
||||
@Override
|
||||
public FarmerContract selectFarmerContractByContractId(Long contractId)
|
||||
{
|
||||
return farmerContractMapper.selectFarmerContractByContractId(contractId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询会员签约列表
|
||||
*
|
||||
* @param farmerContract 会员签约
|
||||
* @return 会员签约
|
||||
*/
|
||||
@Override
|
||||
public List<FarmerContract> selectFarmerContractList(FarmerContract farmerContract)
|
||||
{
|
||||
return farmerContractMapper.selectFarmerContractList(farmerContract);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增会员签约
|
||||
*
|
||||
* @param farmerContract 会员签约
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertFarmerContract(FarmerContract farmerContract)
|
||||
{
|
||||
farmerContract.setCreateTime(DateUtils.getNowDate());
|
||||
return farmerContractMapper.insertFarmerContract(farmerContract);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改会员签约
|
||||
*
|
||||
* @param farmerContract 会员签约
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateFarmerContract(FarmerContract farmerContract)
|
||||
{
|
||||
farmerContract.setUpdateTime(DateUtils.getNowDate());
|
||||
return farmerContractMapper.updateFarmerContract(farmerContract);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除会员签约
|
||||
*
|
||||
* @param contractIds 需要删除的会员签约主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteFarmerContractByContractIds(Long[] contractIds)
|
||||
{
|
||||
return farmerContractMapper.deleteFarmerContractByContractIds(contractIds);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除会员签约信息
|
||||
*
|
||||
* @param contractId 会员签约主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteFarmerContractByContractId(Long contractId)
|
||||
{
|
||||
return farmerContractMapper.deleteFarmerContractByContractId(contractId);
|
||||
}
|
||||
}
|
@ -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.FarmerMapper;
|
||||
import com.jlt.csa.domain.Farmer;
|
||||
import com.jlt.csa.service.IFarmerService;
|
||||
|
||||
/**
|
||||
* 农场会员Service业务层处理
|
||||
*
|
||||
* @author JiaLeitao
|
||||
* @date 2022-04-01
|
||||
*/
|
||||
@Service
|
||||
public class FarmerServiceImpl implements IFarmerService
|
||||
{
|
||||
@Autowired
|
||||
private FarmerMapper farmerMapper;
|
||||
|
||||
/**
|
||||
* 查询农场会员
|
||||
*
|
||||
* @param farmerId 农场会员主键
|
||||
* @return 农场会员
|
||||
*/
|
||||
@Override
|
||||
public Farmer selectFarmerByFarmerId(Long farmerId)
|
||||
{
|
||||
return farmerMapper.selectFarmerByFarmerId(farmerId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询农场会员列表
|
||||
*
|
||||
* @param farmer 农场会员
|
||||
* @return 农场会员
|
||||
*/
|
||||
@Override
|
||||
public List<Farmer> selectFarmerList(Farmer farmer)
|
||||
{
|
||||
return farmerMapper.selectFarmerList(farmer);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增农场会员
|
||||
*
|
||||
* @param farmer 农场会员
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertFarmer(Farmer farmer)
|
||||
{
|
||||
farmer.setCreateTime(DateUtils.getNowDate());
|
||||
return farmerMapper.insertFarmer(farmer);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改农场会员
|
||||
*
|
||||
* @param farmer 农场会员
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateFarmer(Farmer farmer)
|
||||
{
|
||||
farmer.setUpdateTime(DateUtils.getNowDate());
|
||||
return farmerMapper.updateFarmer(farmer);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除农场会员
|
||||
*
|
||||
* @param farmerIds 需要删除的农场会员主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteFarmerByFarmerIds(Long[] farmerIds)
|
||||
{
|
||||
return farmerMapper.deleteFarmerByFarmerIds(farmerIds);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除农场会员信息
|
||||
*
|
||||
* @param farmerId 农场会员主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteFarmerByFarmerId(Long farmerId)
|
||||
{
|
||||
return farmerMapper.deleteFarmerByFarmerId(farmerId);
|
||||
}
|
||||
}
|
@ -0,0 +1,123 @@
|
||||
<?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.FarmerContractMapper">
|
||||
|
||||
<resultMap type="FarmerContract" id="FarmerContractResult">
|
||||
<result property="contractId" column="contract_id" />
|
||||
<result property="farmerId" column="farmer_id" />
|
||||
<result property="memberName" column="member_name" />
|
||||
<result property="coins" column="coins" />
|
||||
<result property="balance" column="balance" />
|
||||
<result property="weight" column="weight" />
|
||||
<result property="archedYears" column="arched_years" />
|
||||
<result property="activateMode" column="activate_mode" />
|
||||
<result property="joinCredentialNo" column="join_credential_no" />
|
||||
<result property="joinDate" column="join_date" />
|
||||
<result property="dueDate" column="due_date" />
|
||||
<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="selectFarmerContractVo">
|
||||
select contract_id, farmer_id, member_name, coins, balance, weight, arched_years, activate_mode, join_credential_no, join_date, due_date, status, del_flag, create_by, create_time, update_by, update_time, remark from csa_farmer_contract
|
||||
</sql>
|
||||
|
||||
<select id="selectFarmerContractList" parameterType="FarmerContract" resultMap="FarmerContractResult">
|
||||
<include refid="selectFarmerContractVo"/>
|
||||
<where>
|
||||
<if test="memberName != null and memberName != ''"> and member_name like concat('%', #{memberName}, '%')</if>
|
||||
<if test="joinDate != null "> and join_date = #{joinDate}</if>
|
||||
<if test="dueDate != null "> and due_date = #{dueDate}</if>
|
||||
<if test="status != null and status != ''"> and status = #{status}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectFarmerContractByContractId" parameterType="Long" resultMap="FarmerContractResult">
|
||||
<include refid="selectFarmerContractVo"/>
|
||||
where contract_id = #{contractId}
|
||||
</select>
|
||||
|
||||
<insert id="insertFarmerContract" parameterType="FarmerContract" useGeneratedKeys="true" keyProperty="contractId">
|
||||
insert into csa_farmer_contract
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="farmerId != null">farmer_id,</if>
|
||||
<if test="memberName != null and memberName != ''">member_name,</if>
|
||||
<if test="coins != null">coins,</if>
|
||||
<if test="balance != null">balance,</if>
|
||||
<if test="weight != null">weight,</if>
|
||||
<if test="archedYears != null">arched_years,</if>
|
||||
<if test="activateMode != null and activateMode != ''">activate_mode,</if>
|
||||
<if test="joinCredentialNo != null and joinCredentialNo != ''">join_credential_no,</if>
|
||||
<if test="joinDate != null">join_date,</if>
|
||||
<if test="dueDate != null">due_date,</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="farmerId != null">#{farmerId},</if>
|
||||
<if test="memberName != null and memberName != ''">#{memberName},</if>
|
||||
<if test="coins != null">#{coins},</if>
|
||||
<if test="balance != null">#{balance},</if>
|
||||
<if test="weight != null">#{weight},</if>
|
||||
<if test="archedYears != null">#{archedYears},</if>
|
||||
<if test="activateMode != null and activateMode != ''">#{activateMode},</if>
|
||||
<if test="joinCredentialNo != null and joinCredentialNo != ''">#{joinCredentialNo},</if>
|
||||
<if test="joinDate != null">#{joinDate},</if>
|
||||
<if test="dueDate != null">#{dueDate},</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="updateFarmerContract" parameterType="FarmerContract">
|
||||
update csa_farmer_contract
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="farmerId != null">farmer_id = #{farmerId},</if>
|
||||
<if test="memberName != null and memberName != ''">member_name = #{memberName},</if>
|
||||
<if test="coins != null">coins = #{coins},</if>
|
||||
<if test="balance != null">balance = #{balance},</if>
|
||||
<if test="weight != null">weight = #{weight},</if>
|
||||
<if test="archedYears != null">arched_years = #{archedYears},</if>
|
||||
<if test="activateMode != null and activateMode != ''">activate_mode = #{activateMode},</if>
|
||||
<if test="joinCredentialNo != null and joinCredentialNo != ''">join_credential_no = #{joinCredentialNo},</if>
|
||||
<if test="joinDate != null">join_date = #{joinDate},</if>
|
||||
<if test="dueDate != null">due_date = #{dueDate},</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 contract_id = #{contractId}
|
||||
</update>
|
||||
|
||||
<delete id="deleteFarmerContractByContractId" parameterType="Long">
|
||||
delete from csa_farmer_contract where contract_id = #{contractId}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteFarmerContractByContractIds" parameterType="String">
|
||||
delete from csa_farmer_contract where contract_id in
|
||||
<foreach item="contractId" collection="array" open="(" separator="," close=")">
|
||||
#{contractId}
|
||||
</foreach>
|
||||
</delete>
|
||||
</mapper>
|
@ -2,10 +2,10 @@
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.jlt.csa.mapper.CsaFarmerMapper">
|
||||
<mapper namespace="com.jlt.csa.mapper.FarmerMapper">
|
||||
|
||||
<resultMap type="CsaFarmer" id="CsaFarmerResult">
|
||||
<result property="id" column="id" />
|
||||
<resultMap type="Farmer" id="FarmerResult">
|
||||
<result property="farmerId" column="farmer_id" />
|
||||
<result property="name" column="name" />
|
||||
<result property="gender" column="gender" />
|
||||
<result property="coins" column="coins" />
|
||||
@ -24,26 +24,26 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<result property="remark" column="remark" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectCsaFarmerVo">
|
||||
select id, name, gender, coins, balance, weight, arched_years, join_date, due_date, is_expire, status, del_flag, create_by, create_time, update_by, update_time, remark from csa_farmer
|
||||
<sql id="selectFarmerVo">
|
||||
select farmer_id, name, gender, coins, balance, weight, arched_years, join_date, due_date, is_expire, status, del_flag, create_by, create_time, update_by, update_time, remark from csa_farmer
|
||||
</sql>
|
||||
|
||||
<select id="selectCsaFarmerList" parameterType="CsaFarmer" resultMap="CsaFarmerResult">
|
||||
<include refid="selectCsaFarmerVo"/>
|
||||
<select id="selectFarmerList" parameterType="Farmer" resultMap="FarmerResult">
|
||||
<include refid="selectFarmerVo"/>
|
||||
<where>
|
||||
<if test="name != null and name != ''"> and name like concat('%', #{name}, '%')</if>
|
||||
<if test="joinDate != null "> and join_date = #{joinDate}</if>
|
||||
<if test="dueDate != null "> and due_date = #{dueDate}</if>
|
||||
<if test="isExpire != null and isExpire != ''"> and is_expire = #{isExpire}</if>
|
||||
<if test="status != null and status != ''"> and status = #{status}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectCsaFarmerById" parameterType="Long" resultMap="CsaFarmerResult">
|
||||
<include refid="selectCsaFarmerVo"/>
|
||||
where id = #{id}
|
||||
<select id="selectFarmerByFarmerId" parameterType="Long" resultMap="FarmerResult">
|
||||
<include refid="selectFarmerVo"/>
|
||||
where farmer_id = #{farmerId}
|
||||
</select>
|
||||
|
||||
<insert id="insertCsaFarmer" parameterType="CsaFarmer" useGeneratedKeys="true" keyProperty="id">
|
||||
<insert id="insertFarmer" parameterType="Farmer" useGeneratedKeys="true" keyProperty="farmerId">
|
||||
insert into csa_farmer
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="name != null and name != ''">name,</if>
|
||||
@ -83,7 +83,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateCsaFarmer" parameterType="CsaFarmer">
|
||||
<update id="updateFarmer" parameterType="Farmer">
|
||||
update csa_farmer
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="name != null and name != ''">name = #{name},</if>
|
||||
@ -103,17 +103,17 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<if test="updateTime != null">update_time = #{updateTime},</if>
|
||||
<if test="remark != null">remark = #{remark},</if>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
where farmer_id = #{farmerId}
|
||||
</update>
|
||||
|
||||
<delete id="deleteCsaFarmerById" parameterType="Long">
|
||||
delete from csa_farmer where id = #{id}
|
||||
<delete id="deleteFarmerByFarmerId" parameterType="Long">
|
||||
delete from csa_farmer where farmer_id = #{farmerId}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteCsaFarmerByIds" parameterType="String">
|
||||
delete from csa_farmer where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
<delete id="deleteFarmerByFarmerIds" parameterType="String">
|
||||
delete from csa_farmer where farmer_id in
|
||||
<foreach item="farmerId" collection="array" open="(" separator="," close=")">
|
||||
#{farmerId}
|
||||
</foreach>
|
||||
</delete>
|
||||
</mapper>
|
Reference in New Issue
Block a user