Merge remote-tracking branch 'origin/main'

This commit is contained in:
漂泊 2025-10-28 17:18:12 +08:00
commit 3af62e205c
26 changed files with 277 additions and 56 deletions

View File

@ -183,4 +183,13 @@ public class ScBodyMeasure extends BaseEntity {
@Excel(name = "技术员") @Excel(name = "技术员")
private String technician; private String technician;
/**
* 排序字段
*/
private String orderBy;
/**
* 排序方向
*/
private String sortDirection;
} }

View File

@ -77,4 +77,13 @@ public class ScBodyScore extends BaseEntity {
@Excel(name = "技术员") @Excel(name = "技术员")
private String technician; private String technician;
/**
* 排序字段
*/
private String orderBy;
/**
* 排序方向
*/
private String sortDirection;
} }

View File

@ -110,5 +110,13 @@ public class ScBreastRating extends BaseEntity {
@Excel(name = "技术员") @Excel(name = "技术员")
private String technician; private String technician;
/**
* 排序字段
*/
private String orderBy;
/**
* 排序方向
*/
private String sortDirection;
} }

View File

@ -1,6 +1,7 @@
package com.zhyc.module.produce.bodyManage.service.impl; package com.zhyc.module.produce.bodyManage.service.impl;
import java.util.List; import java.util.List;
import java.util.Map;
import com.zhyc.common.utils.DateUtils; import com.zhyc.common.utils.DateUtils;
import com.zhyc.common.utils.SecurityUtils; import com.zhyc.common.utils.SecurityUtils;

View File

@ -96,7 +96,7 @@ public class ScAddSheepController {
// 根据牧场ID查询牧场信息 // 根据牧场ID查询牧场信息
DaRanch ranch = daRanchService.selectDaRanchById(scAddSheep.getRanchId().longValue()); DaRanch ranch = daRanchService.selectDaRanchById(scAddSheep.getRanchId().longValue());
if (ranch != null) { if (ranch != null) {
scAddSheep.setRanchName(ranch.getRanch()); // 将牧场名称设置到实体中 scAddSheep.setRanchName(ranch.getRanch());
} }
} }
// 处理羊舍名称 // 处理羊舍名称

View File

@ -37,7 +37,6 @@ public class ScAddSheep extends BaseEntity {
private String sheepfoldName; private String sheepfoldName;
// 导出时生成羊舍名称 Excel 不映射到数据库
@Excel(name = "羊舍名称") @Excel(name = "羊舍名称")
private String sheepfoldNameExcel; private String sheepfoldNameExcel;

View File

@ -1,11 +1,14 @@
package com.zhyc.module.produce.manage_sheep.domain; package com.zhyc.module.produce.manage_sheep.domain;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import lombok.Data; import lombok.Data;
import lombok.NoArgsConstructor; import lombok.NoArgsConstructor;
import com.zhyc.common.annotation.Excel; import com.zhyc.common.annotation.Excel;
import com.zhyc.common.core.domain.BaseEntity; import com.zhyc.common.core.domain.BaseEntity;
import java.util.Date;
/** /**
* 改备注对象 sc_change_comment * 改备注对象 sc_change_comment
* *
@ -53,5 +56,15 @@ public class ScChangeComment extends BaseEntity {
@Excel(name = "原备注") @Excel(name = "原备注")
private String oldComment; private String oldComment;
/**
* 事件日期
*/
@Excel(name = "事件日期", width = 30, dateFormat = "yyyy-MM-dd")
@JsonFormat(pattern = "yyyy-MM-dd")
private Date eventDate;
/**
* 技术员
*/
@Excel(name = "技术员")
private String technician;
} }

View File

