Merge remote-tracking branch 'origin/main'
This commit is contained in:
commit
3af62e205c
@ -183,4 +183,13 @@ public class ScBodyMeasure extends BaseEntity {
|
||||
@Excel(name = "技术员")
|
||||
private String technician;
|
||||
|
||||
/**
|
||||
* 排序字段
|
||||
*/
|
||||
private String orderBy;
|
||||
|
||||
/**
|
||||
* 排序方向
|
||||
*/
|
||||
private String sortDirection;
|
||||
}
|
||||
|
||||
@ -77,4 +77,13 @@ public class ScBodyScore extends BaseEntity {
|
||||
@Excel(name = "技术员")
|
||||
private String technician;
|
||||
|
||||
/**
|
||||
* 排序字段
|
||||
*/
|
||||
private String orderBy;
|
||||
|
||||
/**
|
||||
* 排序方向
|
||||
*/
|
||||
private String sortDirection;
|
||||
}
|
||||
|
||||
@ -110,5 +110,13 @@ public class ScBreastRating extends BaseEntity {
|
||||
@Excel(name = "技术员")
|
||||
private String technician;
|
||||
|
||||
/**
|
||||
* 排序字段
|
||||
*/
|
||||
private String orderBy;
|
||||
|
||||
/**
|
||||
* 排序方向
|
||||
*/
|
||||
private String sortDirection;
|
||||
}
|
||||
|
||||
@ -1,6 +1,7 @@
|
||||
package com.zhyc.module.produce.bodyManage.service.impl;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import com.zhyc.common.utils.DateUtils;
|
||||
import com.zhyc.common.utils.SecurityUtils;
|
||||
|
||||
@ -96,7 +96,7 @@ public class ScAddSheepController {
|
||||
// 根据牧场ID查询牧场信息
|
||||
DaRanch ranch = daRanchService.selectDaRanchById(scAddSheep.getRanchId().longValue());
|
||||
if (ranch != null) {
|
||||
scAddSheep.setRanchName(ranch.getRanch()); // 将牧场名称设置到实体中
|
||||
scAddSheep.setRanchName(ranch.getRanch());
|
||||
}
|
||||
}
|
||||
// 处理羊舍名称
|
||||
|
||||
@ -37,7 +37,6 @@ public class ScAddSheep extends BaseEntity {
|
||||
|
||||
private String sheepfoldName;
|
||||
|
||||
// 导出时生成“羊舍名称”列 ,仅 Excel 用,不映射到数据库
|
||||
@Excel(name = "羊舍名称")
|
||||
private String sheepfoldNameExcel;
|
||||
|
||||
|
||||
@ -1,11 +1,14 @@
|
||||
package com.zhyc.module.produce.manage_sheep.domain;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import com.zhyc.common.annotation.Excel;
|
||||
import com.zhyc.common.core.domain.BaseEntity;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 改备注对象 sc_change_comment
|
||||
*
|
||||
@ -53,5 +56,15 @@ public class ScChangeComment extends BaseEntity {
|
||||
@Excel(name = "原备注")
|
||||
private String oldComment;
|
||||
|
||||
|
||||
/**
|
||||
* 事件日期
|
||||
*/
|
||||
@Excel(name = "事件日期", width = 30, dateFormat = "yyyy-MM-dd")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
private Date eventDate;
|
||||
/**
|
||||
* 技术员
|
||||
*/
|
||||
@Excel(name = "技术员")
|
||||
private String technician;
|
||||
}
|
||||
|
||||
@ -1,57 +1,87 @@
|
||||
package com.zhyc.module.produce.manage_sheep.domain;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import com.zhyc.common.annotation.Excel;
|
||||
import com.zhyc.common.core.domain.BaseEntity;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 修改电子耳号记录对象 sc_change_ear
|
||||
*
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2025-07-24
|
||||
*/
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class ScChangeEar extends BaseEntity
|
||||
{
|
||||
public class ScChangeEar extends BaseEntity {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** id */
|
||||
/**
|
||||
* id
|
||||
*/
|
||||
private Integer id;
|
||||
|
||||
/** 羊只id */
|
||||
/**
|
||||
* 羊只id
|
||||
*/
|
||||
private Long sheepId;
|
||||
|
||||
@Excel(name = "管理耳号")
|
||||
private String manageTags;
|
||||
|
||||
/** 羊舍 */
|
||||
/**
|
||||
* 羊舍
|
||||
*/
|
||||
private Long sheepfoldId;
|
||||
@Excel(name = "羊舍")
|
||||
private String sheepfoldName;
|
||||
|
||||
/** 事件类型(改管理耳号/改电子耳号) */
|
||||
/**
|
||||
* 事件类型(改管理耳号/改电子耳号)
|
||||
*/
|
||||
@Excel(name = "事件类型")
|
||||
private String eventType;
|
||||
|
||||
/** 选择更改耳号类型(0电子耳号1管理耳号) */
|
||||
/**
|
||||
* 选择更改耳号类型(0电子耳号1管理耳号)
|
||||
*/
|
||||
@Excel(name = "耳号类型", readConverterExp = "0=电子耳号,1=管理耳号")
|
||||
private Integer earType;
|
||||
|
||||
/** 新耳号/电子耳号 */
|
||||
/**
|
||||
* 新耳号/电子耳号
|
||||
*/
|
||||
@Excel(name = "新耳号/电子耳号")
|
||||
private String newTag;
|
||||
|
||||
/** 旧耳号/电子耳号 */
|
||||
/**
|
||||
* 旧耳号/电子耳号
|
||||
*/
|
||||
@Excel(name = "旧耳号/电子耳号")
|
||||
private String oldTag;
|
||||
|
||||
/** 备注 */
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
@Excel(name = "备注")
|
||||
private String comment;
|
||||
|
||||
/**
|
||||
* 事件日期
|
||||
*/
|
||||
@Excel(name = "事件日期", width = 30, dateFormat = "yyyy-MM-dd")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
private Date eventDate;
|
||||
|
||||
/**
|
||||
* 技术员
|
||||
*/
|
||||
@Excel(name = "技术员")
|
||||
private String technician;
|
||||
|
||||
}
|
||||
|
||||
@ -1,6 +1,7 @@
|
||||
package com.zhyc.module.produce.manage_sheep.domain;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
@ -10,26 +11,31 @@ import com.zhyc.common.core.domain.BaseEntity;
|
||||
|
||||
/**
|
||||
* 改品种记录对象 sc_change_variety
|
||||
*
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2025-07-24
|
||||
*/
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class ScChangeVariety extends BaseEntity
|
||||
{
|
||||
public class ScChangeVariety extends BaseEntity {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** $column.columnComment */
|
||||
/**
|
||||
* $column.columnComment
|
||||
*/
|
||||
private Integer id;
|
||||
|
||||
/** 羊只id */
|
||||
/**
|
||||
* 羊只id
|
||||
*/
|
||||
private Integer sheepId;
|
||||
@Excel(name = "耳号")
|
||||
private String manageTags;
|
||||
|
||||
/** 羊舍 */
|
||||
/**
|
||||
* 羊舍
|
||||
*/
|
||||
private Long sheepfoldId;
|
||||
@Excel(name = "羊舍")
|
||||
private String sheepfoldName;
|
||||
@ -40,17 +46,35 @@ public class ScChangeVariety extends BaseEntity
|
||||
@Excel(name = "事件类型")
|
||||
private String eventType;
|
||||
|
||||
/** 原品种 */
|
||||
/**
|
||||
* 原品种
|
||||
*/
|
||||
@Excel(name = "原品种")
|
||||
private String varietyOld;
|
||||
|
||||
/** 新品种 */
|
||||
/**
|
||||
* 新品种
|
||||
*/
|
||||
@Excel(name = "新品种")
|
||||
private String varietyNew;
|
||||
|
||||
/** 备注 */
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
@Excel(name = "备注")
|
||||
private String comment;
|
||||
|
||||
/**
|
||||
* 技术员
|
||||
*/
|
||||
@Excel(name = "技术员")
|
||||
private String technician;
|
||||
|
||||
/**
|
||||
* 事件日期
|
||||
*/
|
||||
@Excel(name = "事件日期",width = 30, dateFormat = "yyyy-MM-dd")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
private Date eventDate;
|
||||
|
||||
}
|
||||
|
||||
@ -4,6 +4,7 @@ import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
import com.zhyc.common.utils.SecurityUtils;
|
||||
import com.zhyc.common.utils.StringUtils;
|
||||
import com.zhyc.module.base.domain.BasSheep;
|
||||
import com.zhyc.module.base.service.IBasSheepService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
@ -61,6 +62,12 @@ public class ScChangeCommentServiceImpl implements IScChangeCommentService
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
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.setCreateBy(SecurityUtils.getUsername());
|
||||
int rows = scChangeCommentMapper.insertScChangeComment(scChangeComment);
|
||||
|
||||
@ -3,6 +3,7 @@ package com.zhyc.module.produce.manage_sheep.service.impl;
|
||||
import java.util.List;
|
||||
import com.zhyc.common.utils.DateUtils;
|
||||
import com.zhyc.common.utils.SecurityUtils;
|
||||
import com.zhyc.common.utils.StringUtils;
|
||||
import com.zhyc.module.base.domain.BasSheep;
|
||||
import com.zhyc.module.base.service.IBasSheepService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
@ -81,11 +82,18 @@ public class ScChangeEarServiceImpl implements IScChangeEarService
|
||||
public int insertScChangeEar(ScChangeEar scChangeEar) {
|
||||
scChangeEar.setCreateTime(DateUtils.getNowDate());
|
||||
scChangeEar.setCreateBy(SecurityUtils.getUsername());
|
||||
|
||||
// 在新增时,确保旧耳号被正确设置为原始耳号的值
|
||||
if (StringUtils.isBlank(scChangeEar.getTechnician())) {
|
||||
throw new RuntimeException("技术员不能为空");
|
||||
}
|
||||
if (scChangeEar.getEventDate() == null) {
|
||||
throw new RuntimeException("事件日期不能为空");
|
||||
}
|
||||
if (scChangeEar.getSheepId() == null) {
|
||||
throw new RuntimeException("未找到对应的羊只ID");
|
||||
}
|
||||
if (StringUtils.isBlank(scChangeEar.getComment())) {
|
||||
throw new RuntimeException("备注不能为空");
|
||||
}
|
||||
|
||||
BasSheep sheep = basSheepService.selectBasSheepById(scChangeEar.getSheepId());
|
||||
if (sheep == null) {
|
||||
@ -113,8 +121,13 @@ public class ScChangeEarServiceImpl implements IScChangeEarService
|
||||
} else if (scChangeEar.getEarType() == 1) {
|
||||
sheep.setManageTags(scChangeEar.getNewTag());
|
||||
}
|
||||
basSheepService.updateBasSheep(sheep);
|
||||
|
||||
// 同步更新羊只主表备注
|
||||
if (StringUtils.isNotBlank(scChangeEar.getComment())) {
|
||||
sheep.setComment(scChangeEar.getComment());
|
||||
}
|
||||
|
||||
basSheepService.updateBasSheep(sheep);
|
||||
return rows;
|
||||
}
|
||||
|
||||
|
||||
@ -4,6 +4,7 @@ import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
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.BasSheepVariety;
|
||||
import com.zhyc.module.base.service.IBasSheepService;
|
||||
@ -66,6 +67,14 @@ public class ScChangeVarietyServiceImpl implements IScChangeVarietyService
|
||||
{
|
||||
scChangeVariety.setCreateTime(new Date());
|
||||
scChangeVariety.setCreateBy(SecurityUtils.getUsername());
|
||||
|
||||
if (StringUtils.isBlank(scChangeVariety.getTechnician())) {
|
||||
throw new RuntimeException("技术员不能为空");
|
||||
}
|
||||
if (scChangeVariety.getEventDate() == null) {
|
||||
throw new RuntimeException("事件日期不能为空");
|
||||
}
|
||||
|
||||
int rows = scChangeVarietyMapper.insertScChangeVariety(scChangeVariety);
|
||||
if (rows <= 0) {
|
||||
return rows;
|
||||
|
||||
@ -87,7 +87,6 @@ public class ScTransGroupServiceImpl implements IScTransGroupService {
|
||||
}
|
||||
}
|
||||
return rows;
|
||||
// return scTransGroupMapper.insertScTransGroup(scTransGroup);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@ -114,9 +114,9 @@ public class ScTransitionInfoServiceImpl implements IScTransitionInfoService
|
||||
Date now = DateUtils.getNowDate();
|
||||
|
||||
for (ScTransitionInfo info : transitionInfoList) {
|
||||
info.setCreateBy(username); // 设置创建人
|
||||
info.setCreateTime(now); // 设置创建时间
|
||||
info.setStatus(0); // 设置默认状态
|
||||
info.setCreateBy(username);
|
||||
info.setCreateTime(now);
|
||||
info.setStatus(0);
|
||||
}
|
||||
return scTransitionInfoMapper.insertScTransitionInfoBatch(transitionInfoList);
|
||||
}
|
||||
@ -127,12 +127,10 @@ public class ScTransitionInfoServiceImpl implements IScTransitionInfoService
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public int approveScTransitionInfo(ScTransitionInfo scTransitionInfo) {
|
||||
// 1. 查询当前记录的原始状态
|
||||
ScTransitionInfo existing = scTransitionInfoMapper.selectScTransitionInfoById(scTransitionInfo.getId());
|
||||
if (existing == null) {
|
||||
throw new RuntimeException("转场记录不存在");
|
||||
}
|
||||
// 2. 校验状态:仅允许审批“待审批”的记录
|
||||
if (existing.getStatus() != 0) {
|
||||
throw new RuntimeException("该记录已完成审批,无法重复操作");
|
||||
}
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
package com.zhyc.module.produce.other.domain;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
@ -64,7 +65,12 @@ public class ScCastrate extends BaseEntity {
|
||||
@Excel(name = "技术员")
|
||||
private String technician;
|
||||
|
||||
|
||||
/**
|
||||
* 事件日期
|
||||
*/
|
||||
@Excel(name = "事件日期", width = 15, dateFormat = "yyyy-MM-dd")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
private String eventDate;
|
||||
|
||||
|
||||
}
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
package com.zhyc.module.produce.other.domain;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
@ -55,4 +56,10 @@ public class ScFixHoof extends BaseEntity
|
||||
@Excel(name = "技术员")
|
||||
private String technician;
|
||||
|
||||
/**
|
||||
* 事件日期(新增字段)
|
||||
*/
|
||||
@Excel(name = "事件日期", width = 15, dateFormat = "yyyy-MM-dd")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
private String eventDate;
|
||||
}
|
||||
|
||||
@ -102,7 +102,30 @@
|
||||
and sm.create_time between #{params.beginCreateTime} and #{params.endCreateTime}
|
||||
</if>
|
||||
</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 id="selectScBodyMeasureById" parameterType="Long" resultMap="ScBodyMeasureResult">
|
||||
|
||||
@ -58,7 +58,12 @@
|
||||
and bs.manage_tags like concat('%', #{manageTags}, '%')
|
||||
</if>
|
||||
</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 id="selectScBodyScoreById" parameterType="Long" resultMap="ScBodyScoreResult">
|
||||
|
||||
@ -56,7 +56,13 @@
|
||||
and sbr.create_time between #{params.beginCreateTime} and #{params.endCreateTime}
|
||||
</if>
|
||||
</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 id="selectScBreastRatingById" parameterType="Long" resultMap="ScBreastRatingResult">
|
||||
|
||||
@ -14,6 +14,8 @@
|
||||
<result property="oldComment" column="old_comment"/>
|
||||
<result property="createBy" column="create_by"/>
|
||||
<result property="createTime" column="create_time"/>
|
||||
<result property="eventDate" column="event_date"/>
|
||||
<result property="technician" column="technician"/>
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectScChangeCommentVo">
|
||||
@ -25,7 +27,9 @@
|
||||
scc.new_comment,
|
||||
scc.old_comment,
|
||||
scc.create_by,
|
||||
scc.create_time
|
||||
scc.create_time,
|
||||
scc.event_date,
|
||||
scc.technician
|
||||
from sc_change_comment scc
|
||||
left join bas_sheep bs on scc.sheep_id = bs.id
|
||||
left join da_sheepfold sf on bs.sheepfold_id = sf.id
|
||||
@ -48,6 +52,10 @@
|
||||
and params.endCreateTime != null and params.endCreateTime != ''">
|
||||
and scc.create_time between #{params.beginCreateTime} and #{params.endCreateTime}
|
||||
</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>
|
||||
ORDER BY scc.create_time DESC
|
||||
</select>
|
||||
@ -65,6 +73,8 @@
|
||||
<if test="oldComment != null and oldComment != ''">old_comment,</if>
|
||||
<if test="createBy != null">create_by,</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 prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="sheepId != null and sheepId != ''">#{sheepId},</if>
|
||||
@ -72,6 +82,8 @@
|
||||
<if test="oldComment != null and oldComment != ''">#{oldComment},</if>
|
||||
<if test="createBy != null">#{createBy},</if>
|
||||
<if test="createTime != null">#{createTime},</if>
|
||||
<if test="eventDate != null">#{eventDate},</if>
|
||||
<if test="technician != null and technician != ''">#{technician},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
|
||||
@ -16,24 +16,28 @@
|
||||
<result property="comment" column="comment"/>
|
||||
<result property="createBy" column="create_by"/>
|
||||
<result property="createTime" column="create_time"/>
|
||||
<result property="eventDate" column="event_date"/>
|
||||
<result property="technician" column="technician"/>
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectScChangeEarVo">
|
||||
select sce.id as sce_id,
|
||||
select sce.id as sce_id,
|
||||
sce.sheep_id,
|
||||
bs.manage_tags as manage_tags,
|
||||
bs.manage_tags as manage_tags,
|
||||
sf.sheepfold_name as sheepfold_name,
|
||||
case
|
||||
when sce.ear_type = 0 then '改电子耳号'
|
||||
when sce.ear_type = 1 then '改管理耳号'
|
||||
else ''
|
||||
end as event_type,
|
||||
end as event_type,
|
||||
sce.ear_type,
|
||||
sce.newTag,
|
||||
sce.oldTag as oldTag,
|
||||
sce.oldTag as oldTag,
|
||||
sce.comment,
|
||||
sce.create_by,
|
||||
sce.create_time
|
||||
sce.create_time,
|
||||
sce.event_date,
|
||||
sce.technician
|
||||
from sc_change_ear sce
|
||||
LEFT JOIN bas_sheep bs ON sce.sheep_id = bs.id
|
||||
LEFT JOIN da_sheepfold sf ON bs.sheepfold_id = sf.id
|
||||
@ -44,7 +48,11 @@
|
||||
<where>
|
||||
<if test="sheepId != null">and sce.sheep_id = #{sheepId}</if>
|
||||
<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 test="sheepfoldId != null">and bs.sheepfold_id = #{sheepfoldId}</if>
|
||||
<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 != ''">
|
||||
and sce.create_time between #{params.beginCreateTime} and #{params.endCreateTime}
|
||||
</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>
|
||||
ORDER BY sce.create_time DESC
|
||||
</select>
|
||||
@ -79,6 +91,8 @@
|
||||
<if test="comment != null">comment,</if>
|
||||
<if test="createBy != null">create_by,</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 prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="sheepId != null">#{sheepId},</if>
|
||||
@ -88,6 +102,8 @@
|
||||
<if test="comment != null">#{comment},</if>
|
||||
<if test="createBy != null">#{createBy},</if>
|
||||
<if test="createTime != null">#{createTime},</if>
|
||||
<if test="eventDate != null">#{eventDate},</if>
|
||||
<if test="technician != null and technician != ''">#{technician},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
|
||||
@ -15,6 +15,8 @@
|
||||
<result property="comment" column="comment"/>
|
||||
<result property="createBy" column="create_by"/>
|
||||
<result property="createTime" column="create_time"/>
|
||||
<result property="technician" column="technician"/>
|
||||
<result property="eventDate" column="event_date"/>
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectScChangeVarietyVo">
|
||||
@ -27,7 +29,9 @@
|
||||
scv.variety_new,
|
||||
scv.comment,
|
||||
scv.create_by,
|
||||
scv.create_time
|
||||
scv.create_time,
|
||||
scv.technician,
|
||||
scv.event_date
|
||||
from sc_change_variety scv
|
||||
left join bas_sheep bs on scv.sheep_id = bs.id
|
||||
left join da_sheepfold sf on bs.sheepfold_id = sf.id
|
||||
@ -51,6 +55,10 @@
|
||||
and params.endCreateTime != null and params.endCreateTime != ''">
|
||||
and scv.create_time between #{params.beginCreateTime} and #{params.endCreateTime}
|
||||
</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>
|
||||
ORDER BY scv.create_time DESC
|
||||
</select>
|
||||
@ -69,6 +77,8 @@
|
||||
<if test="comment != null">comment,</if>
|
||||
<if test="createBy != null">create_by,</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 prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="sheepId != null">#{sheepId},</if>
|
||||
@ -77,6 +87,8 @@
|
||||
<if test="comment != null">#{comment},</if>
|
||||
<if test="createBy != null">#{createBy},</if>
|
||||
<if test="createTime != null">#{createTime},</if>
|
||||
<if test="technician != null and technician != ''">#{technician},</if> <!-- 新增 -->
|
||||
<if test="eventDate != null">#{eventDate},</if> <!-- 新增 -->
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
|
||||
@ -58,7 +58,7 @@
|
||||
<if test="manageTags != null and manageTags != ''">
|
||||
and s.manage_tags like concat('%', #{manageTags}, '%')
|
||||
</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 != ''">
|
||||
and tg.trans_date between #{params.beginTransDate} and #{params.endTransDate}
|
||||
</if>
|
||||
@ -67,9 +67,9 @@
|
||||
<if test="status != null">and status = #{status}</if>
|
||||
<if test="varietyId != null">and tg.variety_id = #{varietyId}</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 != ''">
|
||||
and tg.create_time between #{params.beginCreateTime} and #{params.endCreateTime}
|
||||
</if>
|
||||
<!-- <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}-->
|
||||
<!-- </if>-->
|
||||
</where>
|
||||
ORDER BY tg.create_time DESC
|
||||
</select>
|
||||
|
||||
@ -51,9 +51,9 @@
|
||||
<if test="manageTags != null and manageTags != ''">
|
||||
and bs.manage_tags LIKE CONCAT('%', #{manageTags}, '%')
|
||||
</if>
|
||||
<if test="eventType != null and eventType != ''">
|
||||
and t.event_type = #{eventType}
|
||||
</if>
|
||||
<!-- <if test="eventType != null and eventType != ''">-->
|
||||
<!-- and t.event_type = #{eventType}-->
|
||||
<!-- </if>-->
|
||||
<if test="transType != null">and t.trans_type = #{transType}</if>
|
||||
<if test="params.beginTransitionDate != null and params.beginTransitionDate != ''
|
||||
and params.endTransitionDate != null and params.endTransitionDate != ''">
|
||||
@ -63,9 +63,9 @@
|
||||
<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 t.create_time between #{params.beginCreateTime} and #{params.endCreateTime}
|
||||
</if>
|
||||
<!-- <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}-->
|
||||
<!-- </if>-->
|
||||
</where>
|
||||
ORDER BY t.create_time DESC
|
||||
</select>
|
||||
|
||||
@ -17,6 +17,7 @@
|
||||
<result property="technician" column="technician"/>
|
||||
<result property="createBy" column="create_by"/>
|
||||
<result property="createTime" column="create_time"/>
|
||||
<result property="eventDate" column="eventDate"/>
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectScCastrateVo">
|
||||
@ -31,7 +32,8 @@
|
||||
sc.comment,
|
||||
sc.technician,
|
||||
sc.create_by,
|
||||
sc.create_time
|
||||
sc.create_time,
|
||||
sc.event_date as eventDate
|
||||
from sc_castrate sc
|
||||
left join bas_sheep bs on sc.sheep_id = bs.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">
|
||||
and sc.create_time between #{params.beginCreateTime} and #{params.endCreateTime}
|
||||
</if>
|
||||
<if test="params.beginEventDate != null and params.endEventDate != null">
|
||||
and sc.event_date between #{params.beginEventDate} and #{params.endEventDate}
|
||||
</if>
|
||||
</where>
|
||||
ORDER BY sc.create_time DESC
|
||||
</select>
|
||||
@ -70,6 +75,7 @@
|
||||
<if test="technician != null">technician,</if>
|
||||
<if test="createBy != null">create_by,</if>
|
||||
<if test="createTime != null">create_time,</if>
|
||||
<if test="eventDate != null">event_date,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="sheepId != null">#{sheepId},</if>
|
||||
@ -79,6 +85,7 @@
|
||||
<if test="technician != null">#{technician},</if>
|
||||
<if test="createBy != null">#{createBy},</if>
|
||||
<if test="createTime != null">#{createTime},</if>
|
||||
<if test="eventDate != null">#{eventDate},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
|
||||
@ -15,6 +15,7 @@
|
||||
<result property="technician" column="technician"/>
|
||||
<result property="createBy" column="create_by"/>
|
||||
<result property="createTime" column="create_time"/>
|
||||
<result property="eventDate" column="eventDate"/>
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectScFixHoofVo">
|
||||
@ -28,7 +29,8 @@
|
||||
fh.comment,
|
||||
fh.technician,
|
||||
fh.create_by,
|
||||
fh.create_time
|
||||
fh.create_time,
|
||||
fh.event_date as eventDate
|
||||
from sc_fix_hoof fh
|
||||
left join bas_sheep bs on fh.sheep_id = bs.id
|
||||
left join da_sheepfold sf on bs.sheepfold_id = sf.id
|
||||
@ -47,6 +49,10 @@
|
||||
<if test="manageTags != null and manageTags != ''">
|
||||
and bs.manage_tags like concat('%', #{manageTags}, '%')
|
||||
</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>
|
||||
ORDER BY fh.create_time DESC
|
||||
</select>
|
||||
@ -64,6 +70,7 @@
|
||||
variety_id,
|
||||
<if test="comment != null">comment,</if>
|
||||
<if test="technician != null and technician != ''">technician,</if>
|
||||
<if test="eventDate != null and eventDate != ''">event_date,</if>
|
||||
create_by,
|
||||
create_time)
|
||||
VALUES
|
||||
@ -72,6 +79,7 @@
|
||||
<if test="varietyId != null">#{varietyId},</if>
|
||||
<if test="comment != null">#{comment},</if>
|
||||
<if test="technician != null and technician != ''">#{technician},</if>
|
||||
<if test="eventDate != null and eventDate != ''">#{eventDate},</if>
|
||||
#{createBy},
|
||||
#{createTime})
|
||||
</insert>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user