新增羊只,转场,转群,修蹄,去势的基本功能
This commit is contained in:
parent
155deda3bd
commit
12c4e874a6
@ -0,0 +1,90 @@
|
||||
package com.zhyc.module.produce.manage_sheep.add_sheep.controller;
|
||||
|
||||
import com.zhyc.common.annotation.Log;
|
||||
import com.zhyc.common.core.domain.AjaxResult;
|
||||
import com.zhyc.common.enums.BusinessType;
|
||||
import com.zhyc.common.utils.poi.ExcelUtil;
|
||||
import com.zhyc.module.produce.manage_sheep.add_sheep.domain.ScAddSheep;
|
||||
import com.zhyc.module.produce.manage_sheep.add_sheep.service.IScAddSheepService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.io.IOException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import static com.zhyc.common.core.domain.AjaxResult.success;
|
||||
import static com.zhyc.common.utils.SecurityUtils.getUsername;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("produce/manage_sheep/add_sheep")
|
||||
public class ScAddSheepController {
|
||||
@Autowired
|
||||
private IScAddSheepService scAddSheepService;
|
||||
|
||||
//新增羊只验证
|
||||
@PreAuthorize("@ss.hasPermi('produce:add_sheep:add')")
|
||||
@Log(title = "新增", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult addSheep(@RequestBody ScAddSheep scAddSheep) {
|
||||
if (scAddSheep.getSheepId() == null || scAddSheep.getSheepId().isEmpty()) {
|
||||
return AjaxResult.error("羊只id不能为空");
|
||||
}
|
||||
if (scAddSheep.getSheepfold() == null || scAddSheep.getSheepfold() == 0) {
|
||||
return AjaxResult.error("羊舍不能为空");
|
||||
}
|
||||
if (scAddSheep.getBornWeight() == null) {
|
||||
return AjaxResult.error("出生体重不能为空");
|
||||
}
|
||||
if (scAddSheep.getBirthday() == null) {
|
||||
return AjaxResult.error("出生日期不能为空");
|
||||
}
|
||||
if (scAddSheep.getGender() == null) {
|
||||
return AjaxResult.error("性别不能为空");
|
||||
}
|
||||
if (scAddSheep.getVarietyId() == null) {
|
||||
return AjaxResult.error("品种不能为空");
|
||||
}
|
||||
|
||||
boolean success = scAddSheepService.insertScAddSheep(scAddSheep);
|
||||
if (success) {
|
||||
return success("新增成功");
|
||||
} else {
|
||||
return AjaxResult.error("新增失败");
|
||||
}
|
||||
}
|
||||
|
||||
//导出表单
|
||||
@PostMapping("/exportForm")
|
||||
@Log(title = "羊只信息", businessType = BusinessType.EXPORT)
|
||||
public void exportForm(HttpServletResponse response, @RequestBody ScAddSheep scAddSheep) throws IOException {
|
||||
ExcelUtil<ScAddSheep> util = new ExcelUtil<>(ScAddSheep.class);
|
||||
List<ScAddSheep> list = new ArrayList<>();
|
||||
list.add(scAddSheep);
|
||||
util.exportExcel(response, list, "羊只信息");
|
||||
}
|
||||
|
||||
//导入
|
||||
@PostMapping("/importData")
|
||||
@PreAuthorize("@ss.hasPermi('produce:add_sheep:import')")
|
||||
@Log(title = "羊只信息", businessType = BusinessType.IMPORT)
|
||||
public AjaxResult importData(MultipartFile file, boolean updateSupport) throws Exception {
|
||||
ExcelUtil<ScAddSheep> util = new ExcelUtil<>(ScAddSheep.class);
|
||||
List<ScAddSheep> list = util.importExcel(file.getInputStream());
|
||||
String message = scAddSheepService.importSheep(list, updateSupport, getUsername());
|
||||
return success(message);
|
||||
}
|
||||
|
||||
@PostMapping("/importTemplate")
|
||||
@PreAuthorize("@ss.hasPermi('produce:add_sheep:import')")
|
||||
public void importTemplate(HttpServletResponse response) {
|
||||
ExcelUtil<ScAddSheep> util = new ExcelUtil<>(ScAddSheep.class);
|
||||
util.importTemplateExcel(response, "羊只信息模板");
|
||||
}
|
||||
}
|
@ -0,0 +1,192 @@
|
||||
package com.zhyc.module.produce.manage_sheep.add_sheep.domain;
|
||||
|
||||
import com.zhyc.common.annotation.Excel;
|
||||
import com.zhyc.common.core.domain.BaseEntity;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
|
||||
public class ScAddSheep extends BaseEntity {
|
||||
/**
|
||||
* 羊只
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2025-07-10
|
||||
*/
|
||||
private static final long serialVersionUID = 1L;
|
||||
@Excel(name = "主键")
|
||||
private Long id; // 如果数据库主键叫 id,就加这一行
|
||||
/** 羊只ID */
|
||||
@Excel(name = "羊只ID")
|
||||
private String sheepId;
|
||||
|
||||
/** 羊舍编号 */
|
||||
@Excel(name = "羊舍")
|
||||
private Integer sheepfold;
|
||||
|
||||
/** 父号 */
|
||||
@Excel(name = "父号")
|
||||
private String father;
|
||||
|
||||
/** 母号 */
|
||||
@Excel(name = "母号")
|
||||
private String mother;
|
||||
|
||||
/** 出生体重 */
|
||||
@Excel(name = "出生体重")
|
||||
private BigDecimal bornWeight;
|
||||
|
||||
/** 出生日期 */
|
||||
@Excel(name = "出生日期", dateFormat = "yyyy-MM-dd")
|
||||
private Date birthday;
|
||||
|
||||
/** 性别 1公 0母 */
|
||||
@Excel(name = "性别", readConverterExp = "1=公,0=母")
|
||||
private Integer gender;
|
||||
|
||||
/** 胎次 */
|
||||
@Excel(name = "胎次")
|
||||
private Integer parity;
|
||||
|
||||
/** 品种编号 */
|
||||
@Excel(name = "品种编号")
|
||||
private Integer varietyId;
|
||||
|
||||
/** 入群日期 */
|
||||
@Excel(name = "入群日期", dateFormat = "yyyy-MM-dd")
|
||||
private Date joinDate;
|
||||
|
||||
/** 备注 */
|
||||
@Excel(name = "备注")
|
||||
private String comment;
|
||||
|
||||
/** 技术员 */
|
||||
@Excel(name = "技术员")
|
||||
private String technician;
|
||||
|
||||
/* 以下字段不导出 */
|
||||
private String createBy;
|
||||
private Date createTime;
|
||||
|
||||
// Getters and Setters
|
||||
public Long getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(Long id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getSheepId() {
|
||||
return sheepId;
|
||||
}
|
||||
|
||||
public void setSheepId(String sheepId) {
|
||||
this.sheepId = sheepId;
|
||||
}
|
||||
|
||||
public Integer getSheepfold() {
|
||||
return sheepfold;
|
||||
}
|
||||
|
||||
public void setSheepfold(Integer sheepfold) {
|
||||
this.sheepfold = sheepfold;
|
||||
}
|
||||
|
||||
public String getFather() {
|
||||
return father;
|
||||
}
|
||||
|
||||
public void setFather(String father) {
|
||||
this.father = father;
|
||||
}
|
||||
|
||||
public String getMother() {
|
||||
return mother;
|
||||
}
|
||||
|
||||
public void setMother(String mother) {
|
||||
this.mother = mother;
|
||||
}
|
||||
|
||||
public BigDecimal getBornWeight() {
|
||||
return bornWeight;
|
||||
}
|
||||
|
||||
public void setBornWeight(BigDecimal bornWeight) {
|
||||
this.bornWeight = bornWeight;
|
||||
}
|
||||
|
||||
public Date getBirthday() {
|
||||
return birthday;
|
||||
}
|
||||
|
||||
public void setBirthday(Date birthday) {
|
||||
this.birthday = birthday;
|
||||
}
|
||||
|
||||
public Integer getGender() {
|
||||
return gender;
|
||||
}
|
||||
|
||||
public void setGender(Integer gender) {
|
||||
this.gender = gender;
|
||||
}
|
||||
|
||||
public Integer getParity() {
|
||||
return parity;
|
||||
}
|
||||
|
||||
public void setParity(Integer parity) {
|
||||
this.parity = parity;
|
||||
}
|
||||
|
||||
public Integer getVarietyId() {
|
||||
return varietyId;
|
||||
}
|
||||
|
||||
public void setVarietyId(Integer varietyId) {
|
||||
this.varietyId = varietyId;
|
||||
}
|
||||
|
||||
public Date getJoinDate() {
|
||||
return joinDate;
|
||||
}
|
||||
|
||||
public void setJoinDate(Date joinDate) {
|
||||
this.joinDate = joinDate;
|
||||
}
|
||||
|
||||
public String getComment() {
|
||||
return comment;
|
||||
}
|
||||
|
||||
public void setComment(String comment) {
|
||||
this.comment = comment;
|
||||
}
|
||||
|
||||
public String getTechnician() {
|
||||
return technician;
|
||||
}
|
||||
|
||||
public void setTechnician(String technician) {
|
||||
this.technician = technician;
|
||||
}
|
||||
|
||||
public String getCreateBy() {
|
||||
return createBy;
|
||||
}
|
||||
|
||||
public void setCreateBy(String createBy) {
|
||||
this.createBy = createBy;
|
||||
}
|
||||
|
||||
public Date getCreateTime() {
|
||||
return createTime;
|
||||
}
|
||||
|
||||
public void setCreateTime(Date createTime) {
|
||||
this.createTime = createTime;
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,15 @@
|
||||
package com.zhyc.module.produce.manage_sheep.add_sheep.mapper;
|
||||
|
||||
import com.zhyc.module.produce.manage_sheep.add_sheep.domain.ScAddSheep;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Mapper
|
||||
public interface ScAddSheepMapper {
|
||||
int insert(ScAddSheep scAddSheep);
|
||||
List<ScAddSheep> selectScAddSheepList(ScAddSheep scAddSheep);
|
||||
int updateScAddSheep(ScAddSheep scAddSheep);
|
||||
int deleteScAddSheepByIds(Long[] ids);
|
||||
}
|
||||
|
@ -0,0 +1,17 @@
|
||||
package com.zhyc.module.produce.manage_sheep.add_sheep.service;
|
||||
|
||||
import com.zhyc.common.core.domain.AjaxResult;
|
||||
import com.zhyc.module.produce.manage_sheep.add_sheep.domain.ScAddSheep;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
||||
public interface IScAddSheepService {
|
||||
boolean insertScAddSheep(ScAddSheep scAddSheep);
|
||||
|
||||
List<ScAddSheep> selectScAddSheepList(ScAddSheep scAddSheep);
|
||||
boolean updateScAddSheep(ScAddSheep scAddSheep);
|
||||
boolean deleteScAddSheepByIds(Long[] ids);
|
||||
String importSheep(List<ScAddSheep> list, boolean updateSupport, String operName);
|
||||
}
|
||||
|
@ -0,0 +1,67 @@
|
||||
package com.zhyc.module.produce.manage_sheep.add_sheep.service.impl;
|
||||
|
||||
import com.zhyc.common.exception.ServiceException;
|
||||
import com.zhyc.common.utils.StringUtils;
|
||||
import com.zhyc.module.produce.manage_sheep.add_sheep.domain.ScAddSheep;
|
||||
import com.zhyc.module.produce.manage_sheep.add_sheep.mapper.ScAddSheepMapper;
|
||||
import com.zhyc.module.produce.manage_sheep.add_sheep.service.IScAddSheepService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Service
|
||||
public class ScAddSheepServiceImpl implements IScAddSheepService {
|
||||
@Autowired
|
||||
private ScAddSheepMapper scAddSheepMapper;
|
||||
|
||||
@Override
|
||||
public boolean insertScAddSheep(ScAddSheep scAddSheep) {
|
||||
return scAddSheepMapper.insert(scAddSheep) > 0;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public List<ScAddSheep> selectScAddSheepList(ScAddSheep scAddSheep) {
|
||||
return scAddSheepMapper.selectScAddSheepList(scAddSheep);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean updateScAddSheep(ScAddSheep scAddSheep) {
|
||||
return scAddSheepMapper.updateScAddSheep(scAddSheep) > 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean deleteScAddSheepByIds(Long[] ids) {
|
||||
return scAddSheepMapper.deleteScAddSheepByIds(ids) > 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String importSheep(List<ScAddSheep> list, boolean updateSupport, String operName) {
|
||||
if (list == null || list.isEmpty()) {
|
||||
throw new ServiceException("导入数据不能为空!");
|
||||
}
|
||||
int success = 0, failure = 0;
|
||||
StringBuilder failureMsg = new StringBuilder();
|
||||
for (ScAddSheep sheep : list) {
|
||||
try {
|
||||
if (StringUtils.isBlank(sheep.getSheepId())) {
|
||||
failure++; failureMsg.append("<br/>第").append(success + failure + 1).append("行:羊只ID不能为空"); continue;
|
||||
}
|
||||
if (updateSupport && sheep.getId() != null) {
|
||||
sheep.setUpdateBy(operName);
|
||||
updateScAddSheep(sheep);
|
||||
} else {
|
||||
sheep.setCreateBy(operName);
|
||||
insertScAddSheep(sheep);
|
||||
}
|
||||
success++;
|
||||
} catch (Exception e) {
|
||||
failure++; failureMsg.append("<br/>第").append(success + failure + 1).append("行:").append(e.getMessage());
|
||||
}
|
||||
}
|
||||
if (failure > 0) throw new ServiceException("导入失败!共 " + failure + " 条:" + failureMsg);
|
||||
return "导入成功!共 " + success + " 条";
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,105 @@
|
||||
package com.zhyc.module.produce.manage_sheep.trans_group.controller;
|
||||
|
||||
import java.util.List;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import com.zhyc.module.produce.manage_sheep.trans_group.domain.ScTransGroup;
|
||||
import com.zhyc.module.produce.manage_sheep.trans_group.service.IScTransGroupService;
|
||||
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.common.utils.poi.ExcelUtil;
|
||||
import com.zhyc.common.core.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* 转群记录Controller
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2025-07-10
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("produce/manage_sheep/trans_group")
|
||||
public class ScTransGroupController extends BaseController
|
||||
{
|
||||
@Autowired
|
||||
private IScTransGroupService scTransGroupService;
|
||||
|
||||
/**
|
||||
* 查询转群记录列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('produce:trans_group:list')")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(ScTransGroup scTransGroup)
|
||||
{
|
||||
startPage();
|
||||
List<ScTransGroup> list = scTransGroupService.selectScTransGroupList(scTransGroup);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出转群记录列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('produce:trans_group:export')")
|
||||
@Log(title = "转群记录", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, ScTransGroup scTransGroup)
|
||||
{
|
||||
List<ScTransGroup> list = scTransGroupService.selectScTransGroupList(scTransGroup);
|
||||
ExcelUtil<ScTransGroup> util = new ExcelUtil<ScTransGroup>(ScTransGroup.class);
|
||||
util.exportExcel(response, list, "转群记录数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取转群记录详细信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('produce:trans_group:query')")
|
||||
@GetMapping(value = "/{id}")
|
||||
public AjaxResult getInfo(@PathVariable("id") Integer id)
|
||||
{
|
||||
return success(scTransGroupService.selectScTransGroupById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增转群记录
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('produce:trans_group:add')")
|
||||
@Log(title = "转群记录", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody ScTransGroup scTransGroup)
|
||||
{
|
||||
return toAjax(scTransGroupService.insertScTransGroup(scTransGroup));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改转群记录
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('produce:trans_group:edit')")
|
||||
@Log(title = "转群记录", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody ScTransGroup scTransGroup)
|
||||
{
|
||||
return toAjax(scTransGroupService.updateScTransGroup(scTransGroup));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除转群记录
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('produce:trans_group:remove')")
|
||||
@Log(title = "转群记录", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public AjaxResult remove(@PathVariable Integer[] ids)
|
||||
{
|
||||
return toAjax(scTransGroupService.deleteScTransGroupByIds(ids));
|
||||
}
|
||||
}
|
@ -0,0 +1,144 @@
|
||||
package com.zhyc.module.produce.manage_sheep.trans_group.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;
|
||||
|
||||
/**
|
||||
* 转群记录对象 sc_trans_group
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2025-07-10
|
||||
*/
|
||||
public class ScTransGroup extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** $column.columnComment */
|
||||
private Integer id;
|
||||
|
||||
/** 羊只id */
|
||||
@Excel(name = "羊只id")
|
||||
private Integer sheepId;
|
||||
|
||||
/** 转入羊舍 */
|
||||
@Excel(name = "转入羊舍")
|
||||
private String foldTo;
|
||||
|
||||
/** 转出羊舍 */
|
||||
@Excel(name = "转出羊舍")
|
||||
private String foldFrom;
|
||||
|
||||
/** 转群原因 */
|
||||
@Excel(name = "转群原因")
|
||||
private String reason;
|
||||
|
||||
/** 技术员 */
|
||||
@Excel(name = "技术员")
|
||||
private String technician;
|
||||
|
||||
/** 状态 */
|
||||
@Excel(name = "状态")
|
||||
private Integer status;
|
||||
|
||||
/** 备注 */
|
||||
@Excel(name = "备注")
|
||||
private String comment;
|
||||
|
||||
public void setId(Integer id)
|
||||
{
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public Integer getId()
|
||||
{
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setSheepId(Integer sheepId)
|
||||
{
|
||||
this.sheepId = sheepId;
|
||||
}
|
||||
|
||||
public Integer getSheepId()
|
||||
{
|
||||
return sheepId;
|
||||
}
|
||||
|
||||
public void setFoldTo(String foldTo)
|
||||
{
|
||||
this.foldTo = foldTo;
|
||||
}
|
||||
|
||||
public String getFoldTo()
|
||||
{
|
||||
return foldTo;
|
||||
}
|
||||
|
||||
public void setFoldFrom(String foldFrom)
|
||||
{
|
||||
this.foldFrom = foldFrom;
|
||||
}
|
||||
|
||||
public String getFoldFrom()
|
||||
{
|
||||
return foldFrom;
|
||||
}
|
||||
|
||||
public void setReason(String reason)
|
||||
{
|
||||
this.reason = reason;
|
||||
}
|
||||
|
||||
public String getReason()
|
||||
{
|
||||
return reason;
|
||||
}
|
||||
|
||||
public void setTechnician(String technician)
|
||||
{
|
||||
this.technician = technician;
|
||||
}
|
||||
|
||||
public String getTechnician()
|
||||
{
|
||||
return technician;
|
||||
}
|
||||
|
||||
public void setStatus(Integer status)
|
||||
{
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
public Integer getStatus()
|
||||
{
|
||||
return status;
|
||||
}
|
||||
|
||||
public void setComment(String comment)
|
||||
{
|
||||
this.comment = comment;
|
||||
}
|
||||
|
||||
public String getComment()
|
||||
{
|
||||
return comment;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("id", getId())
|
||||
.append("sheepId", getSheepId())
|
||||
.append("foldTo", getFoldTo())
|
||||
.append("foldFrom", getFoldFrom())
|
||||
.append("reason", getReason())
|
||||
.append("technician", getTechnician())
|
||||
.append("status", getStatus())
|
||||
.append("comment", getComment())
|
||||
.append("createBy", getCreateBy())
|
||||
.append("createTime", getCreateTime())
|
||||
.toString();
|
||||
}
|
||||
}
|
@ -0,0 +1,61 @@
|
||||
package com.zhyc.module.produce.manage_sheep.trans_group.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import com.zhyc.module.produce.manage_sheep.trans_group.domain.ScTransGroup;
|
||||
|
||||
/**
|
||||
* 转群记录Mapper接口
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2025-07-10
|
||||
*/
|
||||
public interface ScTransGroupMapper
|
||||
{
|
||||
/**
|
||||
* 查询转群记录
|
||||
*
|
||||
* @param id 转群记录主键
|
||||
* @return 转群记录
|
||||
*/
|
||||
public ScTransGroup selectScTransGroupById(Integer id);
|
||||
|
||||
/**
|
||||
* 查询转群记录列表
|
||||
*
|
||||
* @param scTransGroup 转群记录
|
||||
* @return 转群记录集合
|
||||
*/
|
||||
public List<ScTransGroup> selectScTransGroupList(ScTransGroup scTransGroup);
|
||||
|
||||
/**
|
||||
* 新增转群记录
|
||||
*
|
||||
* @param scTransGroup 转群记录
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertScTransGroup(ScTransGroup scTransGroup);
|
||||
|
||||
/**
|
||||
* 修改转群记录
|
||||
*
|
||||
* @param scTransGroup 转群记录
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateScTransGroup(ScTransGroup scTransGroup);
|
||||
|
||||
/**
|
||||
* 删除转群记录
|
||||
*
|
||||
* @param id 转群记录主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteScTransGroupById(Integer id);
|
||||
|
||||
/**
|
||||
* 批量删除转群记录
|
||||
*
|
||||
* @param ids 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteScTransGroupByIds(Integer[] ids);
|
||||
}
|
@ -0,0 +1,61 @@
|
||||
package com.zhyc.module.produce.manage_sheep.trans_group.service;
|
||||
|
||||
import java.util.List;
|
||||
import com.zhyc.module.produce.manage_sheep.trans_group.domain.ScTransGroup;
|
||||
|
||||
/**
|
||||
* 转群记录Service接口
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2025-07-10
|
||||
*/
|
||||
public interface IScTransGroupService
|
||||
{
|
||||
/**
|
||||
* 查询转群记录
|
||||
*
|
||||
* @param id 转群记录主键
|
||||
* @return 转群记录
|
||||
*/
|
||||
public ScTransGroup selectScTransGroupById(Integer id);
|
||||
|
||||
/**
|
||||
* 查询转群记录列表
|
||||
*
|
||||
* @param scTransGroup 转群记录
|
||||
* @return 转群记录集合
|
||||
*/
|
||||
public List<ScTransGroup> selectScTransGroupList(ScTransGroup scTransGroup);
|
||||
|
||||
/**
|
||||
* 新增转群记录
|
||||
*
|
||||
* @param scTransGroup 转群记录
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertScTransGroup(ScTransGroup scTransGroup);
|
||||
|
||||
/**
|
||||
* 修改转群记录
|
||||
*
|
||||
* @param scTransGroup 转群记录
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateScTransGroup(ScTransGroup scTransGroup);
|
||||
|
||||
/**
|
||||
* 批量删除转群记录
|
||||
*
|
||||
* @param ids 需要删除的转群记录主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteScTransGroupByIds(Integer[] ids);
|
||||
|
||||
/**
|
||||
* 删除转群记录信息
|
||||
*
|
||||
* @param id 转群记录主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteScTransGroupById(Integer id);
|
||||
}
|
@ -0,0 +1,96 @@
|
||||
package com.zhyc.module.produce.manage_sheep.trans_group.service.impl;
|
||||
|
||||
import java.util.List;
|
||||
import com.zhyc.common.utils.DateUtils;
|
||||
import com.zhyc.module.produce.manage_sheep.trans_group.domain.ScTransGroup;
|
||||
import com.zhyc.module.produce.manage_sheep.trans_group.mapper.ScTransGroupMapper;
|
||||
import com.zhyc.module.produce.manage_sheep.trans_group.service.IScTransGroupService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* 转群记录Service业务层处理
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2025-07-10
|
||||
*/
|
||||
@Service
|
||||
public class ScTransGroupServiceImpl implements IScTransGroupService
|
||||
{
|
||||
@Autowired
|
||||
private ScTransGroupMapper scTransGroupMapper;
|
||||
|
||||
/**
|
||||
* 查询转群记录
|
||||
*
|
||||
* @param id 转群记录主键
|
||||
* @return 转群记录
|
||||
*/
|
||||
@Override
|
||||
public ScTransGroup selectScTransGroupById(Integer id)
|
||||
{
|
||||
return scTransGroupMapper.selectScTransGroupById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询转群记录列表
|
||||
*
|
||||
* @param scTransGroup 转群记录
|
||||
* @return 转群记录
|
||||
*/
|
||||
@Override
|
||||
public List<ScTransGroup> selectScTransGroupList(ScTransGroup scTransGroup)
|
||||
{
|
||||
return scTransGroupMapper.selectScTransGroupList(scTransGroup);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增转群记录
|
||||
*
|
||||
* @param scTransGroup 转群记录
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertScTransGroup(ScTransGroup scTransGroup)
|
||||
{
|
||||
scTransGroup.setStatus(0);
|
||||
scTransGroup.setCreateTime(DateUtils.getNowDate());
|
||||
return scTransGroupMapper.insertScTransGroup(scTransGroup);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改转群记录
|
||||
*
|
||||
* @param scTransGroup 转群记录
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateScTransGroup(ScTransGroup scTransGroup)
|
||||
{
|
||||
return scTransGroupMapper.updateScTransGroup(scTransGroup);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除转群记录
|
||||
*
|
||||
* @param ids 需要删除的转群记录主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteScTransGroupByIds(Integer[] ids)
|
||||
{
|
||||
return scTransGroupMapper.deleteScTransGroupByIds(ids);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除转群记录信息
|
||||
*
|
||||
* @param id 转群记录主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteScTransGroupById(Integer id)
|
||||
{
|
||||
return scTransGroupMapper.deleteScTransGroupById(id);
|
||||
}
|
||||
}
|
@ -0,0 +1,104 @@
|
||||
package com.zhyc.module.produce.manage_sheep.transition_info.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.produce.manage_sheep.transition_info.domain.ScTransitionInfo;
|
||||
import com.zhyc.module.produce.manage_sheep.transition_info.service.IScTransitionInfoService;
|
||||
import com.zhyc.common.utils.poi.ExcelUtil;
|
||||
import com.zhyc.common.core.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* 转场Controller
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2025-07-10
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("produce/manage_sheep/transition_info")
|
||||
public class ScTransitionInfoController extends BaseController
|
||||
{
|
||||
@Autowired
|
||||
private IScTransitionInfoService scTransitionInfoService;
|
||||
|
||||
/**
|
||||
* 查询转场列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('produce:transition_info:list')")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(ScTransitionInfo scTransitionInfo)
|
||||
{
|
||||
startPage();
|
||||
List<ScTransitionInfo> list = scTransitionInfoService.selectScTransitionInfoList(scTransitionInfo);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出转场列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('produce:transition_info:export')")
|
||||
@Log(title = "转场", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, ScTransitionInfo scTransitionInfo)
|
||||
{
|
||||
List<ScTransitionInfo> list = scTransitionInfoService.selectScTransitionInfoList(scTransitionInfo);
|
||||
ExcelUtil<ScTransitionInfo> util = new ExcelUtil<ScTransitionInfo>(ScTransitionInfo.class);
|
||||
util.exportExcel(response, list, "转场数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取转场详细信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('produce:transition_info:query')")
|
||||
@GetMapping(value = "/{id}")
|
||||
public AjaxResult getInfo(@PathVariable("id") Integer id)
|
||||
{
|
||||
return success(scTransitionInfoService.selectScTransitionInfoById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增转场
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('produce:transition_info:add')")
|
||||
@Log(title = "转场", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody ScTransitionInfo scTransitionInfo)
|
||||
{
|
||||
return toAjax(scTransitionInfoService.insertScTransitionInfo(scTransitionInfo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改转场
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('produce:transition_info:edit')")
|
||||
@Log(title = "转场", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody ScTransitionInfo scTransitionInfo)
|
||||
{
|
||||
return toAjax(scTransitionInfoService.updateScTransitionInfo(scTransitionInfo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除转场
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('produce:transition_info:remove')")
|
||||
@Log(title = "转场", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public AjaxResult remove(@PathVariable Integer[] ids)
|
||||
{
|
||||
return toAjax(scTransitionInfoService.deleteScTransitionInfoByIds(ids));
|
||||
}
|
||||
}
|
@ -0,0 +1,144 @@
|
||||
package com.zhyc.module.produce.manage_sheep.transition_info.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;
|
||||
|
||||
/**
|
||||
* 转场对象 sc_transition_info
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2025-07-10
|
||||
*/
|
||||
public class ScTransitionInfo extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** */
|
||||
private Integer id;
|
||||
|
||||
/** 羊只id */
|
||||
@Excel(name = "羊只id")
|
||||
private Integer sheepId;
|
||||
|
||||
/** 转入牧场 */
|
||||
@Excel(name = "转入牧场")
|
||||
private String transTo;
|
||||
|
||||
/** 当前牧场 */
|
||||
@Excel(name = "当前牧场")
|
||||
private String transFrom;
|
||||
|
||||
/** 转场类型 */
|
||||
@Excel(name = "转场类型")
|
||||
private Long transType;
|
||||
|
||||
/** 技术员 */
|
||||
@Excel(name = "技术员")
|
||||
private String technician;
|
||||
|
||||
/** 状态 */
|
||||
@Excel(name = "状态")
|
||||
private Integer status;
|
||||
|
||||
/** 备注 */
|
||||
@Excel(name = "备注")
|
||||
private String comment;
|
||||
|
||||
public void setId(Integer id)
|
||||
{
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public Integer getId()
|
||||
{
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setSheepId(Integer sheepId)
|
||||
{
|
||||
this.sheepId = sheepId;
|
||||
}
|
||||
|
||||
public Integer getSheepId()
|
||||
{
|
||||
return sheepId;
|
||||
}
|
||||
|
||||
public void setTransTo(String transTo)
|
||||
{
|
||||
this.transTo = transTo;
|
||||
}
|
||||
|
||||
public String getTransTo()
|
||||
{
|
||||
return transTo;
|
||||
}
|
||||
|
||||
public void setTransFrom(String transFrom)
|
||||
{
|
||||
this.transFrom = transFrom;
|
||||
}
|
||||
|
||||
public String getTransFrom()
|
||||
{
|
||||
return transFrom;
|
||||
}
|
||||
|
||||
public void setTransType(Long transType)
|
||||
{
|
||||
this.transType = transType;
|
||||
}
|
||||
|
||||
public Long getTransType()
|
||||
{
|
||||
return transType;
|
||||
}
|
||||
|
||||
public void setTechnician(String technician)
|
||||
{
|
||||
this.technician = technician;
|
||||
}
|
||||
|
||||
public String getTechnician()
|
||||
{
|
||||
return technician;
|
||||
}
|
||||
|
||||
public void setStatus(Integer status)
|
||||
{
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
public Integer getStatus()
|
||||
{
|
||||
return status;
|
||||
}
|
||||
|
||||
public void setComment(String comment)
|
||||
{
|
||||
this.comment = comment;
|
||||
}
|
||||
|
||||
public String getComment()
|
||||
{
|
||||
return comment;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("id", getId())
|
||||
.append("sheepId", getSheepId())
|
||||
.append("transTo", getTransTo())
|
||||
.append("transFrom", getTransFrom())
|
||||
.append("transType", getTransType())
|
||||
.append("technician", getTechnician())
|
||||
.append("status", getStatus())
|
||||
.append("comment", getComment())
|
||||
.append("createBy", getCreateBy())
|
||||
.append("createTime", getCreateTime())
|
||||
.toString();
|
||||
}
|
||||
}
|
@ -0,0 +1,62 @@
|
||||
package com.zhyc.module.produce.manage_sheep.transition_info.mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.zhyc.module.produce.manage_sheep.transition_info.domain.ScTransitionInfo;
|
||||
|
||||
/**
|
||||
* 转场Mapper接口
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2025-07-10
|
||||
*/
|
||||
public interface ScTransitionInfoMapper
|
||||
{
|
||||
/**
|
||||
* 查询转场
|
||||
*
|
||||
* @param id 转场主键
|
||||
* @return 转场
|
||||
*/
|
||||
public ScTransitionInfo selectScTransitionInfoById(Integer id);
|
||||
|
||||
/**
|
||||
* 查询转场列表
|
||||
*
|
||||
* @param scTransitionInfo 转场
|
||||
* @return 转场集合
|
||||
*/
|
||||
public List<ScTransitionInfo> selectScTransitionInfoList(ScTransitionInfo scTransitionInfo);
|
||||
|
||||
/**
|
||||
* 新增转场
|
||||
*
|
||||
* @param scTransitionInfo 转场
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertScTransitionInfo(ScTransitionInfo scTransitionInfo);
|
||||
|
||||
/**
|
||||
* 修改转场
|
||||
*
|
||||
* @param scTransitionInfo 转场
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateScTransitionInfo(ScTransitionInfo scTransitionInfo);
|
||||
|
||||
/**
|
||||
* 删除转场
|
||||
*
|
||||
* @param id 转场主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteScTransitionInfoById(Integer id);
|
||||
|
||||
/**
|
||||
* 批量删除转场
|
||||
*
|
||||
* @param ids 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteScTransitionInfoByIds(Integer[] ids);
|
||||
}
|
@ -0,0 +1,62 @@
|
||||
package com.zhyc.module.produce.manage_sheep.transition_info.service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.zhyc.module.produce.manage_sheep.transition_info.domain.ScTransitionInfo;
|
||||
|
||||
/**
|
||||
* 转场Service接口
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2025-07-10
|
||||
*/
|
||||
public interface IScTransitionInfoService
|
||||
{
|
||||
/**
|
||||
* 查询转场
|
||||
*
|
||||
* @param id 转场主键
|
||||
* @return 转场
|
||||
*/
|
||||
public ScTransitionInfo selectScTransitionInfoById(Integer id);
|
||||
|
||||
/**
|
||||
* 查询转场列表
|
||||
*
|
||||
* @param scTransitionInfo 转场
|
||||
* @return 转场集合
|
||||
*/
|
||||
public List<ScTransitionInfo> selectScTransitionInfoList(ScTransitionInfo scTransitionInfo);
|
||||
|
||||
/**
|
||||
* 新增转场
|
||||
*
|
||||
* @param scTransitionInfo 转场
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertScTransitionInfo(ScTransitionInfo scTransitionInfo);
|
||||
|
||||
/**
|
||||
* 修改转场
|
||||
*
|
||||
* @param scTransitionInfo 转场
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateScTransitionInfo(ScTransitionInfo scTransitionInfo);
|
||||
|
||||
/**
|
||||
* 批量删除转场
|
||||
*
|
||||
* @param ids 需要删除的转场主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteScTransitionInfoByIds(Integer[] ids);
|
||||
|
||||
/**
|
||||
* 删除转场信息
|
||||
*
|
||||
* @param id 转场主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteScTransitionInfoById(Integer id);
|
||||
}
|
@ -0,0 +1,96 @@
|
||||
package com.zhyc.module.produce.manage_sheep.transition_info.service.impl;
|
||||
|
||||
import java.util.List;
|
||||
import com.zhyc.common.utils.DateUtils;
|
||||
import com.zhyc.module.produce.manage_sheep.transition_info.domain.ScTransitionInfo;
|
||||
import com.zhyc.module.produce.manage_sheep.transition_info.mapper.ScTransitionInfoMapper;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.zhyc.module.produce.manage_sheep.transition_info.service.IScTransitionInfoService;
|
||||
|
||||
/**
|
||||
* 转场Service业务层处理
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2025-07-10
|
||||
*/
|
||||
@Service
|
||||
public class ScTransitionInfoServiceImpl implements IScTransitionInfoService
|
||||
{
|
||||
@Autowired
|
||||
private ScTransitionInfoMapper scTransitionInfoMapper;
|
||||
|
||||
/**
|
||||
* 查询转场
|
||||
*
|
||||
* @param id 转场主键
|
||||
* @return 转场
|
||||
*/
|
||||
@Override
|
||||
public ScTransitionInfo selectScTransitionInfoById(Integer id)
|
||||
{
|
||||
return scTransitionInfoMapper.selectScTransitionInfoById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询转场列表
|
||||
*
|
||||
* @param scTransitionInfo 转场
|
||||
* @return 转场
|
||||
*/
|
||||
@Override
|
||||
public List<ScTransitionInfo> selectScTransitionInfoList(ScTransitionInfo scTransitionInfo)
|
||||
{
|
||||
return scTransitionInfoMapper.selectScTransitionInfoList(scTransitionInfo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增转场
|
||||
*
|
||||
* @param scTransitionInfo 转场
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertScTransitionInfo(ScTransitionInfo scTransitionInfo)
|
||||
{
|
||||
scTransitionInfo.setStatus(0);
|
||||
scTransitionInfo.setCreateTime(DateUtils.getNowDate());
|
||||
return scTransitionInfoMapper.insertScTransitionInfo(scTransitionInfo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改转场
|
||||
*
|
||||
* @param scTransitionInfo 转场
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateScTransitionInfo(ScTransitionInfo scTransitionInfo)
|
||||
{
|
||||
return scTransitionInfoMapper.updateScTransitionInfo(scTransitionInfo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除转场
|
||||
*
|
||||
* @param ids 需要删除的转场主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteScTransitionInfoByIds(Integer[] ids)
|
||||
{
|
||||
return scTransitionInfoMapper.deleteScTransitionInfoByIds(ids);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除转场信息
|
||||
*
|
||||
* @param id 转场主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteScTransitionInfoById(Integer id)
|
||||
{
|
||||
return scTransitionInfoMapper.deleteScTransitionInfoById(id);
|
||||
}
|
||||
}
|
@ -1,10 +1,10 @@
|
||||
package com.zhyc.module.produce.controller;
|
||||
package com.zhyc.module.produce.other.castrate.controller;
|
||||
|
||||
import java.util.List;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import com.zhyc.module.produce.domain.ScCastrate;
|
||||
import com.zhyc.module.produce.service.IScCastrateService;
|
||||
import com.zhyc.module.produce.other.castrate.domain.ScCastrate;
|
||||
import com.zhyc.module.produce.other.castrate.service.IScCastrateService;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
@ -29,7 +29,7 @@ import com.zhyc.common.core.page.TableDataInfo;
|
||||
* @date 2025-07-09
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/produce/castrate")
|
||||
@RequestMapping("/produce/other/castrate")
|
||||
public class ScCastrateController extends BaseController
|
||||
{
|
||||
@Autowired
|
@ -0,0 +1,112 @@
|
||||
package com.zhyc.module.produce.other.castrate.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;
|
||||
|
||||
/**
|
||||
* 去势对象 sc_castrate
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2025-07-09
|
||||
*/
|
||||
public class ScCastrate extends BaseEntity {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* $column.columnComment
|
||||
*/
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 羊只id
|
||||
*/
|
||||
@Excel(name = "羊只id")
|
||||
private String sheepId;
|
||||
|
||||
/**
|
||||
* 羊舍id
|
||||
*/
|
||||
private Long sheepfold;
|
||||
|
||||
/**
|
||||
* 用于通过羊舍id获取羊舍名称
|
||||
*/
|
||||
@Excel(name = "羊舍名称")
|
||||
private String sheepfoldName;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
@Excel(name = "备注")
|
||||
private String comment;
|
||||
|
||||
/**
|
||||
* 技术员
|
||||
*/
|
||||
@Excel(name = "技术员")
|
||||
private String technician;
|
||||
|
||||
|
||||
|
||||
public void setId(Long id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public Long getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setSheepId(String sheepId) {
|
||||
this.sheepId = sheepId;
|
||||
}
|
||||
|
||||
public String getSheepId() {
|
||||
return sheepId;
|
||||
}
|
||||
|
||||
public void setSheepfold(Long sheepfold) {
|
||||
this.sheepfold = sheepfold;
|
||||
}
|
||||
|
||||
public Long getSheepfold() {
|
||||
return sheepfold;
|
||||
}
|
||||
|
||||
public void setComment(String comment) {
|
||||
this.comment = comment;
|
||||
}
|
||||
|
||||
public String getComment() {
|
||||
return comment;
|
||||
}
|
||||
|
||||
public void setTechnician(String technician) {
|
||||
this.technician = technician;
|
||||
}
|
||||
|
||||
public String getTechnician() {
|
||||
return technician;
|
||||
}
|
||||
|
||||
public String getSheepfoldName() {
|
||||
return sheepfoldName;
|
||||
}
|
||||
public void setSheepfoldName(String sheepfoldName) {
|
||||
this.sheepfoldName = sheepfoldName;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("id", getId())
|
||||
.append("sheepId", getSheepId())
|
||||
.append("sheepfold", getSheepfold())
|
||||
.append("comment", getComment())
|
||||
.append("technician", getTechnician())
|
||||
.append("createBy", getCreateBy())
|
||||
.append("createTime", getCreateTime())
|
||||
.toString();
|
||||
}
|
||||
}
|
@ -1,7 +1,8 @@
|
||||
package com.zhyc.module.produce.mapper;
|
||||
package com.zhyc.module.produce.other.castrate.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import com.zhyc.module.produce.domain.ScCastrate;
|
||||
|
||||
import com.zhyc.module.produce.other.castrate.domain.ScCastrate;
|
||||
|
||||
/**
|
||||
* 去势Mapper接口
|
@ -1,7 +1,8 @@
|
||||
package com.zhyc.module.produce.service;
|
||||
package com.zhyc.module.produce.other.castrate.service;
|
||||
|
||||
import java.util.List;
|
||||
import com.zhyc.module.produce.domain.ScCastrate;
|
||||
|
||||
import com.zhyc.module.produce.other.castrate.domain.ScCastrate;
|
||||
|
||||
/**
|
||||
* 去势Service接口
|
@ -1,10 +1,10 @@
|
||||
package com.zhyc.module.produce.service.impl;
|
||||
package com.zhyc.module.produce.other.castrate.service.impl;
|
||||
|
||||
import java.util.List;
|
||||
import com.zhyc.common.utils.DateUtils;
|
||||
import com.zhyc.module.produce.domain.ScCastrate;
|
||||
import com.zhyc.module.produce.mapper.ScCastrateMapper;
|
||||
import com.zhyc.module.produce.service.IScCastrateService;
|
||||
import com.zhyc.module.produce.other.castrate.domain.ScCastrate;
|
||||
import com.zhyc.module.produce.other.castrate.mapper.ScCastrateMapper;
|
||||
import com.zhyc.module.produce.other.castrate.service.IScCastrateService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
@ -0,0 +1,108 @@
|
||||
package com.zhyc.module.produce.other.fixHoof.controller;
|
||||
|
||||
import java.util.List;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import com.zhyc.module.produce.other.fixHoof.domain.ScFixHoof;
|
||||
import com.zhyc.module.produce.other.fixHoof.service.IScFixHoofService;
|
||||
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.common.utils.poi.ExcelUtil;
|
||||
import com.zhyc.common.core.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* 修蹄Controller
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2025-07-10
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/produce/other/fixHoof")
|
||||
public class ScFixHoofController extends BaseController
|
||||
{
|
||||
@Autowired
|
||||
private IScFixHoofService scFixHoofService;
|
||||
|
||||
/**
|
||||
* 查询修蹄列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('produce:fixHoof:list')")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(ScFixHoof scFixHoof)
|
||||
{
|
||||
startPage();
|
||||
List<ScFixHoof> list = scFixHoofService.selectScFixHoofList(scFixHoof);
|
||||
return getDataTable(list);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出修蹄列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('produce:fixHoof:export')")
|
||||
@Log(title = "修蹄", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, ScFixHoof scFixHoof)
|
||||
{
|
||||
List<ScFixHoof> list = scFixHoofService.selectScFixHoofList(scFixHoof);
|
||||
ExcelUtil<ScFixHoof> util = new ExcelUtil<ScFixHoof>(ScFixHoof.class);
|
||||
util.exportExcel(response, list, "修蹄数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取修蹄详细信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('produce:fixHoof:query')")
|
||||
@GetMapping(value = "/{id}")
|
||||
public AjaxResult getInfo(@PathVariable("id") Long id)
|
||||
{
|
||||
return success(scFixHoofService.selectScFixHoofById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增修蹄
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('produce:fixHoof:add')")
|
||||
@Log(title = "修蹄", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody ScFixHoof scFixHoof)
|
||||
{
|
||||
return toAjax(scFixHoofService.insertScFixHoof(scFixHoof));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改修蹄
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('produce:fixHoof:edit')")
|
||||
@Log(title = "修蹄", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody ScFixHoof scFixHoof)
|
||||
{
|
||||
return toAjax(scFixHoofService.updateScFixHoof(scFixHoof));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除修蹄
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('produce:fixHoof:remove')")
|
||||
@Log(title = "修蹄", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public AjaxResult remove(@PathVariable Long[] ids)
|
||||
{
|
||||
return toAjax(scFixHoofService.deleteScFixHoofByIds(ids));
|
||||
}
|
||||
|
||||
|
||||
}
|
@ -1,4 +1,4 @@
|
||||
package com.zhyc.module.produce.domain;
|
||||
package com.zhyc.module.produce.other.fixHoof.domain;
|
||||
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
@ -6,12 +6,12 @@ import com.zhyc.common.annotation.Excel;
|
||||
import com.zhyc.common.core.domain.BaseEntity;
|
||||
|
||||
/**
|
||||
* 去势对象 sc_castrate
|
||||
* 修蹄对象 sc_fix_hoof
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2025-07-09
|
||||
* @date 2025-07-10
|
||||
*/
|
||||
public class ScCastrate extends BaseEntity
|
||||
public class ScFixHoof extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@ -20,7 +20,7 @@ public class ScCastrate extends BaseEntity
|
||||
|
||||
/** 羊只id */
|
||||
@Excel(name = "羊只id")
|
||||
private String sheepId;
|
||||
private Long sheepId;
|
||||
|
||||
/** 羊舍id */
|
||||
@Excel(name = "羊舍id")
|
||||
@ -44,12 +44,12 @@ public class ScCastrate extends BaseEntity
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setSheepId(String sheepId)
|
||||
public void setSheepId(Long sheepId)
|
||||
{
|
||||
this.sheepId = sheepId;
|
||||
}
|
||||
|
||||
public String getSheepId()
|
||||
public Long getSheepId()
|
||||
{
|
||||
return sheepId;
|
||||
}
|
@ -0,0 +1,61 @@
|
||||
package com.zhyc.module.produce.other.fixHoof.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import com.zhyc.module.produce.other.fixHoof.domain.ScFixHoof;
|
||||
|
||||
/**
|
||||
* 修蹄Mapper接口
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2025-07-10
|
||||
*/
|
||||
public interface ScFixHoofMapper
|
||||
{
|
||||
/**
|
||||
* 查询修蹄
|
||||
*
|
||||
* @param id 修蹄主键
|
||||
* @return 修蹄
|
||||
*/
|
||||
public ScFixHoof selectScFixHoofById(Long id);
|
||||
|
||||
/**
|
||||
* 查询修蹄列表
|
||||
*
|
||||
* @param scFixHoof 修蹄
|
||||
* @return 修蹄集合
|
||||
*/
|
||||
public List<ScFixHoof> selectScFixHoofList(ScFixHoof scFixHoof);
|
||||
|
||||
/**
|
||||
* 新增修蹄
|
||||
*
|
||||
* @param scFixHoof 修蹄
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertScFixHoof(ScFixHoof scFixHoof);
|
||||
|
||||
/**
|
||||
* 修改修蹄
|
||||
*
|
||||
* @param scFixHoof 修蹄
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateScFixHoof(ScFixHoof scFixHoof);
|
||||
|
||||
/**
|
||||
* 删除修蹄
|
||||
*
|
||||
* @param id 修蹄主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteScFixHoofById(Long id);
|
||||
|
||||
/**
|
||||
* 批量删除修蹄
|
||||
*
|
||||
* @param ids 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteScFixHoofByIds(Long[] ids);
|
||||
}
|
@ -0,0 +1,61 @@
|
||||
package com.zhyc.module.produce.other.fixHoof.service;
|
||||
|
||||
import java.util.List;
|
||||
import com.zhyc.module.produce.other.fixHoof.domain.ScFixHoof;
|
||||
|
||||
/**
|
||||
* 修蹄Service接口
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2025-07-10
|
||||
*/
|
||||
public interface IScFixHoofService
|
||||
{
|
||||
/**
|
||||
* 查询修蹄
|
||||
*
|
||||
* @param id 修蹄主键
|
||||
* @return 修蹄
|
||||
*/
|
||||
public ScFixHoof selectScFixHoofById(Long id);
|
||||
|
||||
/**
|
||||
* 查询修蹄列表
|
||||
*
|
||||
* @param scFixHoof 修蹄
|
||||
* @return 修蹄集合
|
||||
*/
|
||||
public List<ScFixHoof> selectScFixHoofList(ScFixHoof scFixHoof);
|
||||
|
||||
/**
|
||||
* 新增修蹄
|
||||
*
|
||||
* @param scFixHoof 修蹄
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertScFixHoof(ScFixHoof scFixHoof);
|
||||
|
||||
/**
|
||||
* 修改修蹄
|
||||
*
|
||||
* @param scFixHoof 修蹄
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateScFixHoof(ScFixHoof scFixHoof);
|
||||
|
||||
/**
|
||||
* 批量删除修蹄
|
||||
*
|
||||
* @param ids 需要删除的修蹄主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteScFixHoofByIds(Long[] ids);
|
||||
|
||||
/**
|
||||
* 删除修蹄信息
|
||||
*
|
||||
* @param id 修蹄主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteScFixHoofById(Long id);
|
||||
}
|
@ -0,0 +1,95 @@
|
||||
package com.zhyc.module.produce.other.fixHoof.service.impl;
|
||||
|
||||
import java.util.List;
|
||||
import com.zhyc.common.utils.DateUtils;
|
||||
import com.zhyc.module.produce.other.fixHoof.domain.ScFixHoof;
|
||||
import com.zhyc.module.produce.other.fixHoof.mapper.ScFixHoofMapper;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.zhyc.module.produce.other.fixHoof.service.IScFixHoofService;
|
||||
|
||||
/**
|
||||
* 修蹄Service业务层处理
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2025-07-10
|
||||
*/
|
||||
@Service
|
||||
public class ScFixHoofServiceImpl implements IScFixHoofService
|
||||
{
|
||||
@Autowired
|
||||
private ScFixHoofMapper scFixHoofMapper;
|
||||
|
||||
/**
|
||||
* 查询修蹄
|
||||
*
|
||||
* @param id 修蹄主键
|
||||
* @return 修蹄
|
||||
*/
|
||||
@Override
|
||||
public ScFixHoof selectScFixHoofById(Long id)
|
||||
{
|
||||
return scFixHoofMapper.selectScFixHoofById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询修蹄列表
|
||||
*
|
||||
* @param scFixHoof 修蹄
|
||||
* @return 修蹄
|
||||
*/
|
||||
@Override
|
||||
public List<ScFixHoof> selectScFixHoofList(ScFixHoof scFixHoof)
|
||||
{
|
||||
return scFixHoofMapper.selectScFixHoofList(scFixHoof);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增修蹄
|
||||
*
|
||||
* @param scFixHoof 修蹄
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertScFixHoof(ScFixHoof scFixHoof)
|
||||
{
|
||||
scFixHoof.setCreateTime(DateUtils.getNowDate());
|
||||
return scFixHoofMapper.insertScFixHoof(scFixHoof);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改修蹄
|
||||
*
|
||||
* @param scFixHoof 修蹄
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateScFixHoof(ScFixHoof scFixHoof)
|
||||
{
|
||||
return scFixHoofMapper.updateScFixHoof(scFixHoof);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除修蹄
|
||||
*
|
||||
* @param ids 需要删除的修蹄主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteScFixHoofByIds(Long[] ids)
|
||||
{
|
||||
return scFixHoofMapper.deleteScFixHoofByIds(ids);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除修蹄信息
|
||||
*
|
||||
* @param id 修蹄主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteScFixHoofById(Long id)
|
||||
{
|
||||
return scFixHoofMapper.deleteScFixHoofById(id);
|
||||
}
|
||||
}
|
@ -58,4 +58,5 @@ public interface DaSheepfoldMapper
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteDaSheepfoldByIds(Long[] ids);
|
||||
|
||||
}
|
||||
|
@ -0,0 +1,71 @@
|
||||
<?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.produce.manage_sheep.add_sheep.mapper.ScAddSheepMapper">
|
||||
<resultMap type="com.zhyc.module.produce.manage_sheep.add_sheep.domain.ScAddSheep" id="ScAddSheepResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="sheepId" column="sheep_id" />
|
||||
<result property="sheepfold" column="sheepfold" />
|
||||
<result property="father" column="father" />
|
||||
<result property="mother" column="mother" />
|
||||
<result property="bornWeight" column="born_weight" />
|
||||
<result property="birthday" column="birthday" />
|
||||
<result property="gender" column="gender" />
|
||||
<result property="parity" column="parity" />
|
||||
<result property="varietyId" column="variety_id" />
|
||||
<result property="joinDate" column="join_date" />
|
||||
<result property="comment" column="comment" />
|
||||
<result property="technician" column="technician" />
|
||||
<result property="createBy" column="create_by" />
|
||||
<result property="createTime" column="create_time" />
|
||||
</resultMap>
|
||||
|
||||
<insert id="insert" parameterType="ScAddSheep" useGeneratedKeys="true" keyProperty="id">
|
||||
INSERT INTO sc_add_sheep
|
||||
(sheep_id, sheepfold, father, mother, born_weight, birthday, gender, parity,
|
||||
variety_id, join_date, comment, technician, create_by, create_time)
|
||||
VALUES
|
||||
(#{sheepId}, #{sheepfold}, #{father}, #{mother}, #{bornWeight}, #{birthday},
|
||||
#{gender}, #{parity}, #{varietyId}, #{joinDate}, #{comment}, #{technician},
|
||||
#{createBy}, #{createTime})
|
||||
</insert>
|
||||
|
||||
<select id="selectScAddSheepList" parameterType="ScAddSheep" resultMap="ScAddSheepResult">
|
||||
SELECT * FROM sc_add_sheep
|
||||
<where>
|
||||
<if test="sheepId != null and sheepId != ''">AND sheep_id LIKE CONCAT('%', #{sheepId}, '%')</if>
|
||||
<!-- 其他字段同理,按需扩展 -->
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<update id="updateScAddSheep" parameterType="ScAddSheep">
|
||||
UPDATE sc_add_sheep
|
||||
<set>
|
||||
sheep_id = #{sheepId},
|
||||
sheepfold = #{sheepfold},
|
||||
father = #{father},
|
||||
mother = #{mother},
|
||||
born_weight = #{bornWeight},
|
||||
birthday = #{birthday},
|
||||
gender = #{gender},
|
||||
parity = #{parity},
|
||||
variety_id = #{varietyId},
|
||||
join_date = #{joinDate},
|
||||
comment = #{comment},
|
||||
technician = #{technician},
|
||||
update_by = #{updateBy},
|
||||
update_time = NOW()
|
||||
</set>
|
||||
WHERE id = #{id}
|
||||
</update>
|
||||
|
||||
<delete id="deleteScAddSheepByIds">
|
||||
DELETE FROM sc_add_sheep WHERE id IN
|
||||
<foreach collection="array" item="id" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
</mapper>
|
@ -0,0 +1,92 @@
|
||||
<?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.produce.manage_sheep.trans_group.mapper.ScTransGroupMapper">
|
||||
|
||||
<resultMap type="ScTransGroup" id="ScTransGroupResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="sheepId" column="sheep_id" />
|
||||
<result property="foldTo" column="fold_to" />
|
||||
<result property="foldFrom" column="fold_from" />
|
||||
<result property="reason" column="reason" />
|
||||
<result property="technician" column="technician" />
|
||||
<result property="status" column="status" />
|
||||
<result property="comment" column="comment" />
|
||||
<result property="createBy" column="create_by" />
|
||||
<result property="createTime" column="create_time" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectScTransGroupVo">
|
||||
select id, sheep_id, fold_to, fold_from, reason, technician, status, comment, create_by, create_time from sc_trans_group
|
||||
</sql>
|
||||
|
||||
<select id="selectScTransGroupList" parameterType="ScTransGroup" resultMap="ScTransGroupResult">
|
||||
<include refid="selectScTransGroupVo"/>
|
||||
<where>
|
||||
<if test="sheepId != null "> and sheep_id = #{sheepId}</if>
|
||||
<if test="foldTo != null and foldTo != ''"> and fold_to = #{foldTo}</if>
|
||||
<if test="foldFrom != null and foldFrom != ''"> and fold_from = #{foldFrom}</if>
|
||||
<if test="status != null "> and status = #{status}</if>
|
||||
<if test="params.beginCreateTime != null and params.beginCreateTime != '' and params.endCreateTime != null and params.endCreateTime != ''"> and create_time between #{params.beginCreateTime} and #{params.endCreateTime}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectScTransGroupById" parameterType="Integer" resultMap="ScTransGroupResult">
|
||||
<include refid="selectScTransGroupVo"/>
|
||||
where id = #{id}
|
||||
</select>
|
||||
|
||||
<insert id="insertScTransGroup" parameterType="ScTransGroup" useGeneratedKeys="true" keyProperty="id">
|
||||
insert into sc_trans_group
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="sheepId != null">sheep_id,</if>
|
||||
<if test="foldTo != null and foldTo != ''">fold_to,</if>
|
||||
<if test="foldFrom != null and foldFrom != ''">fold_from,</if>
|
||||
<if test="reason != null and reason != ''">reason,</if>
|
||||
<if test="technician != null and technician != ''">technician,</if>
|
||||
<if test="status != null">status,</if>
|
||||
<if test="comment != null">comment,</if>
|
||||
<if test="createBy != null">create_by,</if>
|
||||
<if test="createTime != null">create_time,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="sheepId != null">#{sheepId},</if>
|
||||
<if test="foldTo != null and foldTo != ''">#{foldTo},</if>
|
||||
<if test="foldFrom != null and foldFrom != ''">#{foldFrom},</if>
|
||||
<if test="reason != null and reason != ''">#{reason},</if>
|
||||
<if test="technician != null and technician != ''">#{technician},</if>
|
||||
<if test="status != null">#{status},</if>
|
||||
<if test="comment != null">#{comment},</if>
|
||||
<if test="createBy != null">#{createBy},</if>
|
||||
<if test="createTime != null">#{createTime},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateScTransGroup" parameterType="ScTransGroup">
|
||||
update sc_trans_group
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="sheepId != null">sheep_id = #{sheepId},</if>
|
||||
<if test="foldTo != null and foldTo != ''">fold_to = #{foldTo},</if>
|
||||
<if test="foldFrom != null and foldFrom != ''">fold_from = #{foldFrom},</if>
|
||||
<if test="reason != null and reason != ''">reason = #{reason},</if>
|
||||
<if test="technician != null and technician != ''">technician = #{technician},</if>
|
||||
<if test="status != null">status = #{status},</if>
|
||||
<if test="comment != null">comment = #{comment},</if>
|
||||
<if test="createBy != null">create_by = #{createBy},</if>
|
||||
<if test="createTime != null">create_time = #{createTime},</if>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<delete id="deleteScTransGroupById" parameterType="Integer">
|
||||
delete from sc_trans_group where id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteScTransGroupByIds" parameterType="String">
|
||||
delete from sc_trans_group where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
</mapper>
|
@ -0,0 +1,91 @@
|
||||
<?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.produce.manage_sheep.transition_info.mapper.ScTransitionInfoMapper">
|
||||
<resultMap type="ScTransitionInfo" id="ScTransitionInfoResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="sheepId" column="sheep_id" />
|
||||
<result property="transTo" column="trans_to" />
|
||||
<result property="transFrom" column="trans_from" />
|
||||
<result property="transType" column="trans_type" />
|
||||
<result property="technician" column="technician" />
|
||||
<result property="status" column="status" />
|
||||
<result property="comment" column="comment" />
|
||||
<result property="createBy" column="create_by" />
|
||||
<result property="createTime" column="create_time" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectScTransitionInfoVo">
|
||||
select id, sheep_id, trans_to, trans_from, trans_type, technician, status, comment, create_by, create_time from sc_transition_info
|
||||
</sql>
|
||||
|
||||
<select id="selectScTransitionInfoList" parameterType="ScTransitionInfo" resultMap="ScTransitionInfoResult">
|
||||
<include refid="selectScTransitionInfoVo"/>
|
||||
<where>
|
||||
<if test="sheepId != null "> and sheep_id = #{sheepId}</if>
|
||||
<if test="transTo != null and transTo != ''"> and trans_to = #{transTo}</if>
|
||||
<if test="transFrom != null and transFrom != ''"> and trans_from = #{transFrom}</if>
|
||||
<if test="status != null "> and status = #{status}</if>
|
||||
<if test="params.beginCreateTime != null and params.beginCreateTime != '' and params.endCreateTime != null and params.endCreateTime != ''"> and create_time between #{params.beginCreateTime} and #{params.endCreateTime}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectScTransitionInfoById" parameterType="Integer" resultMap="ScTransitionInfoResult">
|
||||
<include refid="selectScTransitionInfoVo"/>
|
||||
where id = #{id}
|
||||
</select>
|
||||
|
||||
<insert id="insertScTransitionInfo" parameterType="ScTransitionInfo" useGeneratedKeys="true" keyProperty="id">
|
||||
insert into sc_transition_info
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="sheepId != null">sheep_id,</if>
|
||||
<if test="transTo != null and transTo != ''">trans_to,</if>
|
||||
<if test="transFrom != null and transFrom != ''">trans_from,</if>
|
||||
<if test="transType != null">trans_type,</if>
|
||||
<if test="technician != null and technician != ''">technician,</if>
|
||||
<if test="status != null">status,</if>
|
||||
<if test="comment != null">comment,</if>
|
||||
<if test="createBy != null">create_by,</if>
|
||||
<if test="createTime != null">create_time,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="sheepId != null">#{sheepId},</if>
|
||||
<if test="transTo != null and transTo != ''">#{transTo},</if>
|
||||
<if test="transFrom != null and transFrom != ''">#{transFrom},</if>
|
||||
<if test="transType != null">#{transType},</if>
|
||||
<if test="technician != null and technician != ''">#{technician},</if>
|
||||
<if test="status != null">#{status},</if>
|
||||
<if test="comment != null">#{comment},</if>
|
||||
<if test="createBy != null">#{createBy},</if>
|
||||
<if test="createTime != null">#{createTime},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateScTransitionInfo" parameterType="ScTransitionInfo">
|
||||
update sc_transition_info
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="sheepId != null">sheep_id = #{sheepId},</if>
|
||||
<if test="transTo != null and transTo != ''">trans_to = #{transTo},</if>
|
||||
<if test="transFrom != null and transFrom != ''">trans_from = #{transFrom},</if>
|
||||
<if test="transType != null">trans_type = #{transType},</if>
|
||||
<if test="technician != null and technician != ''">technician = #{technician},</if>
|
||||
<if test="status != null">status = #{status},</if>
|
||||
<if test="comment != null">comment = #{comment},</if>
|
||||
<if test="createBy != null">create_by = #{createBy},</if>
|
||||
<if test="createTime != null">create_time = #{createTime},</if>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<delete id="deleteScTransitionInfoById" parameterType="Integer">
|
||||
delete from sc_transition_info where id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteScTransitionInfoByIds" parameterType="String">
|
||||
delete from sc_transition_info where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
</mapper>
|
@ -1,36 +1,47 @@
|
||||
<?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.produce.mapper.ScCastrateMapper">
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.zhyc.module.produce.other.castrate.mapper.ScCastrateMapper">
|
||||
|
||||
<resultMap type="ScCastrate" id="ScCastrateResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="sheepId" column="sheep_id" />
|
||||
<result property="sheepfold" column="sheepfold" />
|
||||
<result property="comment" column="comment" />
|
||||
<result property="technician" column="technician" />
|
||||
<result property="createBy" column="create_by" />
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="id" column="id"/>
|
||||
<result property="sheepId" column="sheep_id"/>
|
||||
<result property="sheepfold" column="sheepfold"/>
|
||||
<result property="comment" column="comment"/>
|
||||
<result property="technician" column="technician"/>
|
||||
<result property="createBy" column="create_by"/>
|
||||
<result property="createTime" column="create_time"/>
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectScCastrateVo">
|
||||
select id, sheep_id, sheepfold, comment, technician, create_by, create_time from sc_castrate
|
||||
select sc.id,
|
||||
sc.sheep_id,
|
||||
sc.sheepfold,
|
||||
sf.sheepfold_name as sheepfoldName,
|
||||
sc.comment,
|
||||
sc.technician,
|
||||
sc.create_by,
|
||||
sc.create_time
|
||||
from sc_castrate sc
|
||||
left join da_sheepfold sf on sc.sheepfold = sf.id
|
||||
</sql>
|
||||
|
||||
<select id="selectScCastrateList" parameterType="ScCastrate" resultMap="ScCastrateResult">
|
||||
<include refid="selectScCastrateVo"/>
|
||||
<where>
|
||||
<if test="sheepId != null and sheepId != ''"> and sheep_id like concat('%', #{sheepId}, '%')</if>
|
||||
<if test="sheepfold != null "> and sheepfold like concat('%', #{sheepfold}, '%')</if>
|
||||
<if test="technician != null and technician != ''"> and technician like concat('%', #{technician}, '%')</if>
|
||||
<if test="params.beginCreateTime != null and params.beginCreateTime != '' and params.endCreateTime != null and params.endCreateTime != ''"> and create_time between #{params.beginCreateTime} and #{params.endCreateTime}</if>
|
||||
<if test="sheepId != null and sheepId != ''">and sheep_id like concat('%', #{sheepId}, '%')</if>
|
||||
<if test="sheepfold != null ">and sheepfold like concat('%', #{sheepfold}, '%')</if>
|
||||
<if test="technician != null and technician != ''">and technician like concat('%', #{technician}, '%')</if>
|
||||
<if test="params.beginCreateTime != null and params.beginCreateTime != '' and params.endCreateTime != null and params.endCreateTime != ''">
|
||||
and create_time between #{params.beginCreateTime} and #{params.endCreateTime}
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectScCastrateById" parameterType="Long" resultMap="ScCastrateResult">
|
||||
<include refid="selectScCastrateVo"/>
|
||||
where id = #{id}
|
||||
where sc.id = #{id}
|
||||
</select>
|
||||
|
||||
<insert id="insertScCastrate" parameterType="ScCastrate" useGeneratedKeys="true" keyProperty="id">
|
||||
@ -42,7 +53,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<if test="technician != null">technician,</if>
|
||||
<if test="createBy != null">create_by,</if>
|
||||
<if test="createTime != null">create_time,</if>
|
||||
</trim>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="sheepId != null">#{sheepId},</if>
|
||||
<if test="sheepfold != null">#{sheepfold},</if>
|
||||
@ -50,7 +61,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<if test="technician != null">#{technician},</if>
|
||||
<if test="createBy != null">#{createBy},</if>
|
||||
<if test="createTime != null">#{createTime},</if>
|
||||
</trim>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateScCastrate" parameterType="ScCastrate">
|
||||
@ -67,7 +78,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
</update>
|
||||
|
||||
<delete id="deleteScCastrateById" parameterType="Long">
|
||||
delete from sc_castrate where id = #{id}
|
||||
delete
|
||||
from sc_castrate
|
||||
where id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteScCastrateByIds" parameterType="String">
|
@ -0,0 +1,78 @@
|
||||
<?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.produce.other.fixHoof.mapper.ScFixHoofMapper">
|
||||
|
||||
<resultMap type="ScFixHoof" id="ScFixHoofResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="sheepId" column="sheep_id" />
|
||||
<result property="sheepfold" column="sheepfold" />
|
||||
<result property="comment" column="comment" />
|
||||
<result property="technician" column="technician" />
|
||||
<result property="createBy" column="create_by" />
|
||||
<result property="createTime" column="create_time" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectScFixHoofVo">
|
||||
select id, sheep_id, sheepfold, comment, technician, create_by, create_time from sc_fix_hoof
|
||||
</sql>
|
||||
|
||||
<select id="selectScFixHoofList" parameterType="ScFixHoof" resultMap="ScFixHoofResult">
|
||||
<include refid="selectScFixHoofVo"/>
|
||||
<where>
|
||||
<if test="sheepId != null "> and sheep_id = #{sheepId}</if>
|
||||
<if test="sheepfold != null "> and sheepfold = #{sheepfold}</if>
|
||||
<if test="params.beginCreateTime != null and params.beginCreateTime != '' and params.endCreateTime != null and params.endCreateTime != ''"> and create_time between #{params.beginCreateTime} and #{params.endCreateTime}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectScFixHoofById" parameterType="Long" resultMap="ScFixHoofResult">
|
||||
<include refid="selectScFixHoofVo"/>
|
||||
where id = #{id}
|
||||
</select>
|
||||
|
||||
<insert id="insertScFixHoof" parameterType="ScFixHoof" useGeneratedKeys="true" keyProperty="id">
|
||||
insert into sc_fix_hoof
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="sheepId != null">sheep_id,</if>
|
||||
<if test="sheepfold != null">sheepfold,</if>
|
||||
<if test="comment != null">comment,</if>
|
||||
<if test="technician != null and technician != ''">technician,</if>
|
||||
<if test="createBy != null">create_by,</if>
|
||||
<if test="createTime != null">create_time,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="sheepId != null">#{sheepId},</if>
|
||||
<if test="sheepfold != null">#{sheepfold},</if>
|
||||
<if test="comment != null">#{comment},</if>
|
||||
<if test="technician != null and technician != ''">#{technician},</if>
|
||||
<if test="createBy != null">#{createBy},</if>
|
||||
<if test="createTime != null">#{createTime},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateScFixHoof" parameterType="ScFixHoof">
|
||||
update sc_fix_hoof
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="sheepId != null">sheep_id = #{sheepId},</if>
|
||||
<if test="sheepfold != null">sheepfold = #{sheepfold},</if>
|
||||
<if test="comment != null">comment = #{comment},</if>
|
||||
<if test="technician != null and technician != ''">technician = #{technician},</if>
|
||||
<if test="createBy != null">create_by = #{createBy},</if>
|
||||
<if test="createTime != null">create_time = #{createTime},</if>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<delete id="deleteScFixHoofById" parameterType="Long">
|
||||
delete from sc_fix_hoof where id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteScFixHoofByIds" parameterType="String">
|
||||
delete from sc_fix_hoof where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
</mapper>
|
Loading…
x
Reference in New Issue
Block a user