@ -1,57 +1,87 @@
package com.zhyc.module.produce.manage_sheep.domain; package com.zhyc.module.produce.manage_sheep.domain;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import lombok.Data; import lombok.Data;
import lombok.NoArgsConstructor; import lombok.NoArgsConstructor;
import com.zhyc.common.annotation.Excel; import com.zhyc.common.annotation.Excel;
import com.zhyc.common.core.domain.BaseEntity; import com.zhyc.common.core.domain.BaseEntity;
import java.util.Date;
/** /**
* 修改电子耳号记录对象 sc_change_ear * 修改电子耳号记录对象 sc_change_ear
* *
* @author ruoyi * @author ruoyi
* @date 2025-07-24 * @date 2025-07-24
*/ */
@Data @Data
@AllArgsConstructor @AllArgsConstructor
@NoArgsConstructor @NoArgsConstructor
public class ScChangeEar extends BaseEntity public class ScChangeEar extends BaseEntity {
{
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
/** id */ /**
* id
*/
private Integer id; private Integer id;
/** 羊只id */ /**
* 羊只id
*/
private Long sheepId; private Long sheepId;
@Excel(name = "管理耳号") @Excel(name = "管理耳号")
private String manageTags; private String manageTags;
/** 羊舍 */ /**
* 羊舍
*/
private Long sheepfoldId; private Long sheepfoldId;
@Excel(name = "羊舍") @Excel(name = "羊舍")
private String sheepfoldName; private String sheepfoldName;
/** 事件类型(改管理耳号/改电子耳号) */ /**
* 事件类型改管理耳号/改电子耳号
*/
@Excel(name = "事件类型") @Excel(name = "事件类型")
private String eventType; private String eventType;
/** 选择更改耳号类型0电子耳号1管理耳号 */ /**
* 选择更改耳号类型0电子耳号1管理耳号
*/
@Excel(name = "耳号类型", readConverterExp = "0=电子耳号,1=管理耳号") @Excel(name = "耳号类型", readConverterExp = "0=电子耳号,1=管理耳号")
private Integer earType; private Integer earType;
/** 新耳号/电子耳号 */ /**
* 新耳号/电子耳号
*/
@Excel(name = "新耳号/电子耳号") @Excel(name = "新耳号/电子耳号")
private String newTag; private String newTag;
/** 旧耳号/电子耳号 */ /**
* 旧耳号/电子耳号
*/
@Excel(name = "旧耳号/电子耳号") @Excel(name = "旧耳号/电子耳号")
private String oldTag; private String oldTag;
/** 备注 */ /**
* 备注
*/
@Excel(name = "备注") @Excel(name = "备注")
private String comment; private String comment;
/**
* 事件日期
*/
@Excel(name = "事件日期", width = 30, dateFormat = "yyyy-MM-dd")
@JsonFormat(pattern = "yyyy-MM-dd")
private Date eventDate;
/**
* 技术员
*/
@Excel(name = "技术员")
private String technician;
} }

View File

@ -1,6 +1,7 @@
package com.zhyc.module.produce.manage_sheep.domain; package com.zhyc.module.produce.manage_sheep.domain;
import java.util.Date; import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import lombok.Data; import lombok.Data;
@ -10,26 +11,31 @@ import com.zhyc.common.core.domain.BaseEntity;
/** /**
* 改品种记录对象 sc_change_variety * 改品种记录对象 sc_change_variety
* *
* @author ruoyi * @author ruoyi
* @date 2025-07-24 * @date 2025-07-24
*/ */
@Data @Data
@AllArgsConstructor @AllArgsConstructor
@NoArgsConstructor @NoArgsConstructor
public class ScChangeVariety extends BaseEntity public class ScChangeVariety extends BaseEntity {
{
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
/** $column.columnComment */ /**
* $column.columnComment
*/
private Integer id; private Integer id;
/** 羊只id */ /**
* 羊只id
*/
private Integer sheepId; private Integer sheepId;
@Excel(name = "耳号") @Excel(name = "耳号")
private String manageTags; private String manageTags;
/** 羊舍 */ /**
* 羊舍
*/
private Long sheepfoldId; private Long sheepfoldId;
@Excel(name = "羊舍") @Excel(name = "羊舍")
private String sheepfoldName; private String sheepfoldName;
@ -40,17 +46,35 @@ public class ScChangeVariety extends BaseEntity
@Excel(name = "事件类型") @Excel(name = "事件类型")
private String eventType; private String eventType;
/** 原品种 */ /**
* 原品种
*/
@Excel(name = "原品种") @Excel(name = "原品种")
private String varietyOld; private String varietyOld;
/** 新品种 */ /**
* 新品种
*/
@Excel(name = "新品种") @Excel(name = "新品种")
private String varietyNew; private String varietyNew;
/** 备注 */ /**
* 备注
*/
@Excel(name = "备注") @Excel(name = "备注")
private String comment; private String comment;
/**
* 技术员
*/
@Excel(name = "技术员")
private String technician;
/**
* 事件日期
*/
@Excel(name = "事件日期",width = 30, dateFormat = "yyyy-MM-dd")
@JsonFormat(pattern = "yyyy-MM-dd")
private Date eventDate;
} }

View File

