Merge remote-tracking branch 'origin/main'

This commit is contained in:
漂泊 2025-07-14 19:13:49 +08:00
commit 9c75dc550c
24 changed files with 1582 additions and 145 deletions

View File

@ -21,6 +21,12 @@ import com.zhyc.module.dryMatterCorrection.service.IXzDryMatterCorrectionService
import com.zhyc.common.utils.poi.ExcelUtil;
import com.zhyc.common.core.page.TableDataInfo;
/**
* 干物质校正Controller
*
* @author ruoyi
* @date 2025-07-12
*/
@RestController
@RequestMapping("/dryMatterCorrection/dryMatterCorrection")
public class XzDryMatterCorrectionController extends BaseController
@ -28,33 +34,34 @@ public class XzDryMatterCorrectionController extends BaseController
@Autowired
private IXzDryMatterCorrectionService xzDryMatterCorrectionService;
/**
* 查询干物质校正列表
*/
@PreAuthorize("@ss.hasPermi('dryMatterCorrection:dryMatterCorrection:list')")
@GetMapping("/list")
public TableDataInfo list(XzDryMatterCorrection xzDryMatterCorrection)
{
// 只保留年月查询条件清空其他查询条件
XzDryMatterCorrection query = new XzDryMatterCorrection();
query.setDatetime(xzDryMatterCorrection.getDatetime());
startPage();
List<XzDryMatterCorrection> list = xzDryMatterCorrectionService.selectXzDryMatterCorrectionList(query);
List<XzDryMatterCorrection> list = xzDryMatterCorrectionService.selectXzDryMatterCorrectionList(xzDryMatterCorrection);
return getDataTable(list);
}
/**
* 导出干物质校正列表
*/
@PreAuthorize("@ss.hasPermi('dryMatterCorrection:dryMatterCorrection:export')")
@Log(title = "干物质校正", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, XzDryMatterCorrection xzDryMatterCorrection)
{
// 只保留年月查询条件清空其他查询条件
XzDryMatterCorrection query = new XzDryMatterCorrection();
query.setDatetime(xzDryMatterCorrection.getDatetime());
List<XzDryMatterCorrection> list = xzDryMatterCorrectionService.selectXzDryMatterCorrectionList(query);
List<XzDryMatterCorrection> list = xzDryMatterCorrectionService.selectXzDryMatterCorrectionList(xzDryMatterCorrection);
ExcelUtil<XzDryMatterCorrection> util = new ExcelUtil<XzDryMatterCorrection>(XzDryMatterCorrection.class);
util.exportExcel(response, list, "干物质校正数据");
}
/**
* 获取干物质校正详细信息
*/
@PreAuthorize("@ss.hasPermi('dryMatterCorrection:dryMatterCorrection:query')")
@GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") Long id)
@ -62,6 +69,9 @@ public class XzDryMatterCorrectionController extends BaseController
return success(xzDryMatterCorrectionService.selectXzDryMatterCorrectionById(id));
}
/**
* 新增干物质校正
*/
@PreAuthorize("@ss.hasPermi('dryMatterCorrection:dryMatterCorrection:add')")
@Log(title = "干物质校正", businessType = BusinessType.INSERT)
@PostMapping
@ -70,6 +80,9 @@ public class XzDryMatterCorrectionController extends BaseController
return toAjax(xzDryMatterCorrectionService.insertXzDryMatterCorrection(xzDryMatterCorrection));
}
/**
* 修改干物质校正
*/
@PreAuthorize("@ss.hasPermi('dryMatterCorrection:dryMatterCorrection:edit')")
@Log(title = "干物质校正", businessType = BusinessType.UPDATE)
@PutMapping
@ -78,9 +91,12 @@ public class XzDryMatterCorrectionController extends BaseController
return toAjax(xzDryMatterCorrectionService.updateXzDryMatterCorrection(xzDryMatterCorrection));
}
/**
* 删除干物质校正
*/
@PreAuthorize("@ss.hasPermi('dryMatterCorrection:dryMatterCorrection:remove')")
@Log(title = "干物质校正", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}")
@DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable Long[] ids)
{
return toAjax(xzDryMatterCorrectionService.deleteXzDryMatterCorrectionByIds(ids));

View File

@ -7,84 +7,40 @@ import org.apache.commons.lang3.builder.ToStringStyle;
import com.zhyc.common.annotation.Excel;
import com.zhyc.common.core.domain.BaseEntity;
/**
* 干物质校正对象 xz_dry_matter_correction
*/
public class XzDryMatterCorrection extends BaseEntity {
private static final long serialVersionUID = 1L;
/** 主键ID */
private Long id;
/** 年月 */
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "年月", width = 30, dateFormat = "yyyy-MM-dd")
@JsonFormat(pattern = "yyyy-MM")
@Excel(name = "年月", width = 30, dateFormat = "yyyy-MM")
private Date datetime;
/** 厂区 */
@Excel(name = "厂区")
private String factory;
/** 干物质含量 */
@Excel(name = "干物质含量")
private String content;
private Double content;
/** 干物质标准 */
@Excel(name = "干物质标准")
private String standard;
private Double standard;
/** 干物质系数 */
@Excel(name = "干物质系数") // 移除了numFormat
@Excel(name = "干物质系数")
private Double coefficient;
// Getter和Setter
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public Date getDatetime() {
return datetime;
}
public void setDatetime(Date datetime) {
this.datetime = datetime;
}
public String getFactory() {
return factory;
}
public void setFactory(String factory) {
this.factory = factory;
}
public String getContent() {
return content;
}
public void setContent(String content) {
this.content = content;
}
public String getStandard() {
return standard;
}
public void setStandard(String standard) {
this.standard = standard;
}
public Double getCoefficient() {
return coefficient;
}
public void setCoefficient(Double coefficient) {
this.coefficient = coefficient;
}
// getters and setters...
public Long getId() { return id; }
public void setId(Long id) { this.id = id; }
public Date getDatetime() { return datetime; }
public void setDatetime(Date datetime) { this.datetime = datetime; }
public String getFactory() { return factory; }
public void setFactory(String factory) { this.factory = factory; }
public Double getContent() { return content; }
public void setContent(Double content) { this.content = content; }
public Double getStandard() { return standard; }
public void setStandard(Double standard) { this.standard = standard; }
public Double getCoefficient() { return coefficient; }
public void setCoefficient(Double coefficient) { this.coefficient = coefficient; }
@Override
public String toString() {

View File

@ -7,7 +7,7 @@ import com.zhyc.module.dryMatterCorrection.domain.XzDryMatterCorrection;
* 干物质校正Mapper接口
*
* @author ruoyi
* @date 2025-07-11
* @date 2025-07-12
*/
public interface XzDryMatterCorrectionMapper
{

View File

@ -7,7 +7,7 @@ import com.zhyc.module.dryMatterCorrection.domain.XzDryMatterCorrection;
* 干物质校正Service接口
*
* @author ruoyi
* @date 2025-07-11
* @date 2025-07-12
*/
public interface IXzDryMatterCorrectionService
{

View File

@ -7,68 +7,87 @@ import com.zhyc.module.dryMatterCorrection.mapper.XzDryMatterCorrectionMapper;
import com.zhyc.module.dryMatterCorrection.domain.XzDryMatterCorrection;
import com.zhyc.module.dryMatterCorrection.service.IXzDryMatterCorrectionService;
/**
* 干物质校正Service业务层处理
*
* @author ruoyi
* @date 2025-07-12
*/
@Service
public class XzDryMatterCorrectionServiceImpl implements IXzDryMatterCorrectionService {
public class XzDryMatterCorrectionServiceImpl implements IXzDryMatterCorrectionService
{
@Autowired
private XzDryMatterCorrectionMapper xzDryMatterCorrectionMapper;
/**
* 查询干物质校正
*
* @param id 干物质校正主键
* @return 干物质校正
*/
@Override
public XzDryMatterCorrection selectXzDryMatterCorrectionById(Long id) {
public XzDryMatterCorrection selectXzDryMatterCorrectionById(Long id)
{
return xzDryMatterCorrectionMapper.selectXzDryMatterCorrectionById(id);
}
/**
* 查询干物质校正列表
*
* @param xzDryMatterCorrection 干物质校正
* @return 干物质校正
*/
@Override
public List<XzDryMatterCorrection> selectXzDryMatterCorrectionList(XzDryMatterCorrection xzDryMatterCorrection) {
public List<XzDryMatterCorrection> selectXzDryMatterCorrectionList(XzDryMatterCorrection xzDryMatterCorrection)
{
return xzDryMatterCorrectionMapper.selectXzDryMatterCorrectionList(xzDryMatterCorrection);
}
/**
* 新增干物质校正
*
* @param xzDryMatterCorrection 干物质校正
* @return 结果
*/
@Override
public int insertXzDryMatterCorrection(XzDryMatterCorrection xzDryMatterCorrection) {
calculateCoefficient(xzDryMatterCorrection);
public int insertXzDryMatterCorrection(XzDryMatterCorrection xzDryMatterCorrection)
{
return xzDryMatterCorrectionMapper.insertXzDryMatterCorrection(xzDryMatterCorrection);
}
/**
* 修改干物质校正
*
* @param xzDryMatterCorrection 干物质校正
* @return 结果
*/
@Override
public int updateXzDryMatterCorrection(XzDryMatterCorrection xzDryMatterCorrection) {
calculateCoefficient(xzDryMatterCorrection);
public int updateXzDryMatterCorrection(XzDryMatterCorrection xzDryMatterCorrection)
{
return xzDryMatterCorrectionMapper.updateXzDryMatterCorrection(xzDryMatterCorrection);
}
/**
* 批量删除干物质校正
*
* @param ids 需要删除的干物质校正主键
* @return 结果
*/
@Override
public int deleteXzDryMatterCorrectionByIds(Long[] ids) {
public int deleteXzDryMatterCorrectionByIds(Long[] ids)
{
return xzDryMatterCorrectionMapper.deleteXzDryMatterCorrectionByIds(ids);
}
/**
* 删除干物质校正信息
*
* @param id 干物质校正主键
* @return 结果
*/
@Override
public int deleteXzDryMatterCorrectionById(Long id) {
public int deleteXzDryMatterCorrectionById(Long id)
{
return xzDryMatterCorrectionMapper.deleteXzDryMatterCorrectionById(id);
}
/**
* 计算干物质系数含格式控制
*/
private void calculateCoefficient(XzDryMatterCorrection xzDryMatterCorrection) {
if (xzDryMatterCorrection.getContent() != null &&
xzDryMatterCorrection.getStandard() != null) {
try {
double content = Double.parseDouble(xzDryMatterCorrection.getContent());
double standard = Double.parseDouble(xzDryMatterCorrection.getStandard());
if (standard != 0) {
double coefficient = content / standard;
// 手动控制4位小数替代numFormat功能
xzDryMatterCorrection.setCoefficient(
Double.parseDouble(String.format("%.4f", coefficient))
);
} else {
xzDryMatterCorrection.setCoefficient(null);
}
} catch (NumberFormatException e) {
xzDryMatterCorrection.setCoefficient(null);
}
} else {
xzDryMatterCorrection.setCoefficient(null);
}
}
}

View File

@ -0,0 +1,102 @@
package com.zhyc.module.group_management.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.zhyc.common.annotation.Log;
import com.zhyc.common.core.controller.BaseController;
import com.zhyc.common.core.domain.AjaxResult;
import com.zhyc.common.enums.BusinessType;
import com.zhyc.module.group_management.domain.BasSheepGroup;
import com.zhyc.module.group_management.service.IBasSheepGroupService;
import com.zhyc.common.utils.poi.ExcelUtil;
/**
* 分组管理Controller
*
* @author wyt
* @date 2025-07-14
*/
@RestController
@RequestMapping("/group_management/group_management")
public class BasSheepGroupController extends BaseController
{
@Autowired
private IBasSheepGroupService basSheepGroupService;
/**
* 查询分组管理列表
*/
@PreAuthorize("@ss.hasPermi('group_management:group_management:list')")
@GetMapping("/list")
public AjaxResult list(BasSheepGroup basSheepGroup)
{
List<BasSheepGroup> list = basSheepGroupService.selectBasSheepGroupList(basSheepGroup);
return success(list);
}
/**
* 导出分组管理列表
*/
@PreAuthorize("@ss.hasPermi('group_management:group_management:export')")
@Log(title = "分组管理", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, BasSheepGroup basSheepGroup)
{
List<BasSheepGroup> list = basSheepGroupService.selectBasSheepGroupList(basSheepGroup);
ExcelUtil<BasSheepGroup> util = new ExcelUtil<BasSheepGroup>(BasSheepGroup.class);
util.exportExcel(response, list, "分组管理数据");
}
/**
* 获取分组管理详细信息
*/
@PreAuthorize("@ss.hasPermi('group_management:group_management:query')")
@GetMapping(value = "/{groupId}")
public AjaxResult getInfo(@PathVariable("groupId") Long groupId)
{
return success(basSheepGroupService.selectBasSheepGroupByGroupId(groupId));
}
/**
* 新增分组管理
*/
@PreAuthorize("@ss.hasPermi('group_management:group_management:add')")
@Log(title = "分组管理", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody BasSheepGroup basSheepGroup)
{
return toAjax(basSheepGroupService.insertBasSheepGroup(basSheepGroup));
}
/**
* 修改分组管理
*/
@PreAuthorize("@ss.hasPermi('group_management:group_management:edit')")
@Log(title = "分组管理", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody BasSheepGroup basSheepGroup)
{
return toAjax(basSheepGroupService.updateBasSheepGroup(basSheepGroup));
}
/**
* 删除分组管理
*/
@PreAuthorize("@ss.hasPermi('group_management:group_management:remove')")
@Log(title = "分组管理", businessType = BusinessType.DELETE)
@DeleteMapping("/{groupIds}")
public AjaxResult remove(@PathVariable Long[] groupIds)
{
return toAjax(basSheepGroupService.deleteBasSheepGroupByGroupIds(groupIds));
}
}

View File

@ -0,0 +1,74 @@
package com.zhyc.module.group_management.domain;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.zhyc.common.annotation.Excel;
import com.zhyc.common.core.domain.TreeEntity;
/**
* 分组管理对象 bas_sheep_group
*
* @author wyt
* @date 2025-07-14
*/
public class BasSheepGroup extends TreeEntity
{
private static final long serialVersionUID = 1L;
/** 分组ID */
@Excel(name = "分组ID")
private Long groupId;
/** 分组名称 */
@Excel(name = "分组名称")
private String groupName;
/** 状态0正常 1停用 */
@Excel(name = "状态", readConverterExp = "0=正常,1=停用")
private String status;
public void setGroupId(Long groupId)
{
this.groupId = groupId;
}
public Long getGroupId()
{
return groupId;
}
public void setGroupName(String groupName)
{
this.groupName = groupName;
}
public String getGroupName()
{
return groupName;
}
public void setStatus(String status)
{
this.status = status;
}
public String getStatus()
{
return status;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("groupId", getGroupId())
.append("parentId", getParentId())
.append("groupName", getGroupName())
.append("ancestors", getAncestors())
.append("status", getStatus())
.append("createBy", getCreateBy())
.append("createTime", getCreateTime())
.append("updateBy", getUpdateBy())
.append("updateTime", getUpdateTime())
.toString();
}
}

View File

@ -0,0 +1,61 @@
package com.zhyc.module.group_management.mapper;
import java.util.List;
import com.zhyc.module.group_management.domain.BasSheepGroup;
/**
* 分组管理Mapper接口
*
* @author wyt
* @date 2025-07-14
*/
public interface BasSheepGroupMapper
{
/**
* 查询分组管理
*
* @param groupId 分组管理主键
* @return 分组管理
*/
public BasSheepGroup selectBasSheepGroupByGroupId(Long groupId);
/**
* 查询分组管理列表
*
* @param basSheepGroup 分组管理
* @return 分组管理集合
*/
public List<BasSheepGroup> selectBasSheepGroupList(BasSheepGroup basSheepGroup);
/**
* 新增分组管理
*
* @param basSheepGroup 分组管理
* @return 结果
*/
public int insertBasSheepGroup(BasSheepGroup basSheepGroup);
/**
* 修改分组管理
*
* @param basSheepGroup 分组管理
* @return 结果
*/
public int updateBasSheepGroup(BasSheepGroup basSheepGroup);
/**
* 删除分组管理
*
* @param groupId 分组管理主键
* @return 结果
*/
public int deleteBasSheepGroupByGroupId(Long groupId);
/**
* 批量删除分组管理
*
* @param groupIds 需要删除的数据主键集合
* @return 结果
*/
public int deleteBasSheepGroupByGroupIds(Long[] groupIds);
}

View File

@ -0,0 +1,61 @@
package com.zhyc.module.group_management.service;
import java.util.List;
import com.zhyc.module.group_management.domain.BasSheepGroup;
/**
* 分组管理Service接口
*
* @author wyt
* @date 2025-07-14
*/
public interface IBasSheepGroupService
{
/**
* 查询分组管理
*
* @param groupId 分组管理主键
* @return 分组管理
*/
public BasSheepGroup selectBasSheepGroupByGroupId(Long groupId);
/**
* 查询分组管理列表
*
* @param basSheepGroup 分组管理
* @return 分组管理集合
*/
public List<BasSheepGroup> selectBasSheepGroupList(BasSheepGroup basSheepGroup);
/**
* 新增分组管理
*
* @param basSheepGroup 分组管理
* @return 结果
*/
public int insertBasSheepGroup(BasSheepGroup basSheepGroup);
/**
* 修改分组管理
*
* @param basSheepGroup 分组管理
* @return 结果
*/
public int updateBasSheepGroup(BasSheepGroup basSheepGroup);
/**
* 批量删除分组管理
*
* @param groupIds 需要删除的分组管理主键集合
* @return 结果
*/
public int deleteBasSheepGroupByGroupIds(Long[] groupIds);
/**
* 删除分组管理信息
*
* @param groupId 分组管理主键
* @return 结果
*/
public int deleteBasSheepGroupByGroupId(Long groupId);
}

View File

@ -0,0 +1,96 @@
package com.zhyc.module.group_management.service.impl;
import java.util.List;
import com.zhyc.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.zhyc.module.group_management.mapper.BasSheepGroupMapper;
import com.zhyc.module.group_management.domain.BasSheepGroup;
import com.zhyc.module.group_management.service.IBasSheepGroupService;
/**
* 分组管理Service业务层处理
*
* @author wyt
* @date 2025-07-14
*/
@Service
public class BasSheepGroupServiceImpl implements IBasSheepGroupService
{
@Autowired
private BasSheepGroupMapper basSheepGroupMapper;
/**
* 查询分组管理
*
* @param groupId 分组管理主键
* @return 分组管理
*/
@Override
public BasSheepGroup selectBasSheepGroupByGroupId(Long groupId)
{
return basSheepGroupMapper.selectBasSheepGroupByGroupId(groupId);
}
/**
* 查询分组管理列表
*
* @param basSheepGroup 分组管理
* @return 分组管理
*/
@Override
public List<BasSheepGroup> selectBasSheepGroupList(BasSheepGroup basSheepGroup)
{
return basSheepGroupMapper.selectBasSheepGroupList(basSheepGroup);
}
/**
* 新增分组管理
*
* @param basSheepGroup 分组管理
* @return 结果
*/
@Override
public int insertBasSheepGroup(BasSheepGroup basSheepGroup)
{
basSheepGroup.setCreateTime(DateUtils.getNowDate());
return basSheepGroupMapper.insertBasSheepGroup(basSheepGroup);
}
/**
* 修改分组管理
*
* @param basSheepGroup 分组管理
* @return 结果
*/
@Override
public int updateBasSheepGroup(BasSheepGroup basSheepGroup)
{
basSheepGroup.setUpdateTime(DateUtils.getNowDate());
return basSheepGroupMapper.updateBasSheepGroup(basSheepGroup);
}
/**
* 批量删除分组管理
*
* @param groupIds 需要删除的分组管理主键
* @return 结果
*/
@Override
public int deleteBasSheepGroupByGroupIds(Long[] groupIds)
{
return basSheepGroupMapper.deleteBasSheepGroupByGroupIds(groupIds);
}
/**
* 删除分组管理信息
*
* @param groupId 分组管理主键
* @return 结果
*/
@Override
public int deleteBasSheepGroupByGroupId(Long groupId)
{
return basSheepGroupMapper.deleteBasSheepGroupByGroupId(groupId);
}
}

View File

@ -0,0 +1,104 @@
package com.zhyc.module.parityCorrection.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.zhyc.common.annotation.Log;
import com.zhyc.common.core.controller.BaseController;
import com.zhyc.common.core.domain.AjaxResult;
import com.zhyc.common.enums.BusinessType;
import com.zhyc.module.parityCorrection.domain.XzParityCorrection;
import com.zhyc.module.parityCorrection.service.IXzParityCorrectionService;
import com.zhyc.common.utils.poi.ExcelUtil;
import com.zhyc.common.core.page.TableDataInfo;
/**
* 胎次校正Controller
*
* @author ruoyi
* @date 2025-07-14
*/
@RestController
@RequestMapping("/parityCorrection/parityCorrection")
public class XzParityCorrectionController extends BaseController
{
@Autowired
private IXzParityCorrectionService xzParityCorrectionService;
/**
* 查询胎次校正列表
*/
@PreAuthorize("@ss.hasPermi('parityCorrection:parityCorrection:list')")
@GetMapping("/list")
public TableDataInfo list(XzParityCorrection xzParityCorrection)
{
startPage();
List<XzParityCorrection> list = xzParityCorrectionService.selectXzParityCorrectionList(xzParityCorrection);
return getDataTable(list);
}
/**
* 导出胎次校正列表
*/
@PreAuthorize("@ss.hasPermi('parityCorrection:parityCorrection:export')")
@Log(title = "胎次校正", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, XzParityCorrection xzParityCorrection)
{
List<XzParityCorrection> list = xzParityCorrectionService.selectXzParityCorrectionList(xzParityCorrection);
ExcelUtil<XzParityCorrection> util = new ExcelUtil<XzParityCorrection>(XzParityCorrection.class);
util.exportExcel(response, list, "胎次校正数据");
}
/**
* 获取胎次校正详细信息
*/
@PreAuthorize("@ss.hasPermi('parityCorrection:parityCorrection:query')")
@GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") Long id)
{
return success(xzParityCorrectionService.selectXzParityCorrectionById(id));
}
/**
* 新增胎次校正
*/
@PreAuthorize("@ss.hasPermi('parityCorrection:parityCorrection:add')")
@Log(title = "胎次校正", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody XzParityCorrection xzParityCorrection)
{
return toAjax(xzParityCorrectionService.insertXzParityCorrection(xzParityCorrection));
}
/**
* 修改胎次校正
*/
@PreAuthorize("@ss.hasPermi('parityCorrection:parityCorrection:edit')")
@Log(title = "胎次校正", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody XzParityCorrection xzParityCorrection)
{
return toAjax(xzParityCorrectionService.updateXzParityCorrection(xzParityCorrection));
}
/**
* 删除胎次校正
*/
@PreAuthorize("@ss.hasPermi('parityCorrection:parityCorrection:remove')")
@Log(title = "胎次校正", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable Long[] ids)
{
return toAjax(xzParityCorrectionService.deleteXzParityCorrectionByIds(ids));
}
}

View File

@ -0,0 +1,67 @@
package com.zhyc.module.parityCorrection.domain;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.zhyc.common.annotation.Excel;
import com.zhyc.common.core.domain.BaseEntity;
/**
* 胎次校正对象 xz_parity_correction
*
* @author ruoyi
* @date 2025-07-14
*/
public class XzParityCorrection extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** $column.columnComment */
private Long id;
/** 胎次 */
@Excel(name = "胎次")
private Integer parity;
/** 系数 */
@Excel(name = "系数")
private Double coef;
public void setId(Long id)
{
this.id = id;
}
public Long getId()
{
return id;
}
public void setParity(Integer parity)
{
this.parity = parity;
}
public Integer getParity()
{
return parity;
}
public void setCoef(Double coef)
{
this.coef = coef;
}
public Double getCoef()
{
return coef;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("id", getId())
.append("parity", getParity())
.append("coef", getCoef())
.toString();
}
}

View File

@ -0,0 +1,61 @@
package com.zhyc.module.parityCorrection.mapper;
import java.util.List;
import com.zhyc.module.parityCorrection.domain.XzParityCorrection;
/**
* 胎次校正Mapper接口
*
* @author ruoyi
* @date 2025-07-14
*/
public interface XzParityCorrectionMapper
{
/**
* 查询胎次校正
*
* @param id 胎次校正主键
* @return 胎次校正
*/
public XzParityCorrection selectXzParityCorrectionById(Long id);
/**
* 查询胎次校正列表
*
* @param xzParityCorrection 胎次校正
* @return 胎次校正集合
*/
public List<XzParityCorrection> selectXzParityCorrectionList(XzParityCorrection xzParityCorrection);
/**
* 新增胎次校正
*
* @param xzParityCorrection 胎次校正
* @return 结果
*/
public int insertXzParityCorrection(XzParityCorrection xzParityCorrection);
/**
* 修改胎次校正
*
* @param xzParityCorrection 胎次校正
* @return 结果
*/
public int updateXzParityCorrection(XzParityCorrection xzParityCorrection);
/**
* 删除胎次校正
*
* @param id 胎次校正主键
* @return 结果
*/
public int deleteXzParityCorrectionById(Long id);
/**
* 批量删除胎次校正
*
* @param ids 需要删除的数据主键集合
* @return 结果
*/
public int deleteXzParityCorrectionByIds(Long[] ids);
}

View File

@ -0,0 +1,61 @@
package com.zhyc.module.parityCorrection.service;
import java.util.List;
import com.zhyc.module.parityCorrection.domain.XzParityCorrection;
/**
* 胎次校正Service接口
*
* @author ruoyi
* @date 2025-07-14
*/
public interface IXzParityCorrectionService
{
/**
* 查询胎次校正
*
* @param id 胎次校正主键
* @return 胎次校正
*/
public XzParityCorrection selectXzParityCorrectionById(Long id);
/**
* 查询胎次校正列表
*
* @param xzParityCorrection 胎次校正
* @return 胎次校正集合
*/
public List<XzParityCorrection> selectXzParityCorrectionList(XzParityCorrection xzParityCorrection);
/**
* 新增胎次校正
*
* @param xzParityCorrection 胎次校正
* @return 结果
*/
public int insertXzParityCorrection(XzParityCorrection xzParityCorrection);
/**
* 修改胎次校正
*
* @param xzParityCorrection 胎次校正
* @return 结果
*/
public int updateXzParityCorrection(XzParityCorrection xzParityCorrection);
/**
* 批量删除胎次校正
*
* @param ids 需要删除的胎次校正主键集合
* @return 结果
*/
public int deleteXzParityCorrectionByIds(Long[] ids);
/**
* 删除胎次校正信息
*
* @param id 胎次校正主键
* @return 结果
*/
public int deleteXzParityCorrectionById(Long id);
}

View File

@ -0,0 +1,93 @@
package com.zhyc.module.parityCorrection.service.impl;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.zhyc.module.parityCorrection.mapper.XzParityCorrectionMapper;
import com.zhyc.module.parityCorrection.domain.XzParityCorrection;
import com.zhyc.module.parityCorrection.service.IXzParityCorrectionService;
/**
* 胎次校正Service业务层处理
*
* @author ruoyi
* @date 2025-07-14
*/
@Service
public class XzParityCorrectionServiceImpl implements IXzParityCorrectionService
{
@Autowired
private XzParityCorrectionMapper xzParityCorrectionMapper;
/**
* 查询胎次校正
*
* @param id 胎次校正主键
* @return 胎次校正
*/
@Override
public XzParityCorrection selectXzParityCorrectionById(Long id)
{
return xzParityCorrectionMapper.selectXzParityCorrectionById(id);
}
/**
* 查询胎次校正列表
*
* @param xzParityCorrection 胎次校正
* @return 胎次校正
*/
@Override
public List<XzParityCorrection> selectXzParityCorrectionList(XzParityCorrection xzParityCorrection)
{
return xzParityCorrectionMapper.selectXzParityCorrectionList(xzParityCorrection);
}
/**
* 新增胎次校正
*
* @param xzParityCorrection 胎次校正
* @return 结果
*/
@Override
public int insertXzParityCorrection(XzParityCorrection xzParityCorrection)
{
return xzParityCorrectionMapper.insertXzParityCorrection(xzParityCorrection);
}
/**
* 修改胎次校正
*
* @param xzParityCorrection 胎次校正
* @return 结果
*/
@Override
public int updateXzParityCorrection(XzParityCorrection xzParityCorrection)
{
return xzParityCorrectionMapper.updateXzParityCorrection(xzParityCorrection);
}
/**
* 批量删除胎次校正
*
* @param ids 需要删除的胎次校正主键
* @return 结果
*/
@Override
public int deleteXzParityCorrectionByIds(Long[] ids)
{
return xzParityCorrectionMapper.deleteXzParityCorrectionByIds(ids);
}
/**
* 删除胎次校正信息
*
* @param id 胎次校正主键
* @return 结果
*/
@Override
public int deleteXzParityCorrectionById(Long id)
{
return xzParityCorrectionMapper.deleteXzParityCorrectionById(id);
}
}

View File

@ -0,0 +1,104 @@
package com.zhyc.module.weightCorrection.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.zhyc.common.annotation.Log;
import com.zhyc.common.core.controller.BaseController;
import com.zhyc.common.core.domain.AjaxResult;
import com.zhyc.common.enums.BusinessType;
import com.zhyc.module.weightCorrection.domain.XzWegihCorrection;
import com.zhyc.module.weightCorrection.service.IXzWegihCorrectionService;
import com.zhyc.common.utils.poi.ExcelUtil;
import com.zhyc.common.core.page.TableDataInfo;
/**
* 称重校正Controller
*
* @author ruoyi
* @date 2025-07-12
*/
@RestController
@RequestMapping("/weightCorrection/weightCorrection")
public class XzWegihCorrectionController extends BaseController
{
@Autowired
private IXzWegihCorrectionService xzWegihCorrectionService;
/**
* 查询称重校正列表
*/
@PreAuthorize("@ss.hasPermi('weightCorrection:weightCorrection:list')")
@GetMapping("/list")
public TableDataInfo list(XzWegihCorrection xzWegihCorrection)
{
startPage();
List<XzWegihCorrection> list = xzWegihCorrectionService.selectXzWegihCorrectionList(xzWegihCorrection);
return getDataTable(list);
}
/**
* 导出称重校正列表
*/
@PreAuthorize("@ss.hasPermi('weightCorrection:weightCorrection:export')")
@Log(title = "称重校正", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, XzWegihCorrection xzWegihCorrection)
{
List<XzWegihCorrection> list = xzWegihCorrectionService.selectXzWegihCorrectionList(xzWegihCorrection);
ExcelUtil<XzWegihCorrection> util = new ExcelUtil<XzWegihCorrection>(XzWegihCorrection.class);
util.exportExcel(response, list, "称重校正数据");
}
/**
* 获取称重校正详细信息
*/
@PreAuthorize("@ss.hasPermi('weightCorrection:weightCorrection:query')")
@GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") Long id)
{
return success(xzWegihCorrectionService.selectXzWegihCorrectionById(id));
}
/**
* 新增称重校正
*/
@PreAuthorize("@ss.hasPermi('weightCorrection:weightCorrection:add')")
@Log(title = "称重校正", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody XzWegihCorrection xzWegihCorrection)
{
return toAjax(xzWegihCorrectionService.insertXzWegihCorrection(xzWegihCorrection));
}
/**
* 修改称重校正
*/
@PreAuthorize("@ss.hasPermi('weightCorrection:weightCorrection:edit')")
@Log(title = "称重校正", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody XzWegihCorrection xzWegihCorrection)
{
return toAjax(xzWegihCorrectionService.updateXzWegihCorrection(xzWegihCorrection));
}
/**
* 删除称重校正
*/
@PreAuthorize("@ss.hasPermi('weightCorrection:weightCorrection:remove')")
@Log(title = "称重校正", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable Long[] ids)
{
return toAjax(xzWegihCorrectionService.deleteXzWegihCorrectionByIds(ids));
}
}

View File

@ -0,0 +1,113 @@
package com.zhyc.module.weightCorrection.domain;
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.zhyc.common.annotation.Excel;
import com.zhyc.common.core.domain.BaseEntity;
/**
* 称重校正对象 xz_wegih_correction
*
* @author ruoyi
* @date 2025-07-12
*/
public class XzWegihCorrection extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** $column.columnComment */
private Long id;
/** 日期 */
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "日期", width = 30, dateFormat = "yyyy-MM-dd")
private Date datetime;
/** 厂区 */
@Excel(name = "厂区")
private String factory;
/** 实际奶量 */
@Excel(name = "实际奶量")
private Double actual;
/** 系统奶量 */
@Excel(name = "系统奶量")
private Double systemMilk; // 修改字段名
/** 称重系数(计算字段) */
@Excel(name = "称重系数")
private Double coefficient;
public void setId(Long id)
{
this.id = id;
}
public Long getId()
{
return id;
}
public void setDatetime(Date datetime)
{
this.datetime = datetime;
}
public Date getDatetime()
{
return datetime;
}
public void setFactory(String factory)
{
this.factory = factory;
}
public String getFactory()
{
return factory;
}
public void setActual(Double actual)
{
this.actual = actual;
}
public Double getActual()
{
return actual;
}
public void setSystemMilk(Double systemMilk)
{
this.systemMilk = systemMilk;
}
public Double getSystemMilk()
{
return systemMilk;
}
public Double getCoefficient() {
return coefficient;
}
public void setCoefficient(Double coefficient) {
this.coefficient = coefficient;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("id", getId())
.append("datetime", getDatetime())
.append("factory", getFactory())
.append("actual", getActual())
.append("systemMilk", getSystemMilk())
.append("coefficient", getCoefficient())
.toString();
}
}

View File

@ -0,0 +1,61 @@
package com.zhyc.module.weightCorrection.mapper;
import java.util.List;
import com.zhyc.module.weightCorrection.domain.XzWegihCorrection;
/**
* 称重校正Mapper接口
*
* @author ruoyi
* @date 2025-07-12
*/
public interface XzWegihCorrectionMapper
{
/**
* 查询称重校正
*
* @param id 称重校正主键
* @return 称重校正
*/
public XzWegihCorrection selectXzWegihCorrectionById(Long id);
/**
* 查询称重校正列表
*
* @param xzWegihCorrection 称重校正
* @return 称重校正集合
*/
public List<XzWegihCorrection> selectXzWegihCorrectionList(XzWegihCorrection xzWegihCorrection);
/**
* 新增称重校正
*
* @param xzWegihCorrection 称重校正
* @return 结果
*/
public int insertXzWegihCorrection(XzWegihCorrection xzWegihCorrection);
/**
* 修改称重校正
*
* @param xzWegihCorrection 称重校正
* @return 结果
*/
public int updateXzWegihCorrection(XzWegihCorrection xzWegihCorrection);
/**
* 删除称重校正
*
* @param id 称重校正主键
* @return 结果
*/
public int deleteXzWegihCorrectionById(Long id);
/**
* 批量删除称重校正
*
* @param ids 需要删除的数据主键集合
* @return 结果
*/
public int deleteXzWegihCorrectionByIds(Long[] ids);
}

View File

@ -0,0 +1,61 @@
package com.zhyc.module.weightCorrection.service;
import java.util.List;
import com.zhyc.module.weightCorrection.domain.XzWegihCorrection;
/**
* 称重校正Service接口
*
* @author ruoyi
* @date 2025-07-12
*/
public interface IXzWegihCorrectionService
{
/**
* 查询称重校正
*
* @param id 称重校正主键
* @return 称重校正
*/
public XzWegihCorrection selectXzWegihCorrectionById(Long id);
/**
* 查询称重校正列表
*
* @param xzWegihCorrection 称重校正
* @return 称重校正集合
*/
public List<XzWegihCorrection> selectXzWegihCorrectionList(XzWegihCorrection xzWegihCorrection);
/**
* 新增称重校正
*
* @param xzWegihCorrection 称重校正
* @return 结果
*/
public int insertXzWegihCorrection(XzWegihCorrection xzWegihCorrection);
/**
* 修改称重校正
*
* @param xzWegihCorrection 称重校正
* @return 结果
*/
public int updateXzWegihCorrection(XzWegihCorrection xzWegihCorrection);
/**
* 批量删除称重校正
*
* @param ids 需要删除的称重校正主键集合
* @return 结果
*/
public int deleteXzWegihCorrectionByIds(Long[] ids);
/**
* 删除称重校正信息
*
* @param id 称重校正主键
* @return 结果
*/
public int deleteXzWegihCorrectionById(Long id);
}

View File

@ -0,0 +1,93 @@
package com.zhyc.module.weightCorrection.service.impl;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.zhyc.module.weightCorrection.mapper.XzWegihCorrectionMapper;
import com.zhyc.module.weightCorrection.domain.XzWegihCorrection;
import com.zhyc.module.weightCorrection.service.IXzWegihCorrectionService;
/**
* 称重校正Service业务层处理
*
* @author ruoyi
* @date 2025-07-12
*/
@Service
public class XzWegihCorrectionServiceImpl implements IXzWegihCorrectionService
{
@Autowired
private XzWegihCorrectionMapper xzWegihCorrectionMapper;
/**
* 查询称重校正
*
* @param id 称重校正主键
* @return 称重校正
*/
@Override
public XzWegihCorrection selectXzWegihCorrectionById(Long id)
{
return xzWegihCorrectionMapper.selectXzWegihCorrectionById(id);
}
/**
* 查询称重校正列表
*
* @param xzWegihCorrection 称重校正
* @return 称重校正
*/
@Override
public List<XzWegihCorrection> selectXzWegihCorrectionList(XzWegihCorrection xzWegihCorrection)
{
return xzWegihCorrectionMapper.selectXzWegihCorrectionList(xzWegihCorrection);
}
/**
* 新增称重校正
*
* @param xzWegihCorrection 称重校正
* @return 结果
*/
@Override
public int insertXzWegihCorrection(XzWegihCorrection xzWegihCorrection)
{
return xzWegihCorrectionMapper.insertXzWegihCorrection(xzWegihCorrection);
}
/**
* 修改称重校正
*
* @param xzWegihCorrection 称重校正
* @return 结果
*/
@Override
public int updateXzWegihCorrection(XzWegihCorrection xzWegihCorrection)
{
return xzWegihCorrectionMapper.updateXzWegihCorrection(xzWegihCorrection);
}
/**
* 批量删除称重校正
*
* @param ids 需要删除的称重校正主键
* @return 结果
*/
@Override
public int deleteXzWegihCorrectionByIds(Long[] ids)
{
return xzWegihCorrectionMapper.deleteXzWegihCorrectionByIds(ids);
}
/**
* 删除称重校正信息
*
* @param id 称重校正主键
* @return 结果
*/
@Override
public int deleteXzWegihCorrectionById(Long id)
{
return xzWegihCorrectionMapper.deleteXzWegihCorrectionById(id);
}
}

View File

@ -14,57 +14,65 @@
</resultMap>
<sql id="selectXzDryMatterCorrectionVo">
select id, datetime, factory, content, standard, coefficient from xz_dry_matter_correction
SELECT
id,
datetime,
factory,
content,
standard,
CASE
WHEN standard = 0 OR standard IS NULL THEN NULL
ELSE content / standard
END AS coefficient
FROM xz_dry_matter_correction
</sql>
<select id="selectXzDryMatterCorrectionList" parameterType="XzDryMatterCorrection" resultMap="XzDryMatterCorrectionResult">
<include refid="selectXzDryMatterCorrectionVo"/>
<where>
<if test="datetime != null "> and datetime = #{datetime}</if>
<if test="datetime != null">
AND DATE_FORMAT(datetime, '%Y-%m') = DATE_FORMAT(#{datetime}, '%Y-%m')
</if>
<if test="factory != null and factory != ''">
AND factory = #{factory}
</if>
AND (standard IS NULL OR standard != 0)
</where>
ORDER BY datetime DESC
</select>
<select id="selectXzDryMatterCorrectionById" parameterType="Long" resultMap="XzDryMatterCorrectionResult">
<include refid="selectXzDryMatterCorrectionVo"/>
where id = #{id}
WHERE id = #{id}
</select>
<insert id="insertXzDryMatterCorrection" parameterType="XzDryMatterCorrection" useGeneratedKeys="true" keyProperty="id">
insert into xz_dry_matter_correction
INSERT INTO xz_dry_matter_correction
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="datetime != null">datetime,</if>
<if test="factory != null">factory,</if>
<if test="content != null">content,</if>
<if test="standard != null">standard,</if>
<if test="coefficient != null">coefficient,</if>
datetime, factory, content, standard
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="datetime != null">#{datetime},</if>
<if test="factory != null">#{factory},</if>
<if test="content != null">#{content},</if>
<if test="standard != null">#{standard},</if>
<if test="coefficient != null">#{coefficient},</if>
<trim prefix="VALUES (" suffix=")" suffixOverrides=",">
#{datetime}, #{factory}, #{content}, #{standard}
</trim>
</insert>
<update id="updateXzDryMatterCorrection" parameterType="XzDryMatterCorrection">
update xz_dry_matter_correction
<trim prefix="SET" suffixOverrides=",">
UPDATE xz_dry_matter_correction
<set>
<if test="datetime != null">datetime = #{datetime},</if>
<if test="factory != null">factory = #{factory},</if>
<if test="content != null">content = #{content},</if>
<if test="standard != null">standard = #{standard},</if>
<if test="coefficient != null">coefficient = #{coefficient},</if>
</trim>
where id = #{id}
</set>
WHERE id = #{id}
</update>
<delete id="deleteXzDryMatterCorrectionById" parameterType="Long">
delete from xz_dry_matter_correction where id = #{id}
DELETE FROM xz_dry_matter_correction WHERE id = #{id}
</delete>
<delete id="deleteXzDryMatterCorrectionByIds" parameterType="String">
delete from xz_dry_matter_correction where id in
<delete id="deleteXzDryMatterCorrectionByIds" parameterType="Long[]">
DELETE FROM xz_dry_matter_correction WHERE id IN
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>

View File

@ -0,0 +1,85 @@
<?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.zhyc.module.group_management.mapper.BasSheepGroupMapper">
<resultMap type="BasSheepGroup" id="BasSheepGroupResult">
<result property="groupId" column="group_id" />
<result property="parentId" column="parent_id" />
<result property="groupName" column="group_name" />
<result property="ancestors" column="ancestors" />
<result property="status" column="status" />
<result property="createBy" column="create_by" />
<result property="createTime" column="create_time" />
<result property="updateBy" column="update_by" />
<result property="updateTime" column="update_time" />
</resultMap>
<sql id="selectBasSheepGroupVo">
select group_id, parent_id, group_name, ancestors, status, create_by, create_time, update_by, update_time from bas_sheep_group
</sql>
<select id="selectBasSheepGroupList" parameterType="BasSheepGroup" resultMap="BasSheepGroupResult">
<include refid="selectBasSheepGroupVo"/>
<where>
<if test="groupName != null and groupName != ''"> and group_name like concat('%', #{groupName}, '%')</if>
<if test="status != null and status != ''"> and status = #{status}</if>
</where>
</select>
<select id="selectBasSheepGroupByGroupId" parameterType="Long" resultMap="BasSheepGroupResult">
<include refid="selectBasSheepGroupVo"/>
where group_id = #{groupId}
</select>
<insert id="insertBasSheepGroup" parameterType="BasSheepGroup" useGeneratedKeys="true" keyProperty="groupId">
insert into bas_sheep_group
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="parentId != null">parent_id,</if>
<if test="groupName != null and groupName != ''">group_name,</if>
<if test="ancestors != null">ancestors,</if>
<if test="status != null">status,</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>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="parentId != null">#{parentId},</if>
<if test="groupName != null and groupName != ''">#{groupName},</if>
<if test="ancestors != null">#{ancestors},</if>
<if test="status != null">#{status},</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>
</trim>
</insert>
<update id="updateBasSheepGroup" parameterType="BasSheepGroup">
update bas_sheep_group
<trim prefix="SET" suffixOverrides=",">
<if test="parentId != null">parent_id = #{parentId},</if>
<if test="groupName != null and groupName != ''">group_name = #{groupName},</if>
<if test="ancestors != null">ancestors = #{ancestors},</if>
<if test="status != null">status = #{status},</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>
</trim>
where group_id = #{groupId}
</update>
<delete id="deleteBasSheepGroupByGroupId" parameterType="Long">
delete from bas_sheep_group where group_id = #{groupId}
</delete>
<delete id="deleteBasSheepGroupByGroupIds" parameterType="String">
delete from bas_sheep_group where group_id in
<foreach item="groupId" collection="array" open="(" separator="," close=")">
#{groupId}
</foreach>
</delete>
</mapper>

View File

@ -0,0 +1,61 @@
<?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.zhyc.module.parityCorrection.mapper.XzParityCorrectionMapper">
<resultMap type="XzParityCorrection" id="XzParityCorrectionResult">
<result property="id" column="id" />
<result property="parity" column="parity" />
<result property="coef" column="coef" />
</resultMap>
<sql id="selectXzParityCorrectionVo">
select id, parity, coef from xz_parity_correction
</sql>
<select id="selectXzParityCorrectionList" parameterType="XzParityCorrection" resultMap="XzParityCorrectionResult">
<include refid="selectXzParityCorrectionVo"/>
<where>
<if test="parity != null "> and parity = #{parity}</if>
<if test="coef != null "> and coef = #{coef}</if>
</where>
</select>
<select id="selectXzParityCorrectionById" parameterType="Long" resultMap="XzParityCorrectionResult">
<include refid="selectXzParityCorrectionVo"/>
where id = #{id}
</select>
<insert id="insertXzParityCorrection" parameterType="XzParityCorrection" useGeneratedKeys="true" keyProperty="id">
insert into xz_parity_correction
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="parity != null">parity,</if>
<if test="coef != null">coef,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="parity != null">#{parity},</if>
<if test="coef != null">#{coef},</if>
</trim>
</insert>
<update id="updateXzParityCorrection" parameterType="XzParityCorrection">
update xz_parity_correction
<trim prefix="SET" suffixOverrides=",">
<if test="parity != null">parity = #{parity},</if>
<if test="coef != null">coef = #{coef},</if>
</trim>
where id = #{id}
</update>
<delete id="deleteXzParityCorrectionById" parameterType="Long">
delete from xz_parity_correction where id = #{id}
</delete>
<delete id="deleteXzParityCorrectionByIds" parameterType="String">
delete from xz_parity_correction where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>

View File

@ -0,0 +1,80 @@
<?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.zhyc.module.weightCorrection.mapper.XzWegihCorrectionMapper">
<resultMap type="XzWegihCorrection" id="XzWegihCorrectionResult">
<result property="id" column="id" />
<result property="datetime" column="datetime" />
<result property="factory" column="factory" />
<result property="actual" column="actual" />
<result property="systemMilk" column="system_milk" />
<result property="coefficient" column="coefficient" />
</resultMap>
<sql id="selectXzWegihCorrectionVo">
select
id,
datetime,
factory,
actual,
system_milk,
CASE
WHEN system_milk = 0 THEN 0
ELSE ROUND(actual / system_milk, 4)
END as coefficient
from xz_wegih_correction
</sql>
<select id="selectXzWegihCorrectionList" parameterType="XzWegihCorrection" resultMap="XzWegihCorrectionResult">
<include refid="selectXzWegihCorrectionVo"/>
<where>
<if test="datetime != null "> and datetime = #{datetime}</if>
<if test="factory != null and factory != ''"> and factory = #{factory}</if>
</where>
</select>
<select id="selectXzWegihCorrectionById" parameterType="Long" resultMap="XzWegihCorrectionResult">
<include refid="selectXzWegihCorrectionVo"/>
where id = #{id}
</select>
<insert id="insertXzWegihCorrection" parameterType="XzWegihCorrection" useGeneratedKeys="true" keyProperty="id">
insert into xz_wegih_correction
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="datetime != null">datetime,</if>
<if test="factory != null">factory,</if>
<if test="actual != null">actual,</if>
<if test="systemMilk != null">system_milk,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="datetime != null">#{datetime},</if>
<if test="factory != null">#{factory},</if>
<if test="actual != null">#{actual},</if>
<if test="systemMilk != null">#{systemMilk},</if>
</trim>
</insert>
<update id="updateXzWegihCorrection" parameterType="XzWegihCorrection">
update xz_wegih_correction
<trim prefix="SET" suffixOverrides=",">
<if test="datetime != null">datetime = #{datetime},</if>
<if test="factory != null">factory = #{factory},</if>
<if test="actual != null">actual = #{actual},</if>
<if test="systemMilk != null">system_milk = #{systemMilk},</if>
</trim>
where id = #{id}
</update>
<delete id="deleteXzWegihCorrectionById" parameterType="Long">
delete from xz_wegih_correction where id = #{id}
</delete>
<delete id="deleteXzWegihCorrectionByIds" parameterType="String">
delete from xz_wegih_correction where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>