子模块引入
This commit is contained in:
@@ -2,14 +2,21 @@
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<parent>
|
||||
<groupId>zhyc</groupId>
|
||||
<artifactId>zhyc</artifactId>
|
||||
<version>3.8.9</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<artifactId>zhyc-module</artifactId>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>zhyc</groupId>
|
||||
<artifactId>zhyc-common</artifactId>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
</project>
|
||||
@@ -0,0 +1,105 @@
|
||||
package com.zhyc.module.produce.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 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-09
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/produce/castrate")
|
||||
public class ScCastrateController extends BaseController
|
||||
{
|
||||
@Autowired
|
||||
private IScCastrateService scCastrateService;
|
||||
|
||||
/**
|
||||
* 查询去势列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('produce:castrate:list')")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(ScCastrate scCastrate)
|
||||
{
|
||||
startPage();
|
||||
List<ScCastrate> list = scCastrateService.selectScCastrateList(scCastrate);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出去势列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('produce:castrate:export')")
|
||||
@Log(title = "去势", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, ScCastrate scCastrate)
|
||||
{
|
||||
List<ScCastrate> list = scCastrateService.selectScCastrateList(scCastrate);
|
||||
ExcelUtil<ScCastrate> util = new ExcelUtil<ScCastrate>(ScCastrate.class);
|
||||
util.exportExcel(response, list, "去势数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取去势详细信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('produce:castrate:query')")
|
||||
@GetMapping(value = "/{id}")
|
||||
public AjaxResult getInfo(@PathVariable("id") Long id)
|
||||
{
|
||||
return success(scCastrateService.selectScCastrateById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增去势
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('produce:castrate:add')")
|
||||
@Log(title = "去势", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody ScCastrate scCastrate)
|
||||
{
|
||||
return toAjax(scCastrateService.insertScCastrate(scCastrate));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改去势
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('produce:castrate:edit')")
|
||||
@Log(title = "去势", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody ScCastrate scCastrate)
|
||||
{
|
||||
return toAjax(scCastrateService.updateScCastrate(scCastrate));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除去势
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('produce:castrate:remove')")
|
||||
@Log(title = "去势", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public AjaxResult remove(@PathVariable Long[] ids)
|
||||
{
|
||||
return toAjax(scCastrateService.deleteScCastrateByIds(ids));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,99 @@
|
||||
package com.zhyc.module.produce.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 */
|
||||
@Excel(name = "羊舍id")
|
||||
private Long sheepfold;
|
||||
|
||||
/** 备注 */
|
||||
@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;
|
||||
}
|
||||
|
||||
@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();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,61 @@
|
||||
package com.zhyc.module.produce.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import com.zhyc.module.produce.domain.ScCastrate;
|
||||
|
||||
/**
|
||||
* 去势Mapper接口
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2025-07-09
|
||||
*/
|
||||
public interface ScCastrateMapper
|
||||
{
|
||||
/**
|
||||
* 查询去势
|
||||
*
|
||||
* @param id 去势主键
|
||||
* @return 去势
|
||||
*/
|
||||
public ScCastrate selectScCastrateById(Long id);
|
||||
|
||||
/**
|
||||
* 查询去势列表
|
||||
*
|
||||
* @param scCastrate 去势
|
||||
* @return 去势集合
|
||||
*/
|
||||
public List<ScCastrate> selectScCastrateList(ScCastrate scCastrate);
|
||||
|
||||
/**
|
||||
* 新增去势
|
||||
*
|
||||
* @param scCastrate 去势
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertScCastrate(ScCastrate scCastrate);
|
||||
|
||||
/**
|
||||
* 修改去势
|
||||
*
|
||||
* @param scCastrate 去势
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateScCastrate(ScCastrate scCastrate);
|
||||
|
||||
/**
|
||||
* 删除去势
|
||||
*
|
||||
* @param id 去势主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteScCastrateById(Long id);
|
||||
|
||||
/**
|
||||
* 批量删除去势
|
||||
*
|
||||
* @param ids 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteScCastrateByIds(Long[] ids);
|
||||
}
|
||||
@@ -0,0 +1,61 @@
|
||||
package com.zhyc.module.produce.service;
|
||||
|
||||
import java.util.List;
|
||||
import com.zhyc.module.produce.domain.ScCastrate;
|
||||
|
||||
/**
|
||||
* 去势Service接口
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2025-07-09
|
||||
*/
|
||||
public interface IScCastrateService
|
||||
{
|
||||
/**
|
||||
* 查询去势
|
||||
*
|
||||
* @param id 去势主键
|
||||
* @return 去势
|
||||
*/
|
||||
public ScCastrate selectScCastrateById(Long id);
|
||||
|
||||
/**
|
||||
* 查询去势列表
|
||||
*
|
||||
* @param scCastrate 去势
|
||||
* @return 去势集合
|
||||
*/
|
||||
public List<ScCastrate> selectScCastrateList(ScCastrate scCastrate);
|
||||
|
||||
/**
|
||||
* 新增去势
|
||||
*
|
||||
* @param scCastrate 去势
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertScCastrate(ScCastrate scCastrate);
|
||||
|
||||
/**
|
||||
* 修改去势
|
||||
*
|
||||
* @param scCastrate 去势
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateScCastrate(ScCastrate scCastrate);
|
||||
|
||||
/**
|
||||
* 批量删除去势
|
||||
*
|
||||
* @param ids 需要删除的去势主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteScCastrateByIds(Long[] ids);
|
||||
|
||||
/**
|
||||
* 删除去势信息
|
||||
*
|
||||
* @param id 去势主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteScCastrateById(Long id);
|
||||
}
|
||||
@@ -0,0 +1,95 @@
|
||||
package com.zhyc.module.produce.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 org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* 去势Service业务层处理
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2025-07-09
|
||||
*/
|
||||
@Service
|
||||
public class ScCastrateServiceImpl implements IScCastrateService
|
||||
{
|
||||
@Autowired
|
||||
private ScCastrateMapper scCastrateMapper;
|
||||
|
||||
/**
|
||||
* 查询去势
|
||||
*
|
||||
* @param id 去势主键
|
||||
* @return 去势
|
||||
*/
|
||||
@Override
|
||||
public ScCastrate selectScCastrateById(Long id)
|
||||
{
|
||||
return scCastrateMapper.selectScCastrateById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询去势列表
|
||||
*
|
||||
* @param scCastrate 去势
|
||||
* @return 去势
|
||||
*/
|
||||
@Override
|
||||
public List<ScCastrate> selectScCastrateList(ScCastrate scCastrate)
|
||||
{
|
||||
return scCastrateMapper.selectScCastrateList(scCastrate);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增去势
|
||||
*
|
||||
* @param scCastrate 去势
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertScCastrate(ScCastrate scCastrate)
|
||||
{
|
||||
scCastrate.setCreateTime(DateUtils.getNowDate());
|
||||
return scCastrateMapper.insertScCastrate(scCastrate);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改去势
|
||||
*
|
||||
* @param scCastrate 去势
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateScCastrate(ScCastrate scCastrate)
|
||||
{
|
||||
return scCastrateMapper.updateScCastrate(scCastrate);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除去势
|
||||
*
|
||||
* @param ids 需要删除的去势主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteScCastrateByIds(Long[] ids)
|
||||
{
|
||||
return scCastrateMapper.deleteScCastrateByIds(ids);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除去势信息
|
||||
*
|
||||
* @param id 去势主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteScCastrateById(Long id)
|
||||
{
|
||||
return scCastrateMapper.deleteScCastrateById(id);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,79 @@
|
||||
<?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">
|
||||
|
||||
<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" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectScCastrateVo">
|
||||
select id, sheep_id, sheepfold, comment, technician, create_by, create_time from sc_castrate
|
||||
</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>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectScCastrateById" parameterType="Long" resultMap="ScCastrateResult">
|
||||
<include refid="selectScCastrateVo"/>
|
||||
where id = #{id}
|
||||
</select>
|
||||
|
||||
<insert id="insertScCastrate" parameterType="ScCastrate" useGeneratedKeys="true" keyProperty="id">
|
||||
insert into sc_castrate
|
||||
<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">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">#{technician},</if>
|
||||
<if test="createBy != null">#{createBy},</if>
|
||||
<if test="createTime != null">#{createTime},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateScCastrate" parameterType="ScCastrate">
|
||||
update sc_castrate
|
||||
<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">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="deleteScCastrateById" parameterType="Long">
|
||||
delete from sc_castrate where id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteScCastrateByIds" parameterType="String">
|
||||
delete from sc_castrate where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
</mapper>
|
||||
Reference in New Issue
Block a user