@ -4,6 +4,7 @@ import java.util.Date;
import java.util.List; import java.util.List;
import com.zhyc.common.utils.SecurityUtils; import com.zhyc.common.utils.SecurityUtils;
import com.zhyc.common.utils.StringUtils;
import com.zhyc.module.base.domain.BasSheep; import com.zhyc.module.base.domain.BasSheep;
import com.zhyc.module.base.service.IBasSheepService; import com.zhyc.module.base.service.IBasSheepService;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
@ -61,6 +62,12 @@ public class ScChangeCommentServiceImpl implements IScChangeCommentService
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
public int insertScChangeComment(ScChangeComment scChangeComment) public int insertScChangeComment(ScChangeComment scChangeComment)
{ {
if (StringUtils.isBlank(scChangeComment.getTechnician())) {
throw new RuntimeException("技术员不能为空");
}
if (scChangeComment.getEventDate() == null) {
throw new RuntimeException("事件日期不能为空");
}
scChangeComment.setCreateTime(new Date()); scChangeComment.setCreateTime(new Date());
scChangeComment.setCreateBy(SecurityUtils.getUsername()); scChangeComment.setCreateBy(SecurityUtils.getUsername());
int rows = scChangeCommentMapper.insertScChangeComment(scChangeComment); int rows = scChangeCommentMapper.insertScChangeComment(scChangeComment);

View File

@ -3,6 +3,7 @@ package com.zhyc.module.produce.manage_sheep.service.impl;
import java.util.List; import java.util.List;
import com.zhyc.common.utils.DateUtils; import com.zhyc.common.utils.DateUtils;
import com.zhyc.common.utils.SecurityUtils; import com.zhyc.common.utils.SecurityUtils;
import com.zhyc.common.utils.StringUtils;
import com.zhyc.module.base.domain.BasSheep; import com.zhyc.module.base.domain.BasSheep;
import com.zhyc.module.base.service.IBasSheepService; import com.zhyc.module.base.service.IBasSheepService;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
@ -81,11 +82,18 @@ public class ScChangeEarServiceImpl implements IScChangeEarService
public int insertScChangeEar(ScChangeEar scChangeEar) { public int insertScChangeEar(ScChangeEar scChangeEar) {
scChangeEar.setCreateTime(DateUtils.getNowDate()); scChangeEar.setCreateTime(DateUtils.getNowDate());
scChangeEar.setCreateBy(SecurityUtils.getUsername()); scChangeEar.setCreateBy(SecurityUtils.getUsername());
if (StringUtils.isBlank(scChangeEar.getTechnician())) {
// 在新增时确保旧耳号被正确设置为原始耳号的值 throw new RuntimeException("技术员不能为空");
}
if (scChangeEar.getEventDate() == null) {
throw new RuntimeException("事件日期不能为空");
}
if (scChangeEar.getSheepId() == null) { if (scChangeEar.getSheepId() == null) {
throw new RuntimeException("未找到对应的羊只ID"); throw new RuntimeException("未找到对应的羊只ID");
} }
if (StringUtils.isBlank(scChangeEar.getComment())) {
throw new RuntimeException("备注不能为空");
}
BasSheep sheep = basSheepService.selectBasSheepById(scChangeEar.getSheepId()); BasSheep sheep = basSheepService.selectBasSheepById(scChangeEar.getSheepId());
if (sheep == null) { if (sheep == null) {
@ -113,8 +121,13 @@ public class ScChangeEarServiceImpl implements IScChangeEarService
} else if (scChangeEar.getEarType() == 1) { } else if (scChangeEar.getEarType() == 1) {
sheep.setManageTags(scChangeEar.getNewTag()); sheep.setManageTags(scChangeEar.getNewTag());
} }
basSheepService.updateBasSheep(sheep);
// 同步更新羊只主表备注
if (StringUtils.isNotBlank(scChangeEar.getComment())) {
sheep.setComment(scChangeEar.getComment());
}
basSheepService.updateBasSheep(sheep);
return rows; return rows;
} }

View File

@ -4,6 +4,7 @@ import java.util.Date;
import java.util.List; import java.util.List;
import com.zhyc.common.utils.SecurityUtils; import com.zhyc.common.utils.SecurityUtils;
import com.zhyc.common.utils.StringUtils;
import com.zhyc.module.base.domain.BasSheep; import com.zhyc.module.base.domain.BasSheep;
import com.zhyc.module.base.domain.BasSheepVariety; import com.zhyc.module.base.domain.BasSheepVariety;
import com.zhyc.module.base.service.IBasSheepService; import com.zhyc.module.base.service.IBasSheepService;
@ -66,6 +67,14 @@ public class ScChangeVarietyServiceImpl implements IScChangeVarietyService
{ {
scChangeVariety.setCreateTime(new Date()); scChangeVariety.setCreateTime(new Date());
scChangeVariety.setCreateBy(SecurityUtils.getUsername()); scChangeVariety.setCreateBy(SecurityUtils.getUsername());
if (StringUtils.isBlank(scChangeVariety.getTechnician())) {
throw new RuntimeException("技术员不能为空");
}
if (scChangeVariety.getEventDate() == null) {
throw new RuntimeException("事件日期不能为空");
}
int rows = scChangeVarietyMapper.insertScChangeVariety(scChangeVariety); int rows = scChangeVarietyMapper.insertScChangeVariety(scChangeVariety);
if (rows <= 0) { if (rows <= 0) {
return rows; return rows;

View File

@ -87,7 +87,6 @@ public class ScTransGroupServiceImpl implements IScTransGroupService {
} }
} }
return rows; return rows;
// return scTransGroupMapper.insertScTransGroup(scTransGroup);
} }
/** /**

View File

@ -114,9 +114,9 @@ public class ScTransitionInfoServiceImpl implements IScTransitionInfoService
Date now = DateUtils.getNowDate(); Date now = DateUtils.getNowDate();
for (ScTransitionInfo info : transitionInfoList) { for (ScTransitionInfo info : transitionInfoList) {
info.setCreateBy(username); // 设置创建人 info.setCreateBy(username);
info.setCreateTime(now); // 设置创建时间 info.setCreateTime(now);
info.setStatus(0); // 设置默认状态 info.setStatus(0);
} }
return scTransitionInfoMapper.insertScTransitionInfoBatch(transitionInfoList); return scTransitionInfoMapper.insertScTransitionInfoBatch(transitionInfoList);
} }
@ -127,12 +127,10 @@ public class ScTransitionInfoServiceImpl implements IScTransitionInfoService
@Override @Override
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
public int approveScTransitionInfo(ScTransitionInfo scTransitionInfo) { public int approveScTransitionInfo(ScTransitionInfo scTransitionInfo) {
// 1. 查询当前记录的原始状态
ScTransitionInfo existing = scTransitionInfoMapper.selectScTransitionInfoById(scTransitionInfo.getId()); ScTransitionInfo existing = scTransitionInfoMapper.selectScTransitionInfoById(scTransitionInfo.getId());
if (existing == null) { if (existing == null) {
throw new RuntimeException("转场记录不存在"); throw new RuntimeException("转场记录不存在");
} }
// 2. 校验状态仅允许审批待审批的记录
if (existing.getStatus() != 0) { if (existing.getStatus() != 0) {
throw new RuntimeException("该记录已完成审批,无法重复操作"); throw new RuntimeException("该记录已完成审批,无法重复操作");
} }

View File

@ -1,5 +1,6 @@
package com.zhyc.module.produce.other.domain; package com.zhyc.module.produce.other.domain;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import lombok.Data; import lombok.Data;
import lombok.NoArgsConstructor; import lombok.NoArgsConstructor;
@ -64,7 +65,12 @@ public class ScCastrate extends BaseEntity {
@Excel(name = "技术员") @Excel(name = "技术员")
private String technician; private String technician;
/**
* 事件日期
*/
@Excel(name = "事件日期", width = 15, dateFormat = "yyyy-MM-dd")
@JsonFormat(pattern = "yyyy-MM-dd")
private String eventDate;
} }

