Compare commits
3 Commits
2f0e80868e
...
4ab62cd1f2
| Author | SHA1 | Date | |
|---|---|---|---|
| 4ab62cd1f2 | |||
| 5a2f59b02d | |||
| 40fc60ddc9 |
@@ -109,6 +109,8 @@ public class SgFeedListController extends BaseController {
|
|||||||
@Log(title = "配料清单", businessType = BusinessType.INSERT)
|
@Log(title = "配料清单", businessType = BusinessType.INSERT)
|
||||||
@PostMapping
|
@PostMapping
|
||||||
public AjaxResult add(@RequestBody SgFeedList sgFeedList) {
|
public AjaxResult add(@RequestBody SgFeedList sgFeedList) {
|
||||||
|
sgFeedList.setDeptId(getDeptId());
|
||||||
|
sgFeedList.setUserId(getUserId());
|
||||||
return toAjax(sgFeedListService.insertSgFeedList(sgFeedList));
|
return toAjax(sgFeedListService.insertSgFeedList(sgFeedList));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -79,6 +79,8 @@ public class SgFeedPlanController extends BaseController {
|
|||||||
if (null == sgFeedPlan) {
|
if (null == sgFeedPlan) {
|
||||||
throw new RuntimeException("数据为空");
|
throw new RuntimeException("数据为空");
|
||||||
}
|
}
|
||||||
|
sgFeedPlan.setDeptId(getDeptId());
|
||||||
|
sgFeedPlan.setUserId(getUserId());
|
||||||
sgFeedPlan.setCreateDate(new Date());
|
sgFeedPlan.setCreateDate(new Date());
|
||||||
// 计算其他字段值
|
// 计算其他字段值
|
||||||
setPlan(sgFeedPlan);
|
setPlan(sgFeedPlan);
|
||||||
|
|||||||
@@ -84,6 +84,8 @@ public class SgFeedStatisticController extends BaseController {
|
|||||||
if (null == sgFeedStatistic.getFormulaId() && null == sgFeedStatistic.getFormulaBatchId()) {
|
if (null == sgFeedStatistic.getFormulaId() && null == sgFeedStatistic.getFormulaBatchId()) {
|
||||||
throw new RuntimeException("ERROR: 数据为空");
|
throw new RuntimeException("ERROR: 数据为空");
|
||||||
}
|
}
|
||||||
|
sgFeedStatistic.setUserId(getUserId());
|
||||||
|
sgFeedStatistic.setDeptId(getDeptId());
|
||||||
List<SgFeedStatistic> isExist = sgFeedStatisticService.selectSgFeedStatisticList(sgFeedStatistic);
|
List<SgFeedStatistic> isExist = sgFeedStatisticService.selectSgFeedStatisticList(sgFeedStatistic);
|
||||||
if (null != isExist && !isExist.isEmpty()) {
|
if (null != isExist && !isExist.isEmpty()) {
|
||||||
throw new RuntimeException("WARNING: 数据重复");
|
throw new RuntimeException("WARNING: 数据重复");
|
||||||
|
|||||||
@@ -79,6 +79,8 @@ public class SgFormulaListController extends BaseController
|
|||||||
@PostMapping
|
@PostMapping
|
||||||
public AjaxResult add(@RequestBody SgFormulaList sgFormulaList)
|
public AjaxResult add(@RequestBody SgFormulaList sgFormulaList)
|
||||||
{
|
{
|
||||||
|
sgFormulaList.setUserId(getUserId());
|
||||||
|
sgFormulaList.setDeptId(getDeptId());
|
||||||
return toAjax(sgFormulaListService.insertSgFormulaList(sgFormulaList));
|
return toAjax(sgFormulaListService.insertSgFormulaList(sgFormulaList));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -95,6 +95,8 @@ public class SgFormulaManagementController extends BaseController {
|
|||||||
public AjaxResult add(@RequestBody SgFormulaManagement sgFormulaManagement) {
|
public AjaxResult add(@RequestBody SgFormulaManagement sgFormulaManagement) {
|
||||||
if (null == sgFormulaManagement)
|
if (null == sgFormulaManagement)
|
||||||
throw new RuntimeException("ERROR: 数据为空");
|
throw new RuntimeException("ERROR: 数据为空");
|
||||||
|
sgFormulaManagement.setUserId(getUserId());
|
||||||
|
sgFormulaManagement.setDeptId(getDeptId());
|
||||||
if (Objects.equals(sgFormulaManagement.getBatchId(), "0")) {
|
if (Objects.equals(sgFormulaManagement.getBatchId(), "0")) {
|
||||||
SgFormulaManagement exist = sgFormulaManagementService.selectSgFormulaManagementByFormulaId(sgFormulaManagement.getFormulaId());
|
SgFormulaManagement exist = sgFormulaManagementService.selectSgFormulaManagementByFormulaId(sgFormulaManagement.getFormulaId());
|
||||||
if (exist != null) {
|
if (exist != null) {
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ package com.zhyc.module.feed.controller;
|
|||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import javax.servlet.http.HttpServletResponse;
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
|
||||||
import org.springframework.security.access.prepost.PreAuthorize;
|
import org.springframework.security.access.prepost.PreAuthorize;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.web.bind.annotation.GetMapping;
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
@@ -29,8 +30,7 @@ import com.zhyc.common.core.page.TableDataInfo;
|
|||||||
*/
|
*/
|
||||||
@RestController
|
@RestController
|
||||||
@RequestMapping("/feed/material")
|
@RequestMapping("/feed/material")
|
||||||
public class SgMaterialController extends BaseController
|
public class SgMaterialController extends BaseController {
|
||||||
{
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private ISgMaterialService sgMaterialService;
|
private ISgMaterialService sgMaterialService;
|
||||||
|
|
||||||
@@ -39,8 +39,7 @@ public class SgMaterialController extends BaseController
|
|||||||
*/
|
*/
|
||||||
@PreAuthorize("@ss.hasPermi('feed:material:list')")
|
@PreAuthorize("@ss.hasPermi('feed:material:list')")
|
||||||
@GetMapping("/list")
|
@GetMapping("/list")
|
||||||
public TableDataInfo list(SgMaterial sgMaterial)
|
public TableDataInfo list(SgMaterial sgMaterial) {
|
||||||
{
|
|
||||||
startPage();
|
startPage();
|
||||||
List<SgMaterial> list = sgMaterialService.selectSgMaterialList(sgMaterial);
|
List<SgMaterial> list = sgMaterialService.selectSgMaterialList(sgMaterial);
|
||||||
return getDataTable(list);
|
return getDataTable(list);
|
||||||
@@ -52,8 +51,7 @@ public class SgMaterialController extends BaseController
|
|||||||
@PreAuthorize("@ss.hasPermi('feed:material:export')")
|
@PreAuthorize("@ss.hasPermi('feed:material:export')")
|
||||||
@Log(title = "原料", businessType = BusinessType.EXPORT)
|
@Log(title = "原料", businessType = BusinessType.EXPORT)
|
||||||
@PostMapping("/export")
|
@PostMapping("/export")
|
||||||
public void export(HttpServletResponse response, SgMaterial sgMaterial)
|
public void export(HttpServletResponse response, SgMaterial sgMaterial) {
|
||||||
{
|
|
||||||
List<SgMaterial> list = sgMaterialService.selectSgMaterialList(sgMaterial);
|
List<SgMaterial> list = sgMaterialService.selectSgMaterialList(sgMaterial);
|
||||||
ExcelUtil<SgMaterial> util = new ExcelUtil<SgMaterial>(SgMaterial.class);
|
ExcelUtil<SgMaterial> util = new ExcelUtil<SgMaterial>(SgMaterial.class);
|
||||||
util.exportExcel(response, list, "原料数据");
|
util.exportExcel(response, list, "原料数据");
|
||||||
@@ -64,8 +62,7 @@ public class SgMaterialController extends BaseController
|
|||||||
*/
|
*/
|
||||||
@PreAuthorize("@ss.hasPermi('feed:material:query')")
|
@PreAuthorize("@ss.hasPermi('feed:material:query')")
|
||||||
@GetMapping(value = "/{materialId}")
|
@GetMapping(value = "/{materialId}")
|
||||||
public AjaxResult getInfo(@PathVariable("materialId") String materialId)
|
public AjaxResult getInfo(@PathVariable("materialId") String materialId) {
|
||||||
{
|
|
||||||
return success(sgMaterialService.selectSgMaterialByMaterialId(materialId));
|
return success(sgMaterialService.selectSgMaterialByMaterialId(materialId));
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -75,8 +72,9 @@ public class SgMaterialController extends BaseController
|
|||||||
@PreAuthorize("@ss.hasPermi('feed:material:add')")
|
@PreAuthorize("@ss.hasPermi('feed:material:add')")
|
||||||
@Log(title = "原料", businessType = BusinessType.INSERT)
|
@Log(title = "原料", businessType = BusinessType.INSERT)
|
||||||
@PostMapping
|
@PostMapping
|
||||||
public AjaxResult add(@RequestBody SgMaterial sgMaterial)
|
public AjaxResult add(@RequestBody SgMaterial sgMaterial) {
|
||||||
{
|
sgMaterial.setUserId(getUserId());
|
||||||
|
sgMaterial.setDeptId(getDeptId());
|
||||||
return toAjax(sgMaterialService.insertSgMaterial(sgMaterial));
|
return toAjax(sgMaterialService.insertSgMaterial(sgMaterial));
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -86,8 +84,7 @@ public class SgMaterialController extends BaseController
|
|||||||
@PreAuthorize("@ss.hasPermi('feed:material:edit')")
|
@PreAuthorize("@ss.hasPermi('feed:material:edit')")
|
||||||
@Log(title = "原料", businessType = BusinessType.UPDATE)
|
@Log(title = "原料", businessType = BusinessType.UPDATE)
|
||||||
@PutMapping
|
@PutMapping
|
||||||
public AjaxResult edit(@RequestBody SgMaterial sgMaterial)
|
public AjaxResult edit(@RequestBody SgMaterial sgMaterial) {
|
||||||
{
|
|
||||||
return toAjax(sgMaterialService.updateSgMaterial(sgMaterial));
|
return toAjax(sgMaterialService.updateSgMaterial(sgMaterial));
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -97,8 +94,7 @@ public class SgMaterialController extends BaseController
|
|||||||
@PreAuthorize("@ss.hasPermi('feed:material:remove')")
|
@PreAuthorize("@ss.hasPermi('feed:material:remove')")
|
||||||
@Log(title = "原料", businessType = BusinessType.DELETE)
|
@Log(title = "原料", businessType = BusinessType.DELETE)
|
||||||
@DeleteMapping("/{materialIds}")
|
@DeleteMapping("/{materialIds}")
|
||||||
public AjaxResult remove(@PathVariable String[] materialIds)
|
public AjaxResult remove(@PathVariable String[] materialIds) {
|
||||||
{
|
|
||||||
return toAjax(sgMaterialService.deleteSgMaterialByMaterialIds(materialIds));
|
return toAjax(sgMaterialService.deleteSgMaterialByMaterialIds(materialIds));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -19,26 +19,36 @@ import com.zhyc.common.core.domain.BaseEntity;
|
|||||||
*/
|
*/
|
||||||
@Setter
|
@Setter
|
||||||
@Getter
|
@Getter
|
||||||
public class SgFeedList extends BaseEntity
|
public class SgFeedList extends BaseEntity {
|
||||||
{
|
|
||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
|
private Long userId;
|
||||||
/** 序号 */
|
private Long deptId;
|
||||||
|
/**
|
||||||
|
* 序号
|
||||||
|
*/
|
||||||
private Long id;
|
private Long id;
|
||||||
|
|
||||||
/** 配方编号 */
|
/**
|
||||||
|
* 配方编号
|
||||||
|
*/
|
||||||
@Excel(name = "配方编号")
|
@Excel(name = "配方编号")
|
||||||
private String formulaId;
|
private String formulaId;
|
||||||
|
|
||||||
/** 配方批号 */
|
/**
|
||||||
|
* 配方批号
|
||||||
|
*/
|
||||||
@Excel(name = "配方批号")
|
@Excel(name = "配方批号")
|
||||||
private String formulaBatchId;
|
private String formulaBatchId;
|
||||||
|
|
||||||
/** 饲草班人员 */
|
/**
|
||||||
|
* 饲草班人员
|
||||||
|
*/
|
||||||
@Excel(name = "饲草班人员")
|
@Excel(name = "饲草班人员")
|
||||||
private String zookeeper;
|
private String zookeeper;
|
||||||
|
|
||||||
/** 配料日期 */
|
/**
|
||||||
|
* 配料日期
|
||||||
|
*/
|
||||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||||
@Excel(name = "配料日期", width = 30, dateFormat = "yyyy-MM-dd")
|
@Excel(name = "配料日期", width = 30, dateFormat = "yyyy-MM-dd")
|
||||||
private Date deployDate;
|
private Date deployDate;
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
package com.zhyc.module.feed.domain;
|
package com.zhyc.module.feed.domain;
|
||||||
|
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
|
|
||||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
import lombok.Setter;
|
import lombok.Setter;
|
||||||
@@ -17,119 +18,138 @@ import com.zhyc.common.core.domain.BaseEntity;
|
|||||||
*/
|
*/
|
||||||
@Getter
|
@Getter
|
||||||
@Setter
|
@Setter
|
||||||
public class SgFeedPlan extends BaseEntity
|
public class SgFeedPlan extends BaseEntity {
|
||||||
{
|
|
||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
|
private Long userId;
|
||||||
/** 创建日期 */
|
private Long deptId;
|
||||||
|
/**
|
||||||
|
* 创建日期
|
||||||
|
*/
|
||||||
private Date createDate;
|
private Date createDate;
|
||||||
|
|
||||||
/** 配方编码 */
|
/**
|
||||||
|
* 配方编码
|
||||||
|
*/
|
||||||
@Excel(name = "配方编码")
|
@Excel(name = "配方编码")
|
||||||
private String formulaId;
|
private String formulaId;
|
||||||
|
|
||||||
/** 批号 */
|
/**
|
||||||
|
* 批号
|
||||||
|
*/
|
||||||
@Excel(name = "批号")
|
@Excel(name = "批号")
|
||||||
private String batchId;
|
private String batchId;
|
||||||
|
|
||||||
/** 羊舍 */
|
/**
|
||||||
|
* 羊舍
|
||||||
|
*/
|
||||||
@Excel(name = "羊舍")
|
@Excel(name = "羊舍")
|
||||||
private Integer sheepHouseId;
|
private Integer sheepHouseId;
|
||||||
|
|
||||||
/** 羊只数量 */
|
/**
|
||||||
|
* 羊只数量
|
||||||
|
*/
|
||||||
@Excel(name = "羊只数量")
|
@Excel(name = "羊只数量")
|
||||||
private Integer sheepCount;
|
private Integer sheepCount;
|
||||||
|
|
||||||
/** 日均计划量 */
|
/**
|
||||||
|
* 日均计划量
|
||||||
|
*/
|
||||||
@Excel(name = "日均计划量")
|
@Excel(name = "日均计划量")
|
||||||
private Double planDailySize;
|
private Double planDailySize;
|
||||||
|
|
||||||
/** 饲喂比例(早) */
|
/**
|
||||||
|
* 饲喂比例(早)
|
||||||
|
*/
|
||||||
@Excel(name = "饲喂比例(早)")
|
@Excel(name = "饲喂比例(早)")
|
||||||
private Double ratioMorning;
|
private Double ratioMorning;
|
||||||
|
|
||||||
/** 饲喂比例(中) */
|
/**
|
||||||
|
* 饲喂比例(中)
|
||||||
|
*/
|
||||||
@Excel(name = "饲喂比例(中)")
|
@Excel(name = "饲喂比例(中)")
|
||||||
private Double ratioNoon;
|
private Double ratioNoon;
|
||||||
|
|
||||||
/** 饲喂比例(下) */
|
/**
|
||||||
|
* 饲喂比例(下)
|
||||||
|
*/
|
||||||
@Excel(name = "饲喂比例(下)")
|
@Excel(name = "饲喂比例(下)")
|
||||||
private Double ratioAfternoon;
|
private Double ratioAfternoon;
|
||||||
|
|
||||||
/** 计划量(早) */
|
/**
|
||||||
|
* 计划量(早)
|
||||||
|
*/
|
||||||
@Excel(name = "计划量(早)")
|
@Excel(name = "计划量(早)")
|
||||||
private Double planMorningSize;
|
private Double planMorningSize;
|
||||||
|
|
||||||
/** 计划总量(早) */
|
/**
|
||||||
|
* 计划总量(早)
|
||||||
|
*/
|
||||||
@Excel(name = "计划总量(早)")
|
@Excel(name = "计划总量(早)")
|
||||||
private Double planMorningTotal;
|
private Double planMorningTotal;
|
||||||
|
|
||||||
/** 实际量(早) */
|
/**
|
||||||
|
* 实际量(早)
|
||||||
|
*/
|
||||||
@Excel(name = "实际量(早)")
|
@Excel(name = "实际量(早)")
|
||||||
private Double actualMorningSize;
|
private Double actualMorningSize;
|
||||||
|
|
||||||
/** 计划量(中) */
|
/**
|
||||||
|
* 计划量(中)
|
||||||
|
*/
|
||||||
@Excel(name = "计划量(中)")
|
@Excel(name = "计划量(中)")
|
||||||
private Double planNoonSize;
|
private Double planNoonSize;
|
||||||
|
|
||||||
/** 计划总量(中) */
|
/**
|
||||||
|
* 计划总量(中)
|
||||||
|
*/
|
||||||
@Excel(name = "计划总量(中)")
|
@Excel(name = "计划总量(中)")
|
||||||
private Double planNoonTotal;
|
private Double planNoonTotal;
|
||||||
|
|
||||||
/** 实际量(中) */
|
/**
|
||||||
|
* 实际量(中)
|
||||||
|
*/
|
||||||
@Excel(name = "实际量(中)")
|
@Excel(name = "实际量(中)")
|
||||||
private Double actualNoonSize;
|
private Double actualNoonSize;
|
||||||
|
|
||||||
/** 计划量(下) */
|
/**
|
||||||
|
* 计划量(下)
|
||||||
|
*/
|
||||||
@Excel(name = "计划量(下)")
|
@Excel(name = "计划量(下)")
|
||||||
private Double planAfternoonSize;
|
private Double planAfternoonSize;
|
||||||
|
|
||||||
/** 计划总量(下) */
|
/**
|
||||||
|
* 计划总量(下)
|
||||||
|
*/
|
||||||
@Excel(name = "计划总量(下)")
|
@Excel(name = "计划总量(下)")
|
||||||
private Double planAfternoonTotal;
|
private Double planAfternoonTotal;
|
||||||
|
|
||||||
/** 实际量(下) */
|
/**
|
||||||
|
* 实际量(下)
|
||||||
|
*/
|
||||||
@Excel(name = "实际量(下)")
|
@Excel(name = "实际量(下)")
|
||||||
private Double actualAfternoonSize;
|
private Double actualAfternoonSize;
|
||||||
|
|
||||||
/** 计划饲喂总量 */
|
/**
|
||||||
|
* 计划饲喂总量
|
||||||
|
*/
|
||||||
@Excel(name = "计划饲喂总量")
|
@Excel(name = "计划饲喂总量")
|
||||||
private Double planFeedTotal;
|
private Double planFeedTotal;
|
||||||
|
|
||||||
/** 饲草班人员 */
|
/**
|
||||||
|
* 饲草班人员
|
||||||
|
*/
|
||||||
@Excel(name = "饲草班人员")
|
@Excel(name = "饲草班人员")
|
||||||
private String zookeeper;
|
private String zookeeper;
|
||||||
|
|
||||||
/** 饲喂计划日期 */
|
/**
|
||||||
|
* 饲喂计划日期
|
||||||
|
*/
|
||||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||||
@Excel(name = "饲喂计划日期", width = 30, dateFormat = "yyyy-MM-dd")
|
@Excel(name = "饲喂计划日期", width = 30, dateFormat = "yyyy-MM-dd")
|
||||||
private Date planDate;
|
private Date planDate;
|
||||||
|
|
||||||
@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("createDate", getCreateDate()).append("formulaId", getFormulaId()).append("batchId", getBatchId()).append("sheepHouseId", getSheepHouseId()).append("sheepCount", getSheepCount()).append("planDailySize", getPlanDailySize()).append("ratioMorning", getRatioMorning()).append("ratioNoon", getRatioNoon()).append("ratioAfternoon", getRatioAfternoon()).append("planMorningSize", getPlanMorningSize()).append("planMorningTotal", getPlanMorningTotal()).append("actualMorningSize", getActualMorningSize()).append("planNoonSize", getPlanNoonSize()).append("planNoonTotal", getPlanNoonTotal()).append("actualNoonSize", getActualNoonSize()).append("planAfternoonSize", getPlanAfternoonSize()).append("planAfternoonTotal", getPlanAfternoonTotal()).append("actualAfternoonSize", getActualAfternoonSize()).append("planFeedTotal", getPlanFeedTotal()).append("zookeeper", getZookeeper()).append("planDate", getPlanDate()).append("remark", getRemark()).toString();
|
||||||
.append("createDate", getCreateDate())
|
|
||||||
.append("formulaId", getFormulaId())
|
|
||||||
.append("batchId", getBatchId())
|
|
||||||
.append("sheepHouseId", getSheepHouseId())
|
|
||||||
.append("sheepCount", getSheepCount())
|
|
||||||
.append("planDailySize", getPlanDailySize())
|
|
||||||
.append("ratioMorning", getRatioMorning())
|
|
||||||
.append("ratioNoon", getRatioNoon())
|
|
||||||
.append("ratioAfternoon", getRatioAfternoon())
|
|
||||||
.append("planMorningSize", getPlanMorningSize())
|
|
||||||
.append("planMorningTotal", getPlanMorningTotal())
|
|
||||||
.append("actualMorningSize", getActualMorningSize())
|
|
||||||
.append("planNoonSize", getPlanNoonSize())
|
|
||||||
.append("planNoonTotal", getPlanNoonTotal())
|
|
||||||
.append("actualNoonSize", getActualNoonSize())
|
|
||||||
.append("planAfternoonSize", getPlanAfternoonSize())
|
|
||||||
.append("planAfternoonTotal", getPlanAfternoonTotal())
|
|
||||||
.append("actualAfternoonSize", getActualAfternoonSize())
|
|
||||||
.append("planFeedTotal", getPlanFeedTotal())
|
|
||||||
.append("zookeeper", getZookeeper())
|
|
||||||
.append("planDate", getPlanDate())
|
|
||||||
.append("remark", getRemark())
|
|
||||||
.toString();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -23,7 +23,8 @@ import java.util.List;
|
|||||||
@Getter
|
@Getter
|
||||||
public class SgFeedStatistic extends BaseEntity {
|
public class SgFeedStatistic extends BaseEntity {
|
||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
|
private Long userId;
|
||||||
|
private Long deptId;
|
||||||
/**
|
/**
|
||||||
* UUID
|
* UUID
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -15,27 +15,39 @@ import com.zhyc.common.core.domain.BaseEntity;
|
|||||||
*/
|
*/
|
||||||
@Setter
|
@Setter
|
||||||
@Getter
|
@Getter
|
||||||
public class SgFormulaList extends BaseEntity
|
public class SgFormulaList extends BaseEntity {
|
||||||
{
|
|
||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
|
private Long userId;
|
||||||
/** 序号 */
|
private Long deptId;
|
||||||
|
/**
|
||||||
|
* 序号
|
||||||
|
*/
|
||||||
private Long code;
|
private Long code;
|
||||||
|
|
||||||
/** 配方编号 */
|
/**
|
||||||
|
* 配方编号
|
||||||
|
*/
|
||||||
private String formulaId;
|
private String formulaId;
|
||||||
|
|
||||||
/** 配方编号 */
|
/**
|
||||||
|
* 配方编号
|
||||||
|
*/
|
||||||
private String batchId;
|
private String batchId;
|
||||||
/** 原料编号 */
|
/**
|
||||||
|
* 原料编号
|
||||||
|
*/
|
||||||
@Excel(name = "原料编号")
|
@Excel(name = "原料编号")
|
||||||
private String materialId;
|
private String materialId;
|
||||||
|
|
||||||
/** 原料名称 */
|
/**
|
||||||
|
* 原料名称
|
||||||
|
*/
|
||||||
@Excel(name = "原料名称")
|
@Excel(name = "原料名称")
|
||||||
private String materialName;
|
private String materialName;
|
||||||
|
|
||||||
/** 比例 */
|
/**
|
||||||
|
* 比例
|
||||||
|
*/
|
||||||
@Excel(name = "比例")
|
@Excel(name = "比例")
|
||||||
private Long ratio;
|
private Long ratio;
|
||||||
|
|
||||||
|
|||||||
@@ -19,49 +19,69 @@ import com.zhyc.common.core.domain.BaseEntity;
|
|||||||
*/
|
*/
|
||||||
@Setter
|
@Setter
|
||||||
@Getter
|
@Getter
|
||||||
public class SgFormulaManagement extends BaseEntity
|
public class SgFormulaManagement extends BaseEntity {
|
||||||
{
|
|
||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
|
private Long userId;
|
||||||
/** 配方编号 */
|
private Long deptId;
|
||||||
|
/**
|
||||||
|
* 配方编号
|
||||||
|
*/
|
||||||
private String formulaId;
|
private String formulaId;
|
||||||
|
|
||||||
/** 饲养阶段 */
|
/**
|
||||||
|
* 饲养阶段
|
||||||
|
*/
|
||||||
@Excel(name = "饲养阶段")
|
@Excel(name = "饲养阶段")
|
||||||
private String feedStage;
|
private String feedStage;
|
||||||
|
|
||||||
/** 批号 */
|
/**
|
||||||
|
* 批号
|
||||||
|
*/
|
||||||
@Excel(name = "批号")
|
@Excel(name = "批号")
|
||||||
private String batchId;
|
private String batchId;
|
||||||
|
|
||||||
/** 开始使用时间 */
|
/**
|
||||||
|
* 开始使用时间
|
||||||
|
*/
|
||||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||||
@Excel(name = "开始使用时间", width = 30, dateFormat = "yyyy-MM-dd")
|
@Excel(name = "开始使用时间", width = 30, dateFormat = "yyyy-MM-dd")
|
||||||
private Date useStartDate;
|
private Date useStartDate;
|
||||||
|
|
||||||
/** 结束使用时间 */
|
/**
|
||||||
|
* 结束使用时间
|
||||||
|
*/
|
||||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||||
@Excel(name = "结束使用时间", width = 30, dateFormat = "yyyy-MM-dd")
|
@Excel(name = "结束使用时间", width = 30, dateFormat = "yyyy-MM-dd")
|
||||||
private Date useEndDate;
|
private Date useEndDate;
|
||||||
|
|
||||||
/** 使用状态 */
|
/**
|
||||||
|
* 使用状态
|
||||||
|
*/
|
||||||
@Excel(name = "使用状态")
|
@Excel(name = "使用状态")
|
||||||
private String useState;
|
private String useState;
|
||||||
|
|
||||||
/** 备注 */
|
/**
|
||||||
|
* 备注
|
||||||
|
*/
|
||||||
@Excel(name = "备注")
|
@Excel(name = "备注")
|
||||||
private String remark;
|
private String remark;
|
||||||
|
|
||||||
/** 配方列表 */
|
/**
|
||||||
|
* 配方列表
|
||||||
|
*/
|
||||||
private List<SgFormulaList> sgFormulaList;
|
private List<SgFormulaList> sgFormulaList;
|
||||||
|
|
||||||
/** 子配方 */
|
/**
|
||||||
|
* 子配方
|
||||||
|
*/
|
||||||
private List<SgFormulaManagement> subFormulaList;
|
private List<SgFormulaManagement> subFormulaList;
|
||||||
|
|
||||||
/** 查询类型 *
|
/**
|
||||||
|
* 查询类型 *
|
||||||
* Sub : 子配方查询
|
* Sub : 子配方查询
|
||||||
* query : 类型查询
|
* query : 类型查询
|
||||||
* */
|
*
|
||||||
|
*/
|
||||||
private String queryType;
|
private String queryType;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
package com.zhyc.module.feed.domain;
|
package com.zhyc.module.feed.domain;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||||
import com.zhyc.common.annotation.Excel;
|
import com.zhyc.common.annotation.Excel;
|
||||||
@@ -11,58 +12,55 @@ import com.zhyc.common.core.domain.BaseEntity;
|
|||||||
* @author HashMap
|
* @author HashMap
|
||||||
* @date 2026-01-16
|
* @date 2026-01-16
|
||||||
*/
|
*/
|
||||||
public class SgMaterial extends BaseEntity
|
@Data
|
||||||
{
|
public class SgMaterial extends BaseEntity {
|
||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
|
private Long userId;
|
||||||
/** 原料编码 */
|
private Long deptId;
|
||||||
|
/**
|
||||||
|
* 原料编码
|
||||||
|
*/
|
||||||
@Excel(name = "原料编码")
|
@Excel(name = "原料编码")
|
||||||
private String materialId;
|
private String materialId;
|
||||||
|
|
||||||
/** 原料名称 */
|
/**
|
||||||
|
* 原料名称
|
||||||
|
*/
|
||||||
@Excel(name = "原料名称")
|
@Excel(name = "原料名称")
|
||||||
private String materialName;
|
private String materialName;
|
||||||
|
|
||||||
/** 颗粒料 */
|
/**
|
||||||
|
* 颗粒料
|
||||||
|
*/
|
||||||
@Excel(name = "颗粒料")
|
@Excel(name = "颗粒料")
|
||||||
private Integer isGranular;
|
private Integer isGranular;
|
||||||
|
|
||||||
public void setMaterialId(String materialId)
|
public void setMaterialId(String materialId) {
|
||||||
{
|
|
||||||
this.materialId = materialId;
|
this.materialId = materialId;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getMaterialId()
|
public String getMaterialId() {
|
||||||
{
|
|
||||||
return materialId;
|
return materialId;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setMaterialName(String materialName)
|
public void setMaterialName(String materialName) {
|
||||||
{
|
|
||||||
this.materialName = materialName;
|
this.materialName = materialName;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getMaterialName()
|
public String getMaterialName() {
|
||||||
{
|
|
||||||
return materialName;
|
return materialName;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setIsGranular(Integer isGranular)
|
public void setIsGranular(Integer isGranular) {
|
||||||
{
|
|
||||||
this.isGranular = isGranular;
|
this.isGranular = isGranular;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Integer getIsGranular()
|
public Integer getIsGranular() {
|
||||||
{
|
|
||||||
return isGranular;
|
return isGranular;
|
||||||
}
|
}
|
||||||
|
|
||||||
@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("materialId", getMaterialId()).append("materialName", getMaterialName()).append("isGranular", getIsGranular()).toString();
|
||||||
.append("materialId", getMaterialId())
|
|
||||||
.append("materialName", getMaterialName())
|
|
||||||
.append("isGranular", getIsGranular())
|
|
||||||
.toString();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ package com.zhyc.module.feed.service.impl;
|
|||||||
|
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
|
|
||||||
|
import com.zhyc.common.annotation.DataScope;
|
||||||
import com.zhyc.module.feed.domain.SgFeedPlan;
|
import com.zhyc.module.feed.domain.SgFeedPlan;
|
||||||
import com.zhyc.module.feed.domain.SgFormulaManagement;
|
import com.zhyc.module.feed.domain.SgFormulaManagement;
|
||||||
import com.zhyc.module.feed.service.ISgFeedPlanService;
|
import com.zhyc.module.feed.service.ISgFeedPlanService;
|
||||||
@@ -56,6 +57,7 @@ public class SgFeedListServiceImpl implements ISgFeedListService {
|
|||||||
* @return 配料清单
|
* @return 配料清单
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
|
@DataScope(deptAlias = "sg_feed_list_alias", userAlias = "sg_feed_list_alias")
|
||||||
public List<SgFeedList> selectSgFeedListList(SgFeedList sgFeedList) {
|
public List<SgFeedList> selectSgFeedListList(SgFeedList sgFeedList) {
|
||||||
return sgFeedListMapper.selectSgFeedListList(sgFeedList);
|
return sgFeedListMapper.selectSgFeedListList(sgFeedList);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ package com.zhyc.module.feed.service.impl;
|
|||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
import com.zhyc.common.annotation.DataScope;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import com.zhyc.module.feed.mapper.SgFeedPlanMapper;
|
import com.zhyc.module.feed.mapper.SgFeedPlanMapper;
|
||||||
import com.zhyc.module.feed.domain.SgFeedPlan;
|
import com.zhyc.module.feed.domain.SgFeedPlan;
|
||||||
@@ -17,8 +18,7 @@ import org.springframework.transaction.annotation.Transactional;
|
|||||||
*/
|
*/
|
||||||
@Service
|
@Service
|
||||||
@Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public class SgFeedPlanServiceImpl implements ISgFeedPlanService
|
public class SgFeedPlanServiceImpl implements ISgFeedPlanService {
|
||||||
{
|
|
||||||
private final SgFeedPlanMapper sgFeedPlanMapper;
|
private final SgFeedPlanMapper sgFeedPlanMapper;
|
||||||
|
|
||||||
public SgFeedPlanServiceImpl(SgFeedPlanMapper sgFeedPlanMapper) {
|
public SgFeedPlanServiceImpl(SgFeedPlanMapper sgFeedPlanMapper) {
|
||||||
@@ -32,8 +32,7 @@ public class SgFeedPlanServiceImpl implements ISgFeedPlanService
|
|||||||
* @return 饲喂计划
|
* @return 饲喂计划
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public SgFeedPlan selectSgFeedPlanByCreateDate(Date createDate)
|
public SgFeedPlan selectSgFeedPlanByCreateDate(Date createDate) {
|
||||||
{
|
|
||||||
return sgFeedPlanMapper.selectSgFeedPlanByCreateDate(createDate);
|
return sgFeedPlanMapper.selectSgFeedPlanByCreateDate(createDate);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -44,8 +43,8 @@ public class SgFeedPlanServiceImpl implements ISgFeedPlanService
|
|||||||
* @return 饲喂计划
|
* @return 饲喂计划
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public List<SgFeedPlan> selectSgFeedPlanList(SgFeedPlan sgFeedPlan)
|
@DataScope(deptAlias = "sg_feed_plan_alias", userAlias = "sg_feed_plan_alias")
|
||||||
{
|
public List<SgFeedPlan> selectSgFeedPlanList(SgFeedPlan sgFeedPlan) {
|
||||||
return sgFeedPlanMapper.selectSgFeedPlanList(sgFeedPlan);
|
return sgFeedPlanMapper.selectSgFeedPlanList(sgFeedPlan);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -56,8 +55,7 @@ public class SgFeedPlanServiceImpl implements ISgFeedPlanService
|
|||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public int insertSgFeedPlan(SgFeedPlan sgFeedPlan)
|
public int insertSgFeedPlan(SgFeedPlan sgFeedPlan) {
|
||||||
{
|
|
||||||
return sgFeedPlanMapper.insertSgFeedPlan(sgFeedPlan);
|
return sgFeedPlanMapper.insertSgFeedPlan(sgFeedPlan);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -68,8 +66,7 @@ public class SgFeedPlanServiceImpl implements ISgFeedPlanService
|
|||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public int updateSgFeedPlan(SgFeedPlan sgFeedPlan)
|
public int updateSgFeedPlan(SgFeedPlan sgFeedPlan) {
|
||||||
{
|
|
||||||
return sgFeedPlanMapper.updateSgFeedPlan(sgFeedPlan);
|
return sgFeedPlanMapper.updateSgFeedPlan(sgFeedPlan);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -80,8 +77,7 @@ public class SgFeedPlanServiceImpl implements ISgFeedPlanService
|
|||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public int deleteSgFeedPlanByCreateDates(Date[] createDates)
|
public int deleteSgFeedPlanByCreateDates(Date[] createDates) {
|
||||||
{
|
|
||||||
return sgFeedPlanMapper.deleteSgFeedPlanByCreateDates(createDates);
|
return sgFeedPlanMapper.deleteSgFeedPlanByCreateDates(createDates);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -92,8 +88,7 @@ public class SgFeedPlanServiceImpl implements ISgFeedPlanService
|
|||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public int deleteSgFeedPlanByCreateDate(Date createDate)
|
public int deleteSgFeedPlanByCreateDate(Date createDate) {
|
||||||
{
|
|
||||||
return sgFeedPlanMapper.deleteSgFeedPlanByCreateDate(createDate);
|
return sgFeedPlanMapper.deleteSgFeedPlanByCreateDate(createDate);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ package com.zhyc.module.feed.service.impl;
|
|||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
|
import com.zhyc.common.annotation.DataScope;
|
||||||
import com.zhyc.module.base.domain.DaSheepfold;
|
import com.zhyc.module.base.domain.DaSheepfold;
|
||||||
import com.zhyc.module.feed.domain.SgFeedList;
|
import com.zhyc.module.feed.domain.SgFeedList;
|
||||||
import com.zhyc.module.feed.domain.SgFeedPlan;
|
import com.zhyc.module.feed.domain.SgFeedPlan;
|
||||||
@@ -51,6 +52,7 @@ public class SgFeedStatisticServiceImpl implements ISgFeedStatisticService {
|
|||||||
* @return 饲喂量统计
|
* @return 饲喂量统计
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
|
@DataScope(deptAlias = "sg_feed_statistic_alias", userAlias = "sg_feed_statistic_alias")
|
||||||
public List<SgFeedStatistic> selectSgFeedStatisticList(SgFeedStatistic sgFeedStatistic) {
|
public List<SgFeedStatistic> selectSgFeedStatisticList(SgFeedStatistic sgFeedStatistic) {
|
||||||
return sgFeedStatisticMapper.selectSgFeedStatisticList(sgFeedStatistic);
|
return sgFeedStatisticMapper.selectSgFeedStatisticList(sgFeedStatistic);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ package com.zhyc.module.feed.service.impl;
|
|||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
import com.zhyc.common.annotation.DataScope;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import com.zhyc.module.feed.mapper.SgFormulaListMapper;
|
import com.zhyc.module.feed.mapper.SgFormulaListMapper;
|
||||||
import com.zhyc.module.feed.domain.SgFormulaList;
|
import com.zhyc.module.feed.domain.SgFormulaList;
|
||||||
@@ -41,6 +42,7 @@ public class SgFormulaListServiceImpl implements ISgFormulaListService {
|
|||||||
* @return 配方列表
|
* @return 配方列表
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
|
@DataScope(deptAlias = "sg_formula_list_alias", userAlias = "sg_formula_list_alias")
|
||||||
public List<SgFormulaList> selectSgFormulaListList(SgFormulaList sgFormulaList) {
|
public List<SgFormulaList> selectSgFormulaListList(SgFormulaList sgFormulaList) {
|
||||||
return sgFormulaListMapper.selectSgFormulaListList(sgFormulaList);
|
return sgFormulaListMapper.selectSgFormulaListList(sgFormulaList);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ import java.util.Iterator;
|
|||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
|
|
||||||
|
import com.zhyc.common.annotation.DataScope;
|
||||||
import com.zhyc.module.feed.domain.SgFormulaList;
|
import com.zhyc.module.feed.domain.SgFormulaList;
|
||||||
import com.zhyc.module.feed.mapper.SgFormulaListMapper;
|
import com.zhyc.module.feed.mapper.SgFormulaListMapper;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
@@ -46,6 +47,7 @@ public class SgFormulaManagementServiceImpl implements ISgFormulaManagementServi
|
|||||||
* @return 配方管理
|
* @return 配方管理
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
|
@DataScope(deptAlias = "sg_formula_management_alias", userAlias = "sg_formula_management_alias")
|
||||||
public List<SgFormulaManagement> selectSgFormulaManagementList(SgFormulaManagement sgFormulaManagement) {
|
public List<SgFormulaManagement> selectSgFormulaManagementList(SgFormulaManagement sgFormulaManagement) {
|
||||||
List<SgFormulaManagement> sgFormulaManagements =
|
List<SgFormulaManagement> sgFormulaManagements =
|
||||||
sgFormulaManagementMapper.selectSgFormulaManagementList(sgFormulaManagement);
|
sgFormulaManagementMapper.selectSgFormulaManagementList(sgFormulaManagement);
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ package com.zhyc.module.feed.service.impl;
|
|||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
import com.zhyc.common.annotation.DataScope;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import com.zhyc.module.feed.mapper.SgMaterialMapper;
|
import com.zhyc.module.feed.mapper.SgMaterialMapper;
|
||||||
@@ -37,6 +38,7 @@ public class SgMaterialServiceImpl implements ISgMaterialService {
|
|||||||
* @return 原料
|
* @return 原料
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
|
@DataScope(deptAlias = "sg_material_alias", userAlias = "sg_material_alias")
|
||||||
public List<SgMaterial> selectSgMaterialList(SgMaterial sgMaterial) {
|
public List<SgMaterial> selectSgMaterialList(SgMaterial sgMaterial) {
|
||||||
return sgMaterialMapper.selectSgMaterialList(sgMaterial);
|
return sgMaterialMapper.selectSgMaterialList(sgMaterial);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -318,49 +318,6 @@ public class ScBreedRecordServiceImpl implements IScBreedRecordService
|
|||||||
return scBreedRecordMapper.selectBreedRecordByMatingTime(sheepId, startDate, endDate);
|
return scBreedRecordMapper.selectBreedRecordByMatingTime(sheepId, startDate, endDate);
|
||||||
}
|
}
|
||||||
|
|
||||||
// /**
|
|
||||||
// * 新增配种记录
|
|
||||||
// *
|
|
||||||
// * @param scBreedRecord 配种记录
|
|
||||||
// * @return 结果
|
|
||||||
// */
|
|
||||||
// @Override
|
|
||||||
// public int insertScBreedRecord(ScBreedRecord scBreedRecord)
|
|
||||||
// {
|
|
||||||
// // 设置创建时间
|
|
||||||
// scBreedRecord.setCreateTime(DateUtils.getNowDate());
|
|
||||||
//
|
|
||||||
// // 插入配种记录
|
|
||||||
// int result = scBreedRecordMapper.insertScBreedRecord(scBreedRecord);
|
|
||||||
//
|
|
||||||
// // 如果插入成功,同步更新羊只的配种日期
|
|
||||||
// if (result > 0 && scBreedRecord.getEweId() != null) {
|
|
||||||
// try {
|
|
||||||
// Long eweId = Long.parseLong(scBreedRecord.getEweId());
|
|
||||||
//
|
|
||||||
//// // 方案1:只更新配种日期(推荐)
|
|
||||||
//// scBreedRecordMapper.updateSheepMatingDate(
|
|
||||||
//// eweId,
|
|
||||||
//// scBreedRecord.getCreateTime(),
|
|
||||||
//// scBreedRecord.getCreateBy()
|
|
||||||
//// );
|
|
||||||
//
|
|
||||||
//// 方案2:同时更新配种日期和配种次数(如果需要的话,取消下面注释)
|
|
||||||
// scBreedRecordMapper.incrementSheepMatingCount(
|
|
||||||
// eweId,
|
|
||||||
// scBreedRecord.getCreateTime(),
|
|
||||||
// scBreedRecord.getCreateBy()
|
|
||||||
// );
|
|
||||||
//
|
|
||||||
// log.info("同步更新羊只 {} 的配种日期成功", eweId);
|
|
||||||
// } catch (Exception e) {
|
|
||||||
// log.error("同步更新羊只配种日期失败", e);
|
|
||||||
// // 不影响主流程,只记录日志
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// return result;
|
|
||||||
// }
|
|
||||||
/**
|
/**
|
||||||
* 新增配种记录
|
* 新增配种记录
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -13,16 +13,20 @@
|
|||||||
</resultMap>
|
</resultMap>
|
||||||
|
|
||||||
<sql id="selectSgFeedListVo">
|
<sql id="selectSgFeedListVo">
|
||||||
select id, formula_id, formula_batch_id, zookeeper, deploy_date from sg_feed_list
|
select id, formula_id, formula_batch_id, zookeeper, deploy_date
|
||||||
|
from sg_feed_list sg_feed_list_alias
|
||||||
</sql>
|
</sql>
|
||||||
|
|
||||||
<select id="selectSgFeedListList" parameterType="SgFeedList" resultMap="SgFeedListResult">
|
<select id="selectSgFeedListList" parameterType="SgFeedList" resultMap="SgFeedListResult">
|
||||||
<include refid="selectSgFeedListVo"/>
|
<include refid="selectSgFeedListVo"/>
|
||||||
<where>
|
<where>
|
||||||
<if test="formulaId != null and formulaId != ''">and formula_id LIKE CONCAT('%',#{formulaId},'%')</if>
|
<if test="formulaId != null and formulaId != ''">and formula_id LIKE CONCAT('%',#{formulaId},'%')</if>
|
||||||
<if test="formulaBatchId != null and formulaBatchId != ''"> and formula_batch_id LIKE CONCAT('%',#{formulaBatchId},'%')</if>
|
<if test="formulaBatchId != null and formulaBatchId != ''">and formula_batch_id LIKE
|
||||||
|
CONCAT('%',#{formulaBatchId},'%')
|
||||||
|
</if>
|
||||||
<if test="zookeeper != null and zookeeper != ''">and zookeeper LIKE CONCAT('%',#{zookeeper},'%')</if>
|
<if test="zookeeper != null and zookeeper != ''">and zookeeper LIKE CONCAT('%',#{zookeeper},'%')</if>
|
||||||
<if test="deployDate != null ">and deploy_date = #{deployDate}</if>
|
<if test="deployDate != null ">and deploy_date = #{deployDate}</if>
|
||||||
|
${params.dataScope}
|
||||||
</where>
|
</where>
|
||||||
ORDER BY deploy_date ASC, formula_id ASC, formula_batch_id ASC
|
ORDER BY deploy_date ASC, formula_id ASC, formula_batch_id ASC
|
||||||
</select>
|
</select>
|
||||||
@@ -39,12 +43,16 @@
|
|||||||
<if test="formulaBatchId != null">formula_batch_id,</if>
|
<if test="formulaBatchId != null">formula_batch_id,</if>
|
||||||
<if test="zookeeper != null">zookeeper,</if>
|
<if test="zookeeper != null">zookeeper,</if>
|
||||||
<if test="deployDate != null">deploy_date,</if>
|
<if test="deployDate != null">deploy_date,</if>
|
||||||
|
<if test="userId != null">user_id,</if>
|
||||||
|
<if test="deptId != null">dept_id,</if>
|
||||||
</trim>
|
</trim>
|
||||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||||
<if test="formulaId != null">#{formulaId},</if>
|
<if test="formulaId != null">#{formulaId},</if>
|
||||||
<if test="formulaBatchId != null">#{formulaBatchId},</if>
|
<if test="formulaBatchId != null">#{formulaBatchId},</if>
|
||||||
<if test="zookeeper != null">#{zookeeper},</if>
|
<if test="zookeeper != null">#{zookeeper},</if>
|
||||||
<if test="deployDate != null">#{deployDate},</if>
|
<if test="deployDate != null">#{deployDate},</if>
|
||||||
|
<if test="userId != null">#{userId},</if>
|
||||||
|
<if test="deptId != null">#{deptId},</if>
|
||||||
</trim>
|
</trim>
|
||||||
</insert>
|
</insert>
|
||||||
|
|
||||||
@@ -60,7 +68,9 @@
|
|||||||
</update>
|
</update>
|
||||||
|
|
||||||
<delete id="deleteSgFeedListById" parameterType="Long">
|
<delete id="deleteSgFeedListById" parameterType="Long">
|
||||||
delete from sg_feed_list where id = #{id}
|
delete
|
||||||
|
from sg_feed_list
|
||||||
|
where id = #{id}
|
||||||
</delete>
|
</delete>
|
||||||
|
|
||||||
<delete id="deleteSgFeedListByIds" parameterType="String">
|
<delete id="deleteSgFeedListByIds" parameterType="String">
|
||||||
@@ -71,6 +81,7 @@
|
|||||||
</delete>
|
</delete>
|
||||||
|
|
||||||
<delete id="deleteAll">
|
<delete id="deleteAll">
|
||||||
DELETE FROM sg_feed_list;
|
DELETE
|
||||||
|
FROM sg_feed_list;
|
||||||
</delete>
|
</delete>
|
||||||
</mapper>
|
</mapper>
|
||||||
@@ -30,7 +30,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
</resultMap>
|
</resultMap>
|
||||||
|
|
||||||
<sql id="selectSgFeedPlanVo">
|
<sql id="selectSgFeedPlanVo">
|
||||||
select create_date, formula_id, batch_id, sheep_house_id, sheep_count, plan_daily_size, ratio_morning, ratio_noon, ratio_afternoon, plan_morning_size, plan_morning_total, actual_morning_size, plan_noon_size, plan_noon_total, actual_noon_size, plan_afternoon_size, plan_afternoon_total, actual_afternoon_size, plan_feed_total, zookeeper, plan_date, remark from sg_feed_plan
|
select create_date, formula_id, batch_id, sheep_house_id, sheep_count, plan_daily_size, ratio_morning, ratio_noon, ratio_afternoon, plan_morning_size, plan_morning_total, actual_morning_size, plan_noon_size, plan_noon_total, actual_noon_size, plan_afternoon_size, plan_afternoon_total, actual_afternoon_size, plan_feed_total, zookeeper, plan_date, remark from sg_feed_plan sg_feed_plan_alias
|
||||||
</sql>
|
</sql>
|
||||||
|
|
||||||
<select id="selectSgFeedPlanList" parameterType="SgFeedPlan" resultMap="SgFeedPlanResult">
|
<select id="selectSgFeedPlanList" parameterType="SgFeedPlan" resultMap="SgFeedPlanResult">
|
||||||
@@ -40,6 +40,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
<if test="batchId != null and batchId != ''">and batch_id LIKE CONCAT('%',#{batchId},'%')</if>
|
<if test="batchId != null and batchId != ''">and batch_id LIKE CONCAT('%',#{batchId},'%')</if>
|
||||||
<if test="sheepHouseId != null ">and sheep_house_id LIKE CONCAT('%',#{sheepHouseId},'%')</if>
|
<if test="sheepHouseId != null ">and sheep_house_id LIKE CONCAT('%',#{sheepHouseId},'%')</if>
|
||||||
<if test="planDate != null ">and plan_date = #{planDate}</if>
|
<if test="planDate != null ">and plan_date = #{planDate}</if>
|
||||||
|
${params.dataScope}
|
||||||
</where>
|
</where>
|
||||||
ORDER BY plan_date ASC, formula_id ASC , batch_id ASC
|
ORDER BY plan_date ASC, formula_id ASC , batch_id ASC
|
||||||
</select>
|
</select>
|
||||||
@@ -74,6 +75,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
<if test="zookeeper != null">zookeeper,</if>
|
<if test="zookeeper != null">zookeeper,</if>
|
||||||
<if test="planDate != null">plan_date,</if>
|
<if test="planDate != null">plan_date,</if>
|
||||||
<if test="remark != null">remark,</if>
|
<if test="remark != null">remark,</if>
|
||||||
|
<if test="userId != null">user_id,</if>
|
||||||
|
<if test="deptId != null">dept_id,</if>
|
||||||
</trim>
|
</trim>
|
||||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||||
<if test="createDate != null">#{createDate},</if>
|
<if test="createDate != null">#{createDate},</if>
|
||||||
@@ -98,6 +101,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
<if test="zookeeper != null">#{zookeeper},</if>
|
<if test="zookeeper != null">#{zookeeper},</if>
|
||||||
<if test="planDate != null">#{planDate},</if>
|
<if test="planDate != null">#{planDate},</if>
|
||||||
<if test="remark != null">#{remark},</if>
|
<if test="remark != null">#{remark},</if>
|
||||||
|
<if test="userId != null">#{userId},</if>
|
||||||
|
<if test="deptId != null">#{deptId},</if>
|
||||||
</trim>
|
</trim>
|
||||||
</insert>
|
</insert>
|
||||||
|
|
||||||
|
|||||||
@@ -19,21 +19,36 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
<!-- <result property="materialList" column="material_list"-->
|
<!-- <result property="materialList" column="material_list"-->
|
||||||
<!-- typeHandler="com.zhyc.module.feed.mapper.TypeHandler.JsonTypeHandler<java.util.List<com.zhyc.module.feed.domain.SgFormulaList>>" />-->
|
<!-- typeHandler="com.zhyc.module.feed.mapper.TypeHandler.JsonTypeHandler<java.util.List<com.zhyc.module.feed.domain.SgFormulaList>>" />-->
|
||||||
<!-- 分别使用两个TypeHandler完成实体类List<T> 到 数据库 JSON串的映射转换 -->
|
<!-- 分别使用两个TypeHandler完成实体类List<T> 到 数据库 JSON串的映射转换 -->
|
||||||
<result property="materialList" column="material_list" typeHandler="com.zhyc.module.feed.mapper.TypeHandler.SgFormulaListHandler"/>
|
<result property="materialList" column="material_list"
|
||||||
<result property="sheepFoldList" column="sheep_fold_list" typeHandler="com.zhyc.module.feed.mapper.TypeHandler.DaSheepfoldHandler"/>
|
typeHandler="com.zhyc.module.feed.mapper.TypeHandler.SgFormulaListHandler"/>
|
||||||
|
<result property="sheepFoldList" column="sheep_fold_list"
|
||||||
|
typeHandler="com.zhyc.module.feed.mapper.TypeHandler.DaSheepfoldHandler"/>
|
||||||
<result property="feedDate" column="feed_date"/>
|
<result property="feedDate" column="feed_date"/>
|
||||||
</resultMap>
|
</resultMap>
|
||||||
|
|
||||||
<sql id="selectSgFeedStatisticVo">
|
<sql id="selectSgFeedStatisticVo">
|
||||||
select id, formula_id, formula_batch_id, sheep_fold_count, silage_loss_rate, feed_total_size, feed_daily_size, material_list, sheep_fold_list,feed_date from sg_feed_statistic
|
select id,
|
||||||
|
formula_id,
|
||||||
|
formula_batch_id,
|
||||||
|
sheep_fold_count,
|
||||||
|
silage_loss_rate,
|
||||||
|
feed_total_size,
|
||||||
|
feed_daily_size,
|
||||||
|
material_list,
|
||||||
|
sheep_fold_list,
|
||||||
|
feed_date
|
||||||
|
from sg_feed_statistic sg_feed_statistic_alias
|
||||||
</sql>
|
</sql>
|
||||||
|
|
||||||
<select id="selectSgFeedStatisticList" parameterType="SgFeedStatistic" resultMap="SgFeedStatisticResult">
|
<select id="selectSgFeedStatisticList" parameterType="SgFeedStatistic" resultMap="SgFeedStatisticResult">
|
||||||
<include refid="selectSgFeedStatisticVo"/>
|
<include refid="selectSgFeedStatisticVo"/>
|
||||||
<where>
|
<where>
|
||||||
<if test="formulaId != null and formulaId != ''">and formula_id LIKE CONCAT('%',#{formulaId},'%')</if>
|
<if test="formulaId != null and formulaId != ''">and formula_id LIKE CONCAT('%',#{formulaId},'%')</if>
|
||||||
<if test="formulaBatchId != null and formulaBatchId != ''"> and formula_batch_id = LIKE CONCAT('%',#{formulaBatchId},'%')</if>
|
<if test="formulaBatchId != null and formulaBatchId != ''">and formula_batch_id = LIKE
|
||||||
|
CONCAT('%',#{formulaBatchId},'%')
|
||||||
|
</if>
|
||||||
<if test="silageLossRate != null and silageLossRate != ''">and silage_loss_rate = #{silageLossRate}</if>
|
<if test="silageLossRate != null and silageLossRate != ''">and silage_loss_rate = #{silageLossRate}</if>
|
||||||
|
${params.dataScope}
|
||||||
</where>
|
</where>
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
@@ -55,6 +70,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
<if test="materialList != null">material_list,</if>
|
<if test="materialList != null">material_list,</if>
|
||||||
<if test="sheepFoldList != null">sheep_fold_list,</if>
|
<if test="sheepFoldList != null">sheep_fold_list,</if>
|
||||||
<if test="feedDate != null">feed_date,</if>
|
<if test="feedDate != null">feed_date,</if>
|
||||||
|
<if test="userId != null">user_id,</if>
|
||||||
|
<if test="deptId != null">dept_id,</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>
|
||||||
@@ -65,9 +82,15 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
<if test="feedTotalSize != null">#{feedTotalSize},</if>
|
<if test="feedTotalSize != null">#{feedTotalSize},</if>
|
||||||
<if test="feedDailySize != null">#{feedDailySize},</if>
|
<if test="feedDailySize != null">#{feedDailySize},</if>
|
||||||
# 写入操作需要手动指定 TypeHandler 参数
|
# 写入操作需要手动指定 TypeHandler 参数
|
||||||
<if test="materialList != null">#{materialList, typeHandler=com.zhyc.module.feed.mapper.TypeHandler.SgFormulaListHandler},</if>
|
<if test="materialList != null">
|
||||||
<if test="sheepFoldList != null">#{sheepFoldList, typeHandler=com.zhyc.module.feed.mapper.TypeHandler.DaSheepfoldHandler},</if>
|
#{materialList, typeHandler=com.zhyc.module.feed.mapper.TypeHandler.SgFormulaListHandler},
|
||||||
|
</if>
|
||||||
|
<if test="sheepFoldList != null">
|
||||||
|
#{sheepFoldList, typeHandler=com.zhyc.module.feed.mapper.TypeHandler.DaSheepfoldHandler},
|
||||||
|
</if>
|
||||||
<if test="feedDate != null">#{feedDate},</if>
|
<if test="feedDate != null">#{feedDate},</if>
|
||||||
|
<if test="userId != null">#{userId},</if>
|
||||||
|
<if test="deptId != null">#{deptId},</if>
|
||||||
</trim>
|
</trim>
|
||||||
</insert>
|
</insert>
|
||||||
|
|
||||||
@@ -80,15 +103,21 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
<if test="silageLossRate != null">silage_loss_rate = #{silageLossRate},</if>
|
<if test="silageLossRate != null">silage_loss_rate = #{silageLossRate},</if>
|
||||||
<if test="feedTotalSize != null">feed_total_size = #{feedTotalSize},</if>
|
<if test="feedTotalSize != null">feed_total_size = #{feedTotalSize},</if>
|
||||||
<if test="feedDailySize != null">feed_daily_size = #{feedDailySize},</if>
|
<if test="feedDailySize != null">feed_daily_size = #{feedDailySize},</if>
|
||||||
<if test="materialList != null">material_list = #{materialList, typeHandler=com.zhyc.module.feed.mapper.TypeHandler.SgFormulaListHandler},</if>
|
<if test="materialList != null">material_list =
|
||||||
<if test="sheepFoldList != null">sheep_fold_list = #{sheepFoldList, typeHandler=com.zhyc.module.feed.mapper.TypeHandler.DaSheepfoldHandler},</if>
|
#{materialList, typeHandler=com.zhyc.module.feed.mapper.TypeHandler.SgFormulaListHandler},
|
||||||
|
</if>
|
||||||
|
<if test="sheepFoldList != null">sheep_fold_list =
|
||||||
|
#{sheepFoldList, typeHandler=com.zhyc.module.feed.mapper.TypeHandler.DaSheepfoldHandler},
|
||||||
|
</if>
|
||||||
<if test="feedDate != null">feed_date = #{feedDate},</if>
|
<if test="feedDate != null">feed_date = #{feedDate},</if>
|
||||||
</trim>
|
</trim>
|
||||||
where id = #{id}
|
where id = #{id}
|
||||||
</update>
|
</update>
|
||||||
|
|
||||||
<delete id="deleteSgFeedStatisticById" parameterType="String">
|
<delete id="deleteSgFeedStatisticById" parameterType="String">
|
||||||
delete from sg_feed_statistic where id = #{id}
|
delete
|
||||||
|
from sg_feed_statistic
|
||||||
|
where id = #{id}
|
||||||
</delete>
|
</delete>
|
||||||
|
|
||||||
<delete id="deleteSgFeedStatisticByIds" parameterType="String">
|
<delete id="deleteSgFeedStatisticByIds" parameterType="String">
|
||||||
|
|||||||
@@ -16,7 +16,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
</resultMap>
|
</resultMap>
|
||||||
|
|
||||||
<sql id="selectSgFormulaListVo">
|
<sql id="selectSgFormulaListVo">
|
||||||
select code, formula_id, material_id, material_name, ratio, is_granular, is_supplement from sg_formula_list
|
select code, formula_id, material_id, material_name, ratio, is_granular, is_supplement
|
||||||
|
from sg_formula_list sg_formula_list_alias
|
||||||
</sql>
|
</sql>
|
||||||
|
|
||||||
<select id="selectSgFormulaListList" parameterType="SgFormulaList" resultMap="SgFormulaListResult">
|
<select id="selectSgFormulaListList" parameterType="SgFormulaList" resultMap="SgFormulaListResult">
|
||||||
@@ -25,6 +26,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
<if test="materialId != null and materialId != ''">material_id LIKE CONCAT('%',#{materialId},'%')</if>
|
<if test="materialId != null and materialId != ''">material_id LIKE CONCAT('%',#{materialId},'%')</if>
|
||||||
<if test="formulaId != null and formulaId != ''">and formula_id LIKE CONCAT('%',#{formulaId},'%')</if>
|
<if test="formulaId != null and formulaId != ''">and formula_id LIKE CONCAT('%',#{formulaId},'%')</if>
|
||||||
<if test="batchId != null and batchId != ''">and batch_id LIKE CONCAT('%',#{batchId},'%')</if>
|
<if test="batchId != null and batchId != ''">and batch_id LIKE CONCAT('%',#{batchId},'%')</if>
|
||||||
|
${params.dataScope}
|
||||||
</where>
|
</where>
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
@@ -44,6 +46,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
<if test="ratio != null">ratio,</if>
|
<if test="ratio != null">ratio,</if>
|
||||||
<if test="isGranular != null">is_granular,</if>
|
<if test="isGranular != null">is_granular,</if>
|
||||||
<if test="isSupplement != null">is_supplement,</if>
|
<if test="isSupplement != null">is_supplement,</if>
|
||||||
|
<if test="userId != null">user_id,</if>
|
||||||
|
<if test="deptId != null">dept_id,</if>
|
||||||
</trim>
|
</trim>
|
||||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||||
<if test="code != null">#{code},</if>
|
<if test="code != null">#{code},</if>
|
||||||
@@ -54,6 +58,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
<if test="ratio != null">#{ratio},</if>
|
<if test="ratio != null">#{ratio},</if>
|
||||||
<if test="isGranular != null">#{isGranular},</if>
|
<if test="isGranular != null">#{isGranular},</if>
|
||||||
<if test="isSupplement != null">#{isSupplement},</if>
|
<if test="isSupplement != null">#{isSupplement},</if>
|
||||||
|
<if test="userId != null">#{userId},</if>
|
||||||
|
<if test="deptId != null">#{deptId},</if>
|
||||||
</trim>
|
</trim>
|
||||||
</insert>
|
</insert>
|
||||||
|
|
||||||
@@ -71,7 +77,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
</update>
|
</update>
|
||||||
|
|
||||||
<delete id="deleteSgFormulaListByCode" parameterType="Long">
|
<delete id="deleteSgFormulaListByCode" parameterType="Long">
|
||||||
delete from sg_formula_list where code = #{code}
|
delete
|
||||||
|
from sg_formula_list
|
||||||
|
where code = #{code}
|
||||||
</delete>
|
</delete>
|
||||||
|
|
||||||
<delete id="deleteSgFormulaListByCodes" parameterType="String">
|
<delete id="deleteSgFormulaListByCodes" parameterType="String">
|
||||||
@@ -82,6 +90,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
</delete>
|
</delete>
|
||||||
|
|
||||||
<delete id="deleteSgFormulaListByFormulaIdAndBatchId" parameterType="SgFormulaList">
|
<delete id="deleteSgFormulaListByFormulaIdAndBatchId" parameterType="SgFormulaList">
|
||||||
DELETE FROM sg_formula_list WHERE formula_id = #{formulaId} AND batch_id = #{batchId}
|
DELETE
|
||||||
|
FROM sg_formula_list
|
||||||
|
WHERE formula_id = #{formulaId}
|
||||||
|
AND batch_id = #{batchId}
|
||||||
</delete>
|
</delete>
|
||||||
</mapper>
|
</mapper>
|
||||||
@@ -15,15 +15,18 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
</resultMap>
|
</resultMap>
|
||||||
|
|
||||||
<sql id="selectSgFormulaManagementVo">
|
<sql id="selectSgFormulaManagementVo">
|
||||||
select formula_id, feed_stage, batch_id, use_start_date, use_end_date, use_state, remark from sg_formula_management
|
select formula_id, feed_stage, batch_id, use_start_date, use_end_date, use_state, remark
|
||||||
|
from sg_formula_management sg_formula_management_alias
|
||||||
</sql>
|
</sql>
|
||||||
|
|
||||||
<select id="selectSgFormulaManagementList" parameterType="SgFormulaManagement" resultMap="SgFormulaManagementResult">
|
<select id="selectSgFormulaManagementList" parameterType="SgFormulaManagement"
|
||||||
|
resultMap="SgFormulaManagementResult">
|
||||||
<include refid="selectSgFormulaManagementVo"/>
|
<include refid="selectSgFormulaManagementVo"/>
|
||||||
<where>
|
<where>
|
||||||
<if test="formulaId != null and formulaId != ''">and formula_id LIKE CONCAT('%',#{formulaId},'%')</if>
|
<if test="formulaId != null and formulaId != ''">and formula_id LIKE CONCAT('%',#{formulaId},'%')</if>
|
||||||
<if test="feedStage != null and feedStage != ''">and feed_stage LIKE CONCAT('%',#{feedStage},'%')</if>
|
<if test="feedStage != null and feedStage != ''">and feed_stage LIKE CONCAT('%',#{feedStage},'%')</if>
|
||||||
<if test="batchId != null and batchId != ''">and batch_id LIKE CONCAT('%',#{batchId},'%')</if>
|
<if test="batchId != null and batchId != ''">and batch_id LIKE CONCAT('%',#{batchId},'%')</if>
|
||||||
|
${params.dataScope}
|
||||||
</where>
|
</where>
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
@@ -42,6 +45,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
<if test="useEndDate != null">use_end_date,</if>
|
<if test="useEndDate != null">use_end_date,</if>
|
||||||
<if test="useState != null">use_state,</if>
|
<if test="useState != null">use_state,</if>
|
||||||
<if test="remark != null">remark,</if>
|
<if test="remark != null">remark,</if>
|
||||||
|
<if test="userId != null">user_id,</if>
|
||||||
|
<if test="deptId != null">dept_id,</if>
|
||||||
</trim>
|
</trim>
|
||||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||||
<if test="formulaId != null and formulaId != ''">#{formulaId},</if>
|
<if test="formulaId != null and formulaId != ''">#{formulaId},</if>
|
||||||
@@ -51,6 +56,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
<if test="useEndDate != null">#{useEndDate},</if>
|
<if test="useEndDate != null">#{useEndDate},</if>
|
||||||
<if test="useState != null">#{useState},</if>
|
<if test="useState != null">#{useState},</if>
|
||||||
<if test="remark != null">#{remark},</if>
|
<if test="remark != null">#{remark},</if>
|
||||||
|
<if test="userId != null">#{userId},</if>
|
||||||
|
<if test="deptId != null">#{deptId},</if>
|
||||||
</trim>
|
</trim>
|
||||||
</insert>
|
</insert>
|
||||||
|
|
||||||
@@ -67,7 +74,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
</update>
|
</update>
|
||||||
|
|
||||||
<delete id="deleteSgFormulaManagementByFormulaId" parameterType="String">
|
<delete id="deleteSgFormulaManagementByFormulaId" parameterType="String">
|
||||||
delete from sg_formula_management where formula_id = #{formulaId}
|
delete
|
||||||
|
from sg_formula_management
|
||||||
|
where formula_id = #{formulaId}
|
||||||
</delete>
|
</delete>
|
||||||
|
|
||||||
<delete id="deleteSgFormulaManagementByFormulaIds" parameterType="String">
|
<delete id="deleteSgFormulaManagementByFormulaIds" parameterType="String">
|
||||||
@@ -77,6 +86,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
</foreach>
|
</foreach>
|
||||||
</delete>
|
</delete>
|
||||||
<delete id="deleteSgFormulaManagement" parameterType="SgFormulaManagement">
|
<delete id="deleteSgFormulaManagement" parameterType="SgFormulaManagement">
|
||||||
delete from sg_formula_management where formula_id = #{formulaId} and batch_id = #{batchId}
|
delete
|
||||||
|
from sg_formula_management
|
||||||
|
where formula_id = #{formulaId}
|
||||||
|
and batch_id = #{batchId}
|
||||||
</delete>
|
</delete>
|
||||||
</mapper>
|
</mapper>
|
||||||
@@ -11,15 +11,19 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
</resultMap>
|
</resultMap>
|
||||||
|
|
||||||
<sql id="selectSgMaterialVo">
|
<sql id="selectSgMaterialVo">
|
||||||
select material_id, material_name, is_granular from sg_material
|
select material_id, material_name, is_granular
|
||||||
|
from sg_material sg_material_alias
|
||||||
</sql>
|
</sql>
|
||||||
|
|
||||||
<select id="selectSgMaterialList" parameterType="SgMaterial" resultMap="SgMaterialResult">
|
<select id="selectSgMaterialList" parameterType="SgMaterial" resultMap="SgMaterialResult">
|
||||||
<include refid="selectSgMaterialVo"/>
|
<include refid="selectSgMaterialVo"/>
|
||||||
<where>
|
<where>
|
||||||
<if test="materialId != null and materialId != ''">and material_id LIKE CONCAT('%',#{materialId},'%')</if>
|
<if test="materialId != null and materialId != ''">and material_id LIKE CONCAT('%',#{materialId},'%')</if>
|
||||||
<if test="materialName != null and materialName != ''"> and material_name like concat('%', #{materialName}, '%')</if>
|
<if test="materialName != null and materialName != ''">and material_name like concat('%', #{materialName},
|
||||||
|
'%')
|
||||||
|
</if>
|
||||||
<if test="isGranular != null ">and is_granular = #{isGranular}</if>
|
<if test="isGranular != null ">and is_granular = #{isGranular}</if>
|
||||||
|
${params.dataScope}
|
||||||
</where>
|
</where>
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
@@ -34,11 +38,15 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
<if test="materialId != null and materialId != ''">material_id,</if>
|
<if test="materialId != null and materialId != ''">material_id,</if>
|
||||||
<if test="materialName != null and materialName != ''">material_name,</if>
|
<if test="materialName != null and materialName != ''">material_name,</if>
|
||||||
<if test="isGranular != null">is_granular,</if>
|
<if test="isGranular != null">is_granular,</if>
|
||||||
|
<if test="userId != null">user_id,</if>
|
||||||
|
<if test="deptId != null">dept_id,</if>
|
||||||
</trim>
|
</trim>
|
||||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||||
<if test="materialId != null and materialId != ''">#{materialId},</if>
|
<if test="materialId != null and materialId != ''">#{materialId},</if>
|
||||||
<if test="materialName != null and materialName != ''">#{materialName},</if>
|
<if test="materialName != null and materialName != ''">#{materialName},</if>
|
||||||
<if test="isGranular != null">#{isGranular},</if>
|
<if test="isGranular != null">#{isGranular},</if>
|
||||||
|
<if test="userId != null">#{userId},</if>
|
||||||
|
<if test="deptId != null">#{deptId},</if>
|
||||||
</trim>
|
</trim>
|
||||||
</insert>
|
</insert>
|
||||||
|
|
||||||
@@ -52,7 +60,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
</update>
|
</update>
|
||||||
|
|
||||||
<delete id="deleteSgMaterialByMaterialId" parameterType="String">
|
<delete id="deleteSgMaterialByMaterialId" parameterType="String">
|
||||||
delete from sg_material where material_id = #{materialId}
|
delete
|
||||||
|
from sg_material
|
||||||
|
where material_id = #{materialId}
|
||||||
</delete>
|
</delete>
|
||||||
|
|
||||||
<delete id="deleteSgMaterialByMaterialIds" parameterType="String">
|
<delete id="deleteSgMaterialByMaterialIds" parameterType="String">
|
||||||
|
|||||||
Reference in New Issue
Block a user