View File

@ -1,5 +1,6 @@
package com.zhyc.module.produce.other.domain; package com.zhyc.module.produce.other.domain;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import lombok.Data; import lombok.Data;
import lombok.NoArgsConstructor; import lombok.NoArgsConstructor;
@ -55,4 +56,10 @@ public class ScFixHoof extends BaseEntity
@Excel(name = "技术员") @Excel(name = "技术员")
private String technician; private String technician;
/**
* 事件日期新增字段
*/
@Excel(name = "事件日期", width = 15, dateFormat = "yyyy-MM-dd")
@JsonFormat(pattern = "yyyy-MM-dd")
private String eventDate;
} }

View File

@ -102,7 +102,30 @@
and sm.create_time between #{params.beginCreateTime} and #{params.endCreateTime} and sm.create_time between #{params.beginCreateTime} and #{params.endCreateTime}
</if> </if>
</where> </where>
ORDER BY sm.create_time DESC <if test="orderBy != null and orderBy != '' and sortDirection != null and sortDirection != ''">
ORDER BY
<choose>
<when test="orderBy == 'weaningWeight'">bs.weaning_weight</when>
<when test="orderBy == 'bodyLength'">sm.body_length</when>
<when test="orderBy == 'birthWeight'">bs.birth_weight</when>
<when test="orderBy == 'currentWeight'">bs.current_weight</when>
<when test="orderBy == 'lactationDay'">bs.lactation_day</when>
<when test="orderBy == 'gestationDay'">bs.gestation_day</when>
<when test="orderBy == 'postMatingDay'">post_mating_day</when>
<when test="orderBy == 'parity'">bs.parity</when>
<when test="orderBy == 'height'">sm.height</when>
<when test="orderBy == 'bust'">sm.bust</when>
<when test="orderBy == 'pipeLength'">sm.pipe_length</when>
<when test="orderBy == 'chestDepth'">sm.chest_depth</when>
<when test="orderBy == 'hipHeight'">sm.hip_height</when>
<when test="orderBy == 'rumpWidth'">sm.rump_width</when>
<when test="orderBy == 'rumpHeignt'">sm.rump_heignt</when>
<when test="orderBy == 'hipWidth'">sm.hip_width</when>
<when test="orderBy == 'hipCrossHeight'">sm.hip_cross_height</when>
<otherwise>${orderBy}</otherwise>
</choose>
${sortDirection}
</if>
</select> </select>
<select id="selectScBodyMeasureById" parameterType="Long" resultMap="ScBodyMeasureResult"> <select id="selectScBodyMeasureById" parameterType="Long" resultMap="ScBodyMeasureResult">

View File

@ -58,7 +58,12 @@
and bs.manage_tags like concat('%', #{manageTags}, '%') and bs.manage_tags like concat('%', #{manageTags}, '%')
</if> </if>
</where> </where>
ORDER BY sbs.create_time DESC <if test="orderBy != null and orderBy != '' and sortDirection != null and sortDirection != ''">
ORDER BY sbs.${orderBy} ${sortDirection}
</if>
<if test="(orderBy == null or orderBy == '') or (sortDirection == null or sortDirection == '')">
ORDER BY sbs.create_time DESC
</if>
</select> </select>
<select id="selectScBodyScoreById" parameterType="Long" resultMap="ScBodyScoreResult"> <select id="selectScBodyScoreById" parameterType="Long" resultMap="ScBodyScoreResult">

View File

@ -56,7 +56,13 @@
and sbr.create_time between #{params.beginCreateTime} and #{params.endCreateTime} and sbr.create_time between #{params.beginCreateTime} and #{params.endCreateTime}
</if> </if>
</where> </where>
ORDER BY sbr.create_time DESC <if test="orderBy != null and orderBy != '' and sortDirection != null and sortDirection != ''">
ORDER BY sbr.${orderBy} ${sortDirection}
</if>
<if test="(orderBy == null or orderBy == '') or (sortDirection == null or sortDirection == '')">
ORDER BY sbr.create_time DESC
</if>
</select> </select>
<select id="selectScBreastRatingById" parameterType="Long" resultMap="ScBreastRatingResult"> <select id="selectScBreastRatingById" parameterType="Long" resultMap="ScBreastRatingResult">

View File

@ -14,6 +14,8 @@
<result property="oldComment" column="old_comment"/> <result property="oldComment" column="old_comment"/>
<result property="createBy" column="create_by"/> <result property="createBy" column="create_by"/>
<result property="createTime" column="create_time"/> <result property="createTime" column="create_time"/>
<result property="eventDate" column="event_date"/>
<result property="technician" column="technician"/>
</resultMap> </resultMap>
<sql id="selectScChangeCommentVo"> <sql id="selectScChangeCommentVo">
@ -25,7 +27,9 @@
scc.new_comment, scc.new_comment,
scc.old_comment, scc.old_comment,
scc.create_by, scc.create_by,
scc.create_time scc.create_time,
scc.event_date,
scc.technician
from sc_change_comment scc from sc_change_comment scc
left join bas_sheep bs on scc.sheep_id = bs.id left join bas_sheep bs on scc.sheep_id = bs.id
left join da_sheepfold sf on bs.sheepfold_id = sf.id left join da_sheepfold sf on bs.sheepfold_id = sf.id
@ -48,6 +52,10 @@
and params.endCreateTime != null and params.endCreateTime != ''"> and params.endCreateTime != null and params.endCreateTime != ''">
and scc.create_time between #{params.beginCreateTime} and #{params.endCreateTime} and scc.create_time between #{params.beginCreateTime} and #{params.endCreateTime}
</if> </if>
<if test="params.beginEventDate != null and params.beginEventDate != ''
and params.endEventDate != null and params.endEventDate != ''">
and scc.event_date between #{params.beginEventDate} and #{params.endEventDate}
</if>
</where> </where>
ORDER BY scc.create_time DESC ORDER BY scc.create_time DESC
</select> </select>
@ -65,6 +73,8 @@
<if test="oldComment != null and oldComment != ''">old_comment,</if> <if test="oldComment != null and oldComment != ''">old_comment,</if>
<if test="createBy != null">create_by,</if> <if test="createBy != null">create_by,</if>
<if test="createTime != null">create_time,</if> <if test="createTime != null">create_time,</if>
<if test="eventDate != null">event_date,</if>
<if test="technician != null and technician != ''">technician,</if>
</trim> </trim>
<trim prefix="values (" suffix=")" suffixOverrides=","> <trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="sheepId != null and sheepId != ''">#{sheepId},</if> <if test="sheepId != null and sheepId != ''">#{sheepId},</if>
@ -72,6 +82,8 @@
<if test="oldComment != null and oldComment != ''">#{oldComment},</if> <if test="oldComment != null and oldComment != ''">#{oldComment},</if>
<if test="createBy != null">#{createBy},</if> <if test="createBy != null">#{createBy},</if>
<if test="createTime != null">#{createTime},</if> <if test="createTime != null">#{createTime},</if>
<if test="eventDate != null">#{eventDate},</if>
<if test="technician != null and technician != ''">#{technician},</if>
</trim> </trim>
</insert> </insert>

View File

@ -16,24 +16,28 @@
<result property="comment" column="comment"/> <result property="comment" column="comment"/>
<result property="createBy" column="create_by"/> <result property="createBy" column="create_by"/>
<result property="createTime" column="create_time"/> <result property="createTime" column="create_time"/>
<result property="eventDate" column="event_date"/>
<result property="technician" column="technician"/>
</resultMap> </resultMap>
<sql id="selectScChangeEarVo"> <sql id="selectScChangeEarVo">
select sce.id as sce_id, select sce.id as sce_id,
sce.sheep_id, sce.sheep_id,
bs.manage_tags as manage_tags, bs.manage_tags as manage_tags,
sf.sheepfold_name as sheepfold_name, sf.sheepfold_name as sheepfold_name,
case case
when sce.ear_type = 0 then '改电子耳号' when sce.ear_type = 0 then '改电子耳号'
when sce.ear_type = 1 then '改管理耳号' when sce.ear_type = 1 then '改管理耳号'
else '' else ''
end as event_type, end as event_type,
sce.ear_type, sce.ear_type,
sce.newTag, sce.newTag,
sce.oldTag as oldTag, sce.oldTag as oldTag,
sce.comment, sce.comment,
sce.create_by, sce.create_by,
sce.create_time sce.create_time,
sce.event_date,
sce.technician
from sc_change_ear sce from sc_change_ear sce
LEFT JOIN bas_sheep bs ON sce.sheep_id = bs.id LEFT JOIN bas_sheep bs ON sce.sheep_id = bs.id
LEFT JOIN da_sheepfold sf ON bs.sheepfold_id = sf.id LEFT JOIN da_sheepfold sf ON bs.sheepfold_id = sf.id
@ -44,7 +48,11 @@
<where> <where>
<if test="sheepId != null">and sce.sheep_id = #{sheepId}</if> <if test="sheepId != null">and sce.sheep_id = #{sheepId}</if>
<if test="manageTags != null and manageTags != ''"> <if test="manageTags != null and manageTags != ''">
and bs.manage_tags LIKE CONCAT('%', #{manageTags}, '%') and (
bs.manage_tags LIKE CONCAT('%', #{manageTags}, '%')
OR
bs.electronic_tags LIKE CONCAT('%', #{manageTags}, '%')
)
</if> </if>
<if test="sheepfoldId != null">and bs.sheepfold_id = #{sheepfoldId}</if> <if test="sheepfoldId != null">and bs.sheepfold_id = #{sheepfoldId}</if>
<if test="sheepfoldName != null and sheepfoldName != ''"> <if test="sheepfoldName != null and sheepfoldName != ''">
@ -60,6 +68,10 @@
<if test="params.beginCreateTime != null and params.beginCreateTime != '' and params.endCreateTime != null and params.endCreateTime != ''"> <if test="params.beginCreateTime != null and params.beginCreateTime != '' and params.endCreateTime != null and params.endCreateTime != ''">
and sce.create_time between #{params.beginCreateTime} and #{params.endCreateTime} and sce.create_time between #{params.beginCreateTime} and #{params.endCreateTime}
</if> </if>
<if test="params.beginEventDate != null and params.beginEventDate != ''
and params.endEventDate != null and params.endEventDate != ''">
and sce.event_date between #{params.beginEventDate} and #{params.endEventDate}
</if>
</where> </where>
ORDER BY sce.create_time DESC ORDER BY sce.create_time DESC
</select> </select>
@ -79,6 +91,8 @@
<if test="comment != null">comment,</if> <if test="comment != null">comment,</if>
<if test="createBy != null">create_by,</if> <if test="createBy != null">create_by,</if>
<if test="createTime != null">create_time,</if> <if test="createTime != null">create_time,</if>
<if test="eventDate != null">event_date,</if>
<if test="technician != null and technician != ''">technician,</if>
</trim> </trim>
<trim prefix="values (" suffix=")" suffixOverrides=","> <trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="sheepId != null">#{sheepId},</if> <if test="sheepId != null">#{sheepId},</if>
@ -88,6 +102,8 @@
<if test="comment != null">#{comment},</if> <if test="comment != null">#{comment},</if>
<if test="createBy != null">#{createBy},</if> <if test="createBy != null">#{createBy},</if>
<if test="createTime != null">#{createTime},</if> <if test="createTime != null">#{createTime},</if>
<if test="eventDate != null">#{eventDate},</if>
<if test="technician != null and technician != ''">#{technician},</if>
</trim> </trim>
</insert> </insert>

View File

@ -15,6 +15,8 @@
<result property="comment" column="comment"/> <result property="comment" column="comment"/>
<result property="createBy" column="create_by"/> <result property="createBy" column="create_by"/>
<result property="createTime" column="create_time"/> <result property="createTime" column="create_time"/>
<result property="technician" column="technician"/>
<result property="eventDate" column="event_date"/>
</resultMap> </resultMap>
<sql id="selectScChangeVarietyVo"> <sql id="selectScChangeVarietyVo">
@ -27,7 +29,9 @@
scv.variety_new, scv.variety_new,
scv.comment, scv.comment,
scv.create_by, scv.create_by,
scv.create_time scv.create_time,
scv.technician,
scv.event_date
from sc_change_variety scv from sc_change_variety scv
left join bas_sheep bs on scv.sheep_id = bs.id left join bas_sheep bs on scv.sheep_id = bs.id
left join da_sheepfold sf on bs.sheepfold_id = sf.id left join da_sheepfold sf on bs.sheepfold_id = sf.id
@ -51,6 +55,10 @@
and params.endCreateTime != null and params.endCreateTime != ''"> and params.endCreateTime != null and params.endCreateTime != ''">
and scv.create_time between #{params.beginCreateTime} and #{params.endCreateTime} and scv.create_time between #{params.beginCreateTime} and #{params.endCreateTime}
</if> </if>
<if test="params.beginEventDate != null and params.beginEventDate != ''
and params.endEventDate != null and params.endEventDate != ''">
and scv.event_date between #{params.beginEventDate} and #{params.endEventDate}
</if>
</where> </where>
ORDER BY scv.create_time DESC ORDER BY scv.create_time DESC
</select> </select>
@ -69,6 +77,8 @@
<if test="comment != null">comment,</if> <if test="comment != null">comment,</if>
<if test="createBy != null">create_by,</if> <if test="createBy != null">create_by,</if>
<if test="createTime != null">create_time,</if> <if test="createTime != null">create_time,</if>
<if test="technician != null and technician != ''">technician,</if> <!-- 新增 -->
<if test="eventDate != null">event_date,</if> <!-- 新增 -->
</trim> </trim>
<trim prefix="values (" suffix=")" suffixOverrides=","> <trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="sheepId != null">#{sheepId},</if> <if test="sheepId != null">#{sheepId},</if>
@ -77,6 +87,8 @@
<if test="comment != null">#{comment},</if> <if test="comment != null">#{comment},</if>
<if test="createBy != null">#{createBy},</if> <if test="createBy != null">#{createBy},</if>
<if test="createTime != null">#{createTime},</if> <if test="createTime != null">#{createTime},</if>
<if test="technician != null and technician != ''">#{technician},</if> <!-- 新增 -->
<if test="eventDate != null">#{eventDate},</if> <!-- 新增 -->
</trim> </trim>
</insert> </insert>

View File

@ -58,7 +58,7 @@
<if test="manageTags != null and manageTags != ''"> <if test="manageTags != null and manageTags != ''">
and s.manage_tags like concat('%', #{manageTags}, '%') and s.manage_tags like concat('%', #{manageTags}, '%')
</if> </if>
<if test="eventType != null">and tg.event_type = #{eventType}</if> <!-- <if test="eventType != null">and tg.event_type = #{eventType}</if>-->
<if test="params.beginTransDate != null and params.beginTransDate != '' and params.endTransDate != null and params.endTransDate != ''"> <if test="params.beginTransDate != null and params.beginTransDate != '' and params.endTransDate != null and params.endTransDate != ''">
and tg.trans_date between #{params.beginTransDate} and #{params.endTransDate} and tg.trans_date between #{params.beginTransDate} and #{params.endTransDate}
</if> </if>
@ -67,9 +67,9 @@
<if test="status != null">and status = #{status}</if> <if test="status != null">and status = #{status}</if>
<if test="varietyId != null">and tg.variety_id = #{varietyId}</if> <if test="varietyId != null">and tg.variety_id = #{varietyId}</if>
<if test="sheepTypeId != null">and st.id = #{sheepTypeId}</if> <if test="sheepTypeId != null">and st.id = #{sheepTypeId}</if>
<if test="params.beginCreateTime != null and params.beginCreateTime != '' and params.endCreateTime != null and params.endCreateTime != ''"> <!-- <if test="params.beginCreateTime != null and params.beginCreateTime != '' and params.endCreateTime != null and params.endCreateTime != ''">-->
and tg.create_time between #{params.beginCreateTime} and #{params.endCreateTime} <!-- and tg.create_time between #{params.beginCreateTime} and #{params.endCreateTime}-->
</if> <!-- </if>-->
</where> </where>
ORDER BY tg.create_time DESC ORDER BY tg.create_time DESC
</select> </select>

View File

@ -51,9 +51,9 @@
<if test="manageTags != null and manageTags != ''"> <if test="manageTags != null and manageTags != ''">
and bs.manage_tags LIKE CONCAT('%', #{manageTags}, '%') and bs.manage_tags LIKE CONCAT('%', #{manageTags}, '%')
</if> </if>
<if test="eventType != null and eventType != ''"> <!-- <if test="eventType != null and eventType != ''">-->
and t.event_type = #{eventType} <!-- and t.event_type = #{eventType}-->
</if> <!-- </if>-->
<if test="transType != null">and t.trans_type = #{transType}</if> <if test="transType != null">and t.trans_type = #{transType}</if>
<if test="params.beginTransitionDate != null and params.beginTransitionDate != '' <if test="params.beginTransitionDate != null and params.beginTransitionDate != ''
and params.endTransitionDate != null and params.endTransitionDate != ''"> and params.endTransitionDate != null and params.endTransitionDate != ''">
@ -63,9 +63,9 @@
<if test="transTo != null and transTo != ''">and trans_to = #{transTo}</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="transFrom != null and transFrom != ''">and trans_from = #{transFrom}</if>
<if test="status != null ">and status = #{status}</if> <if test="status != null ">and status = #{status}</if>
<if test="params.beginCreateTime != null and params.beginCreateTime != '' and params.endCreateTime != null and params.endCreateTime != ''"> <!-- <if test="params.beginCreateTime != null and params.beginCreateTime != '' and params.endCreateTime != null and params.endCreateTime != ''">-->
and t.create_time between #{params.beginCreateTime} and #{params.endCreateTime} <!-- and t.create_time between #{params.beginCreateTime} and #{params.endCreateTime}-->
</if> <!-- </if>-->
</where> </where>
ORDER BY t.create_time DESC ORDER BY t.create_time DESC
</select> </select>

View File

@ -17,6 +17,7 @@
<result property="technician" column="technician"/> <result property="technician" column="technician"/>
<result property="createBy" column="create_by"/> <result property="createBy" column="create_by"/>
<result property="createTime" column="create_time"/> <result property="createTime" column="create_time"/>
<result property="eventDate" column="eventDate"/>
</resultMap> </resultMap>
<sql id="selectScCastrateVo"> <sql id="selectScCastrateVo">
@ -31,7 +32,8 @@
sc.comment, sc.comment,
sc.technician, sc.technician,
sc.create_by, sc.create_by,
sc.create_time sc.create_time,
sc.event_date as eventDate
from sc_castrate sc from sc_castrate sc
left join bas_sheep bs on sc.sheep_id = bs.id left join bas_sheep bs on sc.sheep_id = bs.id
left join da_sheepfold sf on bs.sheepfold_id = sf.id left join da_sheepfold sf on bs.sheepfold_id = sf.id
@ -51,6 +53,9 @@
<if test="params.beginCreateTime != null and params.endCreateTime != null"> <if test="params.beginCreateTime != null and params.endCreateTime != null">
and sc.create_time between #{params.beginCreateTime} and #{params.endCreateTime} and sc.create_time between #{params.beginCreateTime} and #{params.endCreateTime}
</if> </if>
<if test="params.beginEventDate != null and params.endEventDate != null">
and sc.event_date between #{params.beginEventDate} and #{params.endEventDate}
</if>
</where> </where>
ORDER BY sc.create_time DESC ORDER BY sc.create_time DESC
</select> </select>
@ -70,6 +75,7 @@
<if test="technician != null">technician,</if> <if test="technician != null">technician,</if>
<if test="createBy != null">create_by,</if> <if test="createBy != null">create_by,</if>
<if test="createTime != null">create_time,</if> <if test="createTime != null">create_time,</if>
<if test="eventDate != null">event_date,</if>
</trim> </trim>
<trim prefix="values (" suffix=")" suffixOverrides=","> <trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="sheepId != null">#{sheepId},</if> <if test="sheepId != null">#{sheepId},</if>
@ -79,6 +85,7 @@
<if test="technician != null">#{technician},</if> <if test="technician != null">#{technician},</if>
<if test="createBy != null">#{createBy},</if> <if test="createBy != null">#{createBy},</if>
<if test="createTime != null">#{createTime},</if> <if test="createTime != null">#{createTime},</if>
<if test="eventDate != null">#{eventDate},</if>
</trim> </trim>
</insert> </insert>

View File

@ -15,6 +15,7 @@
<result property="technician" column="technician"/> <result property="technician" column="technician"/>
<result property="createBy" column="create_by"/> <result property="createBy" column="create_by"/>
<result property="createTime" column="create_time"/> <result property="createTime" column="create_time"/>
<result property="eventDate" column="eventDate"/>
</resultMap> </resultMap>
<sql id="selectScFixHoofVo"> <sql id="selectScFixHoofVo">
@ -28,7 +29,8 @@
fh.comment, fh.comment,
fh.technician, fh.technician,
fh.create_by, fh.create_by,
fh.create_time fh.create_time,
fh.event_date as eventDate
from sc_fix_hoof fh from sc_fix_hoof fh
left join bas_sheep bs on fh.sheep_id = bs.id left join bas_sheep bs on fh.sheep_id = bs.id
left join da_sheepfold sf on bs.sheepfold_id = sf.id left join da_sheepfold sf on bs.sheepfold_id = sf.id
@ -47,6 +49,10 @@
<if test="manageTags != null and manageTags != ''"> <if test="manageTags != null and manageTags != ''">
and bs.manage_tags like concat('%', #{manageTags}, '%') and bs.manage_tags like concat('%', #{manageTags}, '%')
</if> </if>
<if test="params.beginEventDate != null and params.beginEventDate != ''
and params.endEventDate != null and params.endEventDate != ''">
and fh.event_date between #{params.beginEventDate} and #{params.endEventDate}
</if>
</where> </where>
ORDER BY fh.create_time DESC ORDER BY fh.create_time DESC
</select> </select>
@ -64,6 +70,7 @@
variety_id, variety_id,
<if test="comment != null">comment,</if> <if test="comment != null">comment,</if>
<if test="technician != null and technician != ''">technician,</if> <if test="technician != null and technician != ''">technician,</if>
<if test="eventDate != null and eventDate != ''">event_date,</if>
create_by, create_by,
create_time) create_time)
VALUES VALUES
@ -72,6 +79,7 @@
<if test="varietyId != null">#{varietyId},</if> <if test="varietyId != null">#{varietyId},</if>
<if test="comment != null">#{comment},</if> <if test="comment != null">#{comment},</if>
<if test="technician != null and technician != ''">#{technician},</if> <if test="technician != null and technician != ''">#{technician},</if>
<if test="eventDate != null and eventDate != ''">#{eventDate},</if>
#{createBy}, #{createBy},
#{createTime}) #{createTime})
</insert> </insert>