Merge remote-tracking branch 'origin/main'
This commit is contained in:
@@ -6,9 +6,9 @@ spring:
|
||||
druid:
|
||||
# 主库数据源
|
||||
master:
|
||||
# url: jdbc:mysql://localhost:3306/zhyc?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
|
||||
# username: root
|
||||
# password: 123456
|
||||
# url: jdbc:mysql://146.56.214.124:3306/zhyc?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
|
||||
# username: zhyc
|
||||
# password: zhyc1234
|
||||
url: jdbc:mysql://118.182.97.76:3306/zhyc?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
|
||||
username: zhyc
|
||||
password: yszh123
|
||||
|
||||
@@ -133,7 +133,9 @@ public class BasSheepController extends BaseController {
|
||||
|
||||
// 查询所有存在的羊只
|
||||
List<BasSheep> existingSheep = basSheepService.selectBasSheepByManageTagsList(validTags);
|
||||
|
||||
if (validTags.size() == 1 && existingSheep.size() == 1) {
|
||||
return success(existingSheep.get(0)); //直接返回羊只对象
|
||||
}
|
||||
Set<String> existingTagSet = existingSheep.stream()
|
||||
.map(BasSheep::getManageTags)
|
||||
.collect(Collectors.toSet());
|
||||
|
||||
@@ -26,6 +26,7 @@ public class Deworm extends BaseEntity
|
||||
|
||||
/** $column.columnComment */
|
||||
private Long id;
|
||||
private Long[] ids;
|
||||
|
||||
private Long sheepId;
|
||||
|
||||
|
||||
@@ -26,9 +26,10 @@ public class Diagnosis extends BaseEntity
|
||||
|
||||
/** $column.columnComment */
|
||||
private Long id;
|
||||
private Long[] ids;
|
||||
|
||||
/** 治疗记录id */
|
||||
@Excel(name = "治疗记录")
|
||||
// @Excel(name = "治疗记录")
|
||||
private Long treatId;
|
||||
private Integer[] treatIds;
|
||||
/** 时间日期 */
|
||||
|
||||
@@ -25,6 +25,7 @@ public class Disinfect extends BaseEntity
|
||||
|
||||
/** id */
|
||||
private Long id;
|
||||
private Long[] ids;
|
||||
|
||||
/** 羊舍id */
|
||||
@Excel(name = "羊舍")
|
||||
@@ -43,12 +44,12 @@ public class Disinfect extends BaseEntity
|
||||
@Excel(name = "技术员")
|
||||
private String technician;
|
||||
|
||||
/** 消毒方式 */
|
||||
@Excel(name = "消毒方式")
|
||||
/** 消毒方式:0喷雾 1撒布 2浸泡 3熏蒸 4其他 */
|
||||
@Excel(name = "消毒方式", readConverterExp = "0=喷雾,1=撒布,2=浸泡,3=熏蒸,4=其他")
|
||||
private String way;
|
||||
|
||||
/** 药品使用记录id */
|
||||
@Excel(name = "药品使用记录id")
|
||||
// @Excel(name = "药品使用记录id")
|
||||
private Integer usageId;
|
||||
|
||||
/** 比例 */
|
||||
|
||||
@@ -22,6 +22,7 @@ public class Health extends BaseEntity
|
||||
|
||||
/** $column.columnComment */
|
||||
private Long id;
|
||||
private Long[] ids;
|
||||
|
||||
/** 保健日期 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
@@ -57,7 +58,7 @@ public class Health extends BaseEntity
|
||||
private Long parity;
|
||||
|
||||
/** 用药记录 */
|
||||
@Excel(name = "用药记录")
|
||||
// @Excel(name = "用药记录")
|
||||
private Integer usageId;
|
||||
|
||||
|
||||
|
||||
@@ -26,6 +26,7 @@ public class Immunity extends BaseEntity
|
||||
|
||||
/** $column.columnComment */
|
||||
private Long id;
|
||||
private Long[] ids;
|
||||
|
||||
/** 羊只id */
|
||||
private Long sheepId;
|
||||
@@ -59,7 +60,7 @@ public class Immunity extends BaseEntity
|
||||
private Long parity;
|
||||
|
||||
/** 使用记录 */
|
||||
@Excel(name = "使用记录")
|
||||
// @Excel(name = "使用记录")
|
||||
private Integer usageId;
|
||||
|
||||
|
||||
|
||||
@@ -28,6 +28,7 @@ public class SwMedicineUsage extends BaseEntity
|
||||
|
||||
/** id */
|
||||
private Integer id;
|
||||
private Long[] ids;
|
||||
|
||||
/** 使用名称 */
|
||||
@Excel(name = "使用名称",width = 20, needMerge = true)
|
||||
|
||||
@@ -26,6 +26,7 @@ public class Treatment extends BaseEntity
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
private Long id;
|
||||
private Long[] ids;
|
||||
|
||||
/** 诊疗记录id */
|
||||
private Long diagId;
|
||||
|
||||
@@ -0,0 +1,74 @@
|
||||
package com.zhyc.module.biosafety.enums;
|
||||
|
||||
/**
|
||||
* 消毒方式枚举
|
||||
*/
|
||||
public enum DisinfectionMethod {
|
||||
|
||||
SPRAY(0, "喷雾"),
|
||||
SCATTER(1, "撒布"),
|
||||
SOAK(2, "浸泡"),
|
||||
FUMIGATE(3, "熏蒸"),
|
||||
OTHER(4, "其他");
|
||||
|
||||
private final int code;
|
||||
private final String desc;
|
||||
|
||||
DisinfectionMethod(int code, String desc) {
|
||||
this.code = code;
|
||||
this.desc = desc;
|
||||
}
|
||||
|
||||
public int getCode() {
|
||||
return code;
|
||||
}
|
||||
|
||||
public String getDesc() {
|
||||
return desc;
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据code获取描述
|
||||
*/
|
||||
public static String getDescByCode(Integer code) {
|
||||
if (code == null) {
|
||||
return "";
|
||||
}
|
||||
for (DisinfectionMethod method : values()) {
|
||||
if (method.code == code) {
|
||||
return method.desc;
|
||||
}
|
||||
}
|
||||
return "";
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据code获取枚举
|
||||
*/
|
||||
public static DisinfectionMethod getByCode(Integer code) {
|
||||
if (code == null) {
|
||||
return null;
|
||||
}
|
||||
for (DisinfectionMethod method : values()) {
|
||||
if (method.code == code) {
|
||||
return method;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据描述获取code
|
||||
*/
|
||||
public static Integer getCodeByDesc(String desc) {
|
||||
if (desc == null || desc.trim().isEmpty()) {
|
||||
return null;
|
||||
}
|
||||
for (DisinfectionMethod method : values()) {
|
||||
if (method.desc.equals(desc)) {
|
||||
return method.code;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -27,7 +27,9 @@ public class UserPostController {
|
||||
@GetMapping("/getUser")
|
||||
public AjaxResult getUserPost(String postCode){
|
||||
User user = new User();
|
||||
user.setPostCode(postCode);
|
||||
if (postCode != null){
|
||||
user.setPostName(postCode);
|
||||
}
|
||||
List<User> list = userService.getUserListByCode(user);
|
||||
return AjaxResult.success(list);
|
||||
}
|
||||
|
||||
@@ -2,6 +2,9 @@ package com.zhyc.module.frozen.domain;
|
||||
|
||||
import java.util.Date;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
import com.zhyc.common.annotation.Excel;
|
||||
@@ -13,13 +16,16 @@ import com.zhyc.common.core.domain.BaseEntity;
|
||||
* @author ruoyi
|
||||
* @date 2025-11-29
|
||||
*/
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class DdFe extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 主键 */
|
||||
private Long id;
|
||||
|
||||
private Long[] ids;
|
||||
/** 胚胎编号 YS+日期+序号 */
|
||||
@Excel(name = "胚胎编号")
|
||||
private String code;
|
||||
@@ -95,205 +101,5 @@ public class DdFe extends BaseEntity
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public Long getId()
|
||||
{
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setCode(String code)
|
||||
{
|
||||
this.code = code;
|
||||
}
|
||||
|
||||
public String getCode()
|
||||
{
|
||||
return code;
|
||||
}
|
||||
|
||||
public void setFreezeDate(Date freezeDate)
|
||||
{
|
||||
this.freezeDate = freezeDate;
|
||||
}
|
||||
|
||||
public Date getFreezeDate()
|
||||
{
|
||||
return freezeDate;
|
||||
}
|
||||
|
||||
public void setDrId(String drId)
|
||||
{
|
||||
this.drId = drId;
|
||||
}
|
||||
|
||||
public String getDrId()
|
||||
{
|
||||
return drId;
|
||||
}
|
||||
|
||||
public void setDrBreed(String drBreed)
|
||||
{
|
||||
this.drBreed = drBreed;
|
||||
}
|
||||
|
||||
public String getDrBreed()
|
||||
{
|
||||
return drBreed;
|
||||
}
|
||||
|
||||
public void setDeId(String deId)
|
||||
{
|
||||
this.deId = deId;
|
||||
}
|
||||
|
||||
public String getDeId()
|
||||
{
|
||||
return deId;
|
||||
}
|
||||
|
||||
public void setDeBreed(String deBreed)
|
||||
{
|
||||
this.deBreed = deBreed;
|
||||
}
|
||||
|
||||
public String getDeBreed()
|
||||
{
|
||||
return deBreed;
|
||||
}
|
||||
|
||||
public void setEmbBreed(String embBreed)
|
||||
{
|
||||
this.embBreed = embBreed;
|
||||
}
|
||||
|
||||
public String getEmbBreed()
|
||||
{
|
||||
return embBreed;
|
||||
}
|
||||
|
||||
public void setGrade(String grade)
|
||||
{
|
||||
this.grade = grade;
|
||||
}
|
||||
|
||||
public String getGrade()
|
||||
{
|
||||
return grade;
|
||||
}
|
||||
|
||||
public void setQty(Long qty)
|
||||
{
|
||||
this.qty = qty;
|
||||
}
|
||||
|
||||
public Long getQty()
|
||||
{
|
||||
return qty;
|
||||
}
|
||||
|
||||
public void setSexCtl(Integer sexCtl)
|
||||
{
|
||||
this.sexCtl = sexCtl;
|
||||
}
|
||||
|
||||
public Integer getSexCtl()
|
||||
{
|
||||
return sexCtl;
|
||||
}
|
||||
|
||||
public void setStatus(String status)
|
||||
{
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
public String getStatus()
|
||||
{
|
||||
return status;
|
||||
}
|
||||
|
||||
public void setTech(String tech)
|
||||
{
|
||||
this.tech = tech;
|
||||
}
|
||||
|
||||
public String getTech()
|
||||
{
|
||||
return tech;
|
||||
}
|
||||
|
||||
public void setTankId(Long tankId)
|
||||
{
|
||||
this.tankId = tankId;
|
||||
}
|
||||
|
||||
public Long getTankId()
|
||||
{
|
||||
return tankId;
|
||||
}
|
||||
|
||||
public void setBucketId(Long bucketId)
|
||||
{
|
||||
this.bucketId = bucketId;
|
||||
}
|
||||
|
||||
public Long getBucketId()
|
||||
{
|
||||
return bucketId;
|
||||
}
|
||||
|
||||
public void setRackId(Long rackId)
|
||||
{
|
||||
this.rackId = rackId;
|
||||
}
|
||||
|
||||
public Long getRackId()
|
||||
{
|
||||
return rackId;
|
||||
}
|
||||
|
||||
public void setOutDate(Date outDate)
|
||||
{
|
||||
this.outDate = outDate;
|
||||
}
|
||||
|
||||
public Date getOutDate()
|
||||
{
|
||||
return outDate;
|
||||
}
|
||||
|
||||
public void setDiscardTxt(String discardTxt)
|
||||
{
|
||||
this.discardTxt = discardTxt;
|
||||
}
|
||||
|
||||
public String getDiscardTxt()
|
||||
{
|
||||
return discardTxt;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("id", getId())
|
||||
.append("code", getCode())
|
||||
.append("freezeDate", getFreezeDate())
|
||||
.append("drId", getDrId())
|
||||
.append("drBreed", getDrBreed())
|
||||
.append("deId", getDeId())
|
||||
.append("deBreed", getDeBreed())
|
||||
.append("embBreed", getEmbBreed())
|
||||
.append("grade", getGrade())
|
||||
.append("qty", getQty())
|
||||
.append("sexCtl", getSexCtl())
|
||||
.append("status", getStatus())
|
||||
.append("tech", getTech())
|
||||
.append("tankId", getTankId())
|
||||
.append("bucketId", getBucketId())
|
||||
.append("rackId", getRackId())
|
||||
.append("outDate", getOutDate())
|
||||
.append("discardTxt", getDiscardTxt())
|
||||
.append("remark", getRemark())
|
||||
.append("createBy", getCreateBy())
|
||||
.append("createTime", getCreateTime())
|
||||
.toString();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,6 +3,9 @@ package com.zhyc.module.frozen.domain;
|
||||
import java.util.Date;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
import com.zhyc.common.annotation.Excel;
|
||||
@@ -14,6 +17,9 @@ import com.zhyc.common.core.domain.BaseEntity;
|
||||
* @author ruoyi
|
||||
* @date 2025-11-29
|
||||
*/
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class DdFs extends BaseEntity {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@@ -21,7 +27,7 @@ public class DdFs extends BaseEntity {
|
||||
* 主键
|
||||
*/
|
||||
private Long id;
|
||||
|
||||
private Long[] ids;
|
||||
/**
|
||||
* 冻精号/公羊耳号
|
||||
*/
|
||||
@@ -107,148 +113,4 @@ public class DdFs extends BaseEntity {
|
||||
*/
|
||||
@Excel(name = "废弃原因")
|
||||
private String discardTxt;
|
||||
|
||||
public void setId(Long id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public Long getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setCode(String code) {
|
||||
this.code = code;
|
||||
}
|
||||
|
||||
public String getCode() {
|
||||
return code;
|
||||
}
|
||||
|
||||
public void setFreezeDt(Date freezeDt) {
|
||||
this.freezeDt = freezeDt;
|
||||
}
|
||||
|
||||
public Date getFreezeDt() {
|
||||
return freezeDt;
|
||||
}
|
||||
|
||||
public void setBreed(String breed) {
|
||||
this.breed = breed;
|
||||
}
|
||||
|
||||
public String getBreed() {
|
||||
return breed;
|
||||
}
|
||||
|
||||
public void setBatch(String batch) {
|
||||
this.batch = batch;
|
||||
}
|
||||
|
||||
public String getBatch() {
|
||||
return batch;
|
||||
}
|
||||
|
||||
public void setSpec(String spec) {
|
||||
this.spec = spec;
|
||||
}
|
||||
|
||||
public String getSpec() {
|
||||
return spec;
|
||||
}
|
||||
|
||||
public void setQty(Long qty) {
|
||||
this.qty = qty;
|
||||
}
|
||||
|
||||
public Long getQty() {
|
||||
return qty;
|
||||
}
|
||||
|
||||
public void setSexCtl(Integer sexCtl) {
|
||||
this.sexCtl = sexCtl;
|
||||
}
|
||||
|
||||
public Integer getSexCtl() {
|
||||
return sexCtl;
|
||||
}
|
||||
|
||||
public void setStat(String stat) {
|
||||
this.stat = stat;
|
||||
}
|
||||
|
||||
public String getStat() {
|
||||
return stat;
|
||||
}
|
||||
|
||||
public void setTech(String tech) {
|
||||
this.tech = tech;
|
||||
}
|
||||
|
||||
public String getTech() {
|
||||
return tech;
|
||||
}
|
||||
|
||||
public void setTankId(Long tankId) {
|
||||
this.tankId = tankId;
|
||||
}
|
||||
|
||||
public Long getTankId() {
|
||||
return tankId;
|
||||
}
|
||||
|
||||
public void setBucketId(Long bucketId) {
|
||||
this.bucketId = bucketId;
|
||||
}
|
||||
|
||||
public Long getBucketId() {
|
||||
return bucketId;
|
||||
}
|
||||
|
||||
public void setRackId(Long rackId) {
|
||||
this.rackId = rackId;
|
||||
}
|
||||
|
||||
public Long getRackId() {
|
||||
return rackId;
|
||||
}
|
||||
|
||||
public void setOutDt(Date outDt) {
|
||||
this.outDt = outDt;
|
||||
}
|
||||
|
||||
public Date getOutDt() {
|
||||
return outDt;
|
||||
}
|
||||
|
||||
public void setDiscardTxt(String discardTxt) {
|
||||
this.discardTxt = discardTxt;
|
||||
}
|
||||
|
||||
public String getDiscardTxt() {
|
||||
return discardTxt;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("id", getId())
|
||||
.append("code", getCode())
|
||||
.append("freezeDt", getFreezeDt())
|
||||
.append("breed", getBreed())
|
||||
.append("batch", getBatch())
|
||||
.append("spec", getSpec())
|
||||
.append("qty", getQty())
|
||||
.append("sexCtl", getSexCtl())
|
||||
.append("stat", getStat())
|
||||
.append("tech", getTech())
|
||||
.append("tankId", getTankId())
|
||||
.append("bucketId", getBucketId())
|
||||
.append("rackId", getRackId())
|
||||
.append("outDt", getOutDt())
|
||||
.append("discardTxt", getDiscardTxt())
|
||||
.append("remark", getRemark())
|
||||
.append("createBy", getCreateBy())
|
||||
.append("createTime", getCreateTime())
|
||||
.toString();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -29,7 +29,7 @@ public class ScBodyMeasure extends BaseEntity {
|
||||
* $column.columnComment
|
||||
*/
|
||||
private Long id;
|
||||
|
||||
private Long[] ids;
|
||||
/**
|
||||
* 耳号
|
||||
*/
|
||||
|
||||
@@ -26,7 +26,7 @@ public class ScBodyScore extends BaseEntity {
|
||||
* $column.columnComment
|
||||
*/
|
||||
private Long id;
|
||||
|
||||
private Long[] ids;
|
||||
/**
|
||||
* 羊只id
|
||||
*/
|
||||
|
||||
@@ -26,7 +26,7 @@ public class ScBreastRating extends BaseEntity {
|
||||
* $column.columnComment
|
||||
*/
|
||||
private Long id;
|
||||
|
||||
private Long[] ids;
|
||||
/**
|
||||
* 羊只id
|
||||
*/
|
||||
|
||||
@@ -26,7 +26,7 @@ public class ScChangeComment extends BaseEntity {
|
||||
* $column.columnComment
|
||||
*/
|
||||
private Long id;
|
||||
|
||||
private Long[] ids;
|
||||
/**
|
||||
* 羊只id
|
||||
*/
|
||||
|
||||
@@ -26,7 +26,7 @@ public class ScChangeEar extends BaseEntity {
|
||||
* id
|
||||
*/
|
||||
private Integer id;
|
||||
|
||||
private Integer[] ids;
|
||||
/**
|
||||
* 羊只id
|
||||
*/
|
||||
|
||||
@@ -26,7 +26,7 @@ public class ScChangeVariety extends BaseEntity {
|
||||
* $column.columnComment
|
||||
*/
|
||||
private Integer id;
|
||||
|
||||
private Integer[] ids;
|
||||
/**
|
||||
* 羊只id
|
||||
*/
|
||||
|
||||
@@ -24,7 +24,7 @@ public class ScTransGroup extends BaseEntity {
|
||||
* $column.columnComment
|
||||
*/
|
||||
private Integer id;
|
||||
|
||||
private Integer[] ids;
|
||||
/**
|
||||
* 羊只id
|
||||
*/
|
||||
|
||||
@@ -25,7 +25,7 @@ public class ScTransitionInfo extends BaseEntity {
|
||||
*主键
|
||||
*/
|
||||
private Integer id;
|
||||
|
||||
private Integer[] ids;
|
||||
/**
|
||||
* 羊只id
|
||||
*/
|
||||
|
||||
@@ -22,11 +22,10 @@ public interface ScChangeCommentMapper
|
||||
|
||||
/**
|
||||
* 查询改备注列表
|
||||
*
|
||||
* @param scChangeComment 改备注
|
||||
* @return 改备注集合
|
||||
*/
|
||||
// public List<ScChangeComment> selectScChangeCommentList(ScChangeComment scChangeComment);
|
||||
List<ScChangeComment> selectScChangeCommentList(
|
||||
@Param("sc") ScChangeComment sc,
|
||||
@Param("manageTagsList") List<String> manageTagsList);
|
||||
|
||||
/**
|
||||
* 新增改备注
|
||||
@@ -60,10 +59,6 @@ public interface ScChangeCommentMapper
|
||||
*/
|
||||
public int deleteScChangeCommentByIds(Long[] ids);
|
||||
|
||||
List<ScChangeComment> selectScChangeCommentList(
|
||||
@Param("sc") ScChangeComment sc,
|
||||
@Param("manageTagsList") List<String> manageTagsList);
|
||||
|
||||
/**
|
||||
* 模糊搜索耳号
|
||||
*/
|
||||
|
||||
@@ -19,6 +19,8 @@ import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Calendar;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
@@ -122,6 +124,61 @@ public class ScAddSheepServiceImpl implements IScAddSheepService {
|
||||
return scAddSheepMapper.deleteScAddSheepByIds(ids) > 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据出生日期计算月龄
|
||||
*/
|
||||
private int calculateMonthAge(Date birthday) {
|
||||
if (birthday == null) return 0;
|
||||
|
||||
Calendar birthCal = Calendar.getInstance();
|
||||
birthCal.setTime(birthday);
|
||||
|
||||
Calendar nowCal = Calendar.getInstance();
|
||||
|
||||
int yearDiff = nowCal.get(Calendar.YEAR) - birthCal.get(Calendar.YEAR);
|
||||
int monthDiff = nowCal.get(Calendar.MONTH) - birthCal.get(Calendar.MONTH);
|
||||
|
||||
return yearDiff * 12 + monthDiff;
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据月龄、断奶体重、性别自动判断羊只类别ID
|
||||
*/
|
||||
private Long determineSheepType(BigDecimal weaningWeight, int monthAge, Integer gender) {
|
||||
// 1. 断奶体重为空 -> 哺乳羊
|
||||
if (weaningWeight == null) {
|
||||
return 1L; // 哺乳羊
|
||||
}
|
||||
|
||||
// 2. 断奶体重不为空 且 月龄 0-4 -> 断奶羊
|
||||
if (monthAge >= 0 && monthAge <= 4) {
|
||||
return 2L; // 断奶羊
|
||||
}
|
||||
|
||||
// 3. 断奶体重不为空 且 月龄 4-7 -> 育成羊
|
||||
if (monthAge > 4 && monthAge <= 7) {
|
||||
return 3L; // 育成羊
|
||||
}
|
||||
|
||||
// 4. 月龄 7-12 且 母羊 -> 青年羊
|
||||
if (monthAge > 7 && monthAge < 12 && gender != null && gender == 1) { // 1=母
|
||||
return 4L; // 青年羊
|
||||
}
|
||||
|
||||
// 5. 月龄 >=12 且 公羊 -> 成年公羊
|
||||
if (monthAge >= 12 && gender != null && gender == 2) { // 2=公
|
||||
return 8L; // 成年公羊
|
||||
}
|
||||
|
||||
// 6. 月龄 >=12 且 母羊 -> 超龄羊
|
||||
if (monthAge >= 12 && gender != null && gender == 1) { // 1=母
|
||||
return 5L; // 超龄羊
|
||||
}
|
||||
|
||||
// 默认返回哺乳羊
|
||||
return 1L;
|
||||
}
|
||||
|
||||
//导入羊只
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
@@ -136,6 +193,7 @@ public class ScAddSheepServiceImpl implements IScAddSheepService {
|
||||
for (int i = 0; i < list.size(); i++) {
|
||||
ScAddSheep sheep = list.get(i);
|
||||
try {
|
||||
// 校验牧场名称
|
||||
if (StringUtils.isBlank(sheep.getRanchName())) {
|
||||
failure++;
|
||||
failureMsg.append("<br/>第").append(i + 1).append("行:牧场名称不能为空");
|
||||
@@ -153,6 +211,7 @@ public class ScAddSheepServiceImpl implements IScAddSheepService {
|
||||
}
|
||||
sheep.setRanchId(ranchList.get(0).getId().intValue());
|
||||
|
||||
// 校验品种名称
|
||||
if (StringUtils.isNotBlank(sheep.getVarietyName())) {
|
||||
Long varietyId = basSheepVarietyMapper.selectIdByName(sheep.getVarietyName());
|
||||
if (varietyId == null) {
|
||||
@@ -173,6 +232,7 @@ public class ScAddSheepServiceImpl implements IScAddSheepService {
|
||||
continue;
|
||||
}
|
||||
|
||||
// 校验羊舍名称
|
||||
if (StringUtils.isNotBlank(sheep.getSheepfoldNameExcel())) {
|
||||
DaSheepfold param = new DaSheepfold();
|
||||
param.setSheepfoldName(sheep.getSheepfoldNameExcel());
|
||||
@@ -190,23 +250,7 @@ public class ScAddSheepServiceImpl implements IScAddSheepService {
|
||||
sheep.setSheepfold(foldList.get(0).getId().intValue());
|
||||
}
|
||||
|
||||
if (StringUtils.isNotBlank(sheep.getTypeName())) {
|
||||
BasSheepType typeQuery = new BasSheepType();
|
||||
typeQuery.setName(sheep.getTypeName().trim());
|
||||
List<BasSheepType> typeList = basSheepTypeService.selectBasSheepTypeList(typeQuery);
|
||||
|
||||
if (typeList == null || typeList.isEmpty()) {
|
||||
failure++;
|
||||
failureMsg.append("<br/>第")
|
||||
.append(i + 1)
|
||||
.append("行:羊只类型名称不存在【")
|
||||
.append(sheep.getTypeName())
|
||||
.append("】");
|
||||
continue;
|
||||
}
|
||||
sheep.setTypeId(typeList.get(0).getId().longValue());
|
||||
}
|
||||
|
||||
// 校验耳号
|
||||
if (StringUtils.isBlank(sheep.getEarNumber())) {
|
||||
failure++;
|
||||
failureMsg.append("<br/>第")
|
||||
@@ -225,6 +269,8 @@ public class ScAddSheepServiceImpl implements IScAddSheepService {
|
||||
.append("】");
|
||||
continue;
|
||||
}
|
||||
|
||||
// 校验父号(如果填写了)
|
||||
if (StringUtils.isNotBlank(sheep.getFather())) {
|
||||
BasSheep father = basSheepService.selectBasSheepByManageTags(sheep.getFather().trim());
|
||||
if (father == null) {
|
||||
@@ -234,6 +280,7 @@ public class ScAddSheepServiceImpl implements IScAddSheepService {
|
||||
}
|
||||
}
|
||||
|
||||
// 校验母号(如果填写了)
|
||||
if (StringUtils.isNotBlank(sheep.getMother())) {
|
||||
BasSheep mother = basSheepService.selectBasSheepByManageTags(sheep.getMother().trim());
|
||||
if (mother == null) {
|
||||
@@ -242,6 +289,46 @@ public class ScAddSheepServiceImpl implements IScAddSheepService {
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
// 校验出生日期必填
|
||||
if (sheep.getBirthday() == null) {
|
||||
failure++;
|
||||
failureMsg.append("<br/>第").append(i + 1).append("行:出生日期不能为空");
|
||||
continue;
|
||||
}
|
||||
|
||||
// 校验性别必填
|
||||
if (sheep.getGender() == null) {
|
||||
failure++;
|
||||
failureMsg.append("<br/>第").append(i + 1).append("行:性别不能为空");
|
||||
continue;
|
||||
}
|
||||
|
||||
// 自动判断羊只类别
|
||||
int monthAge = calculateMonthAge(sheep.getBirthday());
|
||||
Long autoTypeId = determineSheepType(sheep.getWeaningWeight(), monthAge, sheep.getGender());
|
||||
|
||||
// 如果Excel中填写了typeName,以Excel为准
|
||||
if (StringUtils.isNotBlank(sheep.getTypeName())) {
|
||||
BasSheepType typeQuery = new BasSheepType();
|
||||
typeQuery.setName(sheep.getTypeName().trim());
|
||||
List<BasSheepType> typeList = basSheepTypeService.selectBasSheepTypeList(typeQuery);
|
||||
|
||||
if (typeList == null || typeList.isEmpty()) {
|
||||
failure++;
|
||||
failureMsg.append("<br/>第")
|
||||
.append(i + 1)
|
||||
.append("行:羊只类型名称不存在【")
|
||||
.append(sheep.getTypeName())
|
||||
.append("】");
|
||||
continue;
|
||||
}
|
||||
sheep.setTypeId(typeList.get(0).getId().longValue());
|
||||
} else {
|
||||
// 使用自动判断的类别
|
||||
sheep.setTypeId(autoTypeId);
|
||||
}
|
||||
|
||||
// 数据分离:设置用户和部门
|
||||
sheep.setUserId(userId);
|
||||
sheep.setDeptId(deptId);
|
||||
|
||||
@@ -68,19 +68,15 @@ public class ScChangeVarietyServiceImpl implements IScChangeVarietyService
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public int insertScChangeVariety(ScChangeVariety scChangeVariety)
|
||||
{
|
||||
// ✅ 第1步:先查羊只(移到 insert 之前!)
|
||||
String manageTags = scChangeVariety.getManageTags();
|
||||
BasSheep sheep = basSheepService.selectBasSheepByManageTags(manageTags);
|
||||
if (sheep == null) {
|
||||
throw new RuntimeException("未找到耳号为【" + manageTags + "】的羊只,无法更新品种");
|
||||
}
|
||||
|
||||
// ✅ 第2步:设置所有字段(关键!)
|
||||
scChangeVariety.setSheepId(sheep.getId().intValue()); // 设置羊只ID
|
||||
scChangeVariety.setSheepId(sheep.getId().intValue());
|
||||
|
||||
// 查询当前品种作为旧品种(如果前端没传)
|
||||
if (StringUtils.isBlank(scChangeVariety.getVarietyOld())) {
|
||||
// ✅ 修正:使用正确的方法名 selectBasSheepVarietyById
|
||||
BasSheepVariety oldVariety = varietyService.selectBasSheepVarietyById(sheep.getVarietyId());
|
||||
if (oldVariety != null) {
|
||||
scChangeVariety.setVarietyOld(oldVariety.getVariety());
|
||||
@@ -98,13 +94,11 @@ public class ScChangeVarietyServiceImpl implements IScChangeVarietyService
|
||||
throw new RuntimeException("事件日期不能为空");
|
||||
}
|
||||
|
||||
// ✅ 第3步:再执行 insert(此时所有字段都有值了)
|
||||
int rows = scChangeVarietyMapper.insertScChangeVariety(scChangeVariety);
|
||||
if (rows <= 0) {
|
||||
return rows;
|
||||
}
|
||||
|
||||
// 第4步:更新羊只品种(保持你的原逻辑)
|
||||
String newVarietyName = scChangeVariety.getVarietyNew();
|
||||
BasSheepVariety newVariety = varietyService.selectByVarietyName(newVarietyName);
|
||||
if (newVariety == null) {
|
||||
|
||||
@@ -25,7 +25,7 @@ public class ScCastrate extends BaseEntity {
|
||||
* $column.columnComment
|
||||
*/
|
||||
private Long id;
|
||||
|
||||
private Long[] ids;
|
||||
/**
|
||||
* 羊只id
|
||||
*/
|
||||
|
||||
@@ -25,7 +25,7 @@ public class ScFixHoof extends BaseEntity {
|
||||
* $column.columnComment
|
||||
*/
|
||||
private Integer id;
|
||||
|
||||
private Integer[] ids;
|
||||
/**
|
||||
* 羊只id
|
||||
*/
|
||||
|
||||
@@ -34,6 +34,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<select id="selectDewormList" parameterType="Deworm" resultMap="DewormResult">
|
||||
<include refid="selectDewormVo"/>
|
||||
<where>
|
||||
<!-- 根据ids数组查询 -->
|
||||
<if test="ids != null and ids.length > 0">
|
||||
AND s.id IN
|
||||
<foreach collection="ids" item="id" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="sheepId != null">and sheep_id = #{sheepId}</if>
|
||||
<if test="sheepNo != null and sheepNo != ''">and bs.manage_tags like concat('%',#{sheepNo},'%')</if>
|
||||
<if test="sheepNos != null and sheepNos.length > 0">
|
||||
|
||||
@@ -43,6 +43,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<select id="selectDiagnosisList" parameterType="Diagnosis" resultMap="DiagnosisResult">
|
||||
<include refid="selectDiagnosisVo"/>
|
||||
<where>
|
||||
<!-- 根据ids数组查询 -->
|
||||
<if test="ids != null and ids.length > 0">
|
||||
AND sd.id IN
|
||||
<foreach collection="ids" item="id" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="sheepId != null "> and sd.sheep_id = #{sheepId}</if>
|
||||
<if test="sheepNo != null"> and sf.bs_manage_tags like concat('%', #{sheepNo}, '%')</if>
|
||||
<if test="sheepNos != null and sheepNos.length > 0">
|
||||
|
||||
@@ -44,6 +44,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
FROM sw_disinfect sd
|
||||
LEFT JOIN da_sheepfold ds ON ds.id = sd.sheepfold_id
|
||||
<where>1 = 1
|
||||
<!-- 根据ids数组查询 -->
|
||||
<if test="ids != null and ids.length > 0">
|
||||
AND sd.id IN
|
||||
<foreach collection="ids" item="id" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="sheepfoldId != null"> AND sd.sheepfold_id = #{sheepfoldId}</if>
|
||||
<if test="datetime != null"> AND sd.datetime = #{datetime}</if>
|
||||
<if test="technician != null and technician != ''"> AND sd.technician = #{technician}</if>
|
||||
@@ -64,7 +71,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
${params.dataScope}
|
||||
</where>
|
||||
ORDER BY datetime DESC
|
||||
|
||||
</select>
|
||||
|
||||
<select id="selectDisinfectById" parameterType="Long" resultMap="DisinfectResult">
|
||||
|
||||
@@ -41,6 +41,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
left join bas_sheep bs on s.sheep_id = bs.id
|
||||
|
||||
<where>
|
||||
<!-- 根据ids数组查询 -->
|
||||
<if test="ids != null and ids.length > 0">
|
||||
AND s.id IN
|
||||
<foreach collection="ids" item="id" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="datetime != null "> and datetime = #{datetime}</if>
|
||||
<if test="sheepNo != null and sheepNo != ''">and bs.manage_tags like concat('%',#{sheepNo},'%')</if>
|
||||
<if test="sheepNos != null and sheepNos.length > 0">
|
||||
|
||||
@@ -38,6 +38,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
from sw_immunity s
|
||||
left join bas_sheep bs on s.sheep_id = bs.id
|
||||
<where>
|
||||
<!-- 根据ids数组查询 -->
|
||||
<if test="ids != null and ids.length > 0">
|
||||
AND s.id IN
|
||||
<foreach collection="ids" item="id" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="sheepId != null "> and sheep_id = #{sheepId}</if>
|
||||
<if test="sheepType != null "> and sheep_type = #{sheepType}</if>
|
||||
<if test="sheepNo != null and sheepNo != ''">and bs.manage_tags like concat('%',#{sheepNo},'%')</if>
|
||||
|
||||
@@ -45,6 +45,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<select id="selectQuarantineReportList" parameterType="QuarantineReport" resultMap="QuarantineReportResult">
|
||||
<include refid="selectQuarantineReportVo"/>
|
||||
<where>
|
||||
<!-- 根据ids数组查询 -->
|
||||
<if test="ids != null and ids.length > 0">
|
||||
AND sqr.id IN
|
||||
<foreach collection="ids" item="id" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="sheepId != null "> and sheep_id = #{sheepId}</if>
|
||||
<if test="sheepNo != null and sheepNo != ''">and bs.manage_tags like concat('%',#{sheepNo},'%')</if>
|
||||
<if test="params.beginDatetime != null and params.beginDatetime != '' and params.endDatetime != null and params.endDatetime != ''"> and datetime between #{params.beginDatetime} and #{params.endDatetime}</if>
|
||||
|
||||
@@ -63,7 +63,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
LEFT JOIN da_sheepfold ds ON ds.id = smu.sheepfold
|
||||
LEFT JOIN bas_sheep bs ON bs.id = smu.sheep
|
||||
<where>
|
||||
|
||||
<!-- 根据ids数组查询 -->
|
||||
<if test="ids != null and ids.length > 0">
|
||||
AND smu.id IN
|
||||
<foreach collection="ids" item="id" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</if>
|
||||
<!-- 2. 使用类型 -->
|
||||
<if test="useType != null and useType != ''">
|
||||
AND smu.use_type = #{useType}
|
||||
|
||||
@@ -53,6 +53,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
left join sw_disease sd on t.disease_id = sd.id
|
||||
left join sw_disease sd2 on t.disease_pid = sd2.id
|
||||
<where>
|
||||
<!-- 根据ids数组查询 -->
|
||||
<if test="ids != null and ids.length > 0">
|
||||
AND t.id IN
|
||||
<foreach collection="ids" item="id" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="sheepId != null "> and sheep_id = #{sheepId}</if>
|
||||
<if test="sheepNo != null and sheepNo != ''">and bs.manage_tags like concat('%',#{sheepNo},'%')</if>
|
||||
<if test="sheepNos != null and sheepNos.length > 0">
|
||||
|
||||
@@ -15,13 +15,22 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<choose>
|
||||
<!-- deptId = 0:查询所有用户,不限制部门 -->
|
||||
<when test="deptId == 0">
|
||||
SELECT DISTINCT u.user_id, u.nick_name, p.post_name, p.post_code
|
||||
SELECT
|
||||
MIN(u.user_id) as user_id,
|
||||
u.nick_name,
|
||||
MIN(p.post_name) as post_name,
|
||||
MIN(p.post_code) as post_code
|
||||
FROM sys_user u
|
||||
JOIN sys_user_post up ON u.user_id = up.user_id
|
||||
JOIN sys_post p ON up.post_id = p.post_id
|
||||
WHERE p.post_code LIKE CONCAT('%', #{postCode}, '%')
|
||||
<where>
|
||||
<if test="postCode!=null and postCode!=''">
|
||||
AND p.post_code LIKE CONCAT('%', #{postCode}, '%')
|
||||
</if>
|
||||
</where>
|
||||
AND u.status = 0
|
||||
AND u.del_flag = 0
|
||||
GROUP BY u.nick_name
|
||||
</when>
|
||||
|
||||
<!-- deptId != 0:递归查询该部门及所有子部门 -->
|
||||
@@ -33,14 +42,23 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
FROM sys_dept d
|
||||
INNER JOIN dept_tree dt ON d.parent_id = dt.dept_id
|
||||
)
|
||||
SELECT DISTINCT u.user_id, u.nick_name, p.post_name, p.post_code
|
||||
SELECT
|
||||
MIN(u.user_id) as user_id,
|
||||
u.nick_name,
|
||||
MIN(p.post_name) as post_name,
|
||||
MIN(p.post_code) as post_code
|
||||
FROM dept_tree dt
|
||||
JOIN sys_user u ON u.dept_id = dt.dept_id
|
||||
JOIN sys_user_post up ON u.user_id = up.user_id
|
||||
JOIN sys_post p ON up.post_id = p.post_id
|
||||
WHERE p.post_code LIKE CONCAT('%', #{postCode}, '%')
|
||||
<where>
|
||||
<if test="postCode!=null and postCode!=''">
|
||||
AND p.post_code LIKE CONCAT('%', #{postCode}, '%')
|
||||
</if>
|
||||
</where>
|
||||
AND u.status = 0
|
||||
AND u.del_flag = 0
|
||||
GROUP BY u.nick_name
|
||||
</otherwise>
|
||||
</choose>
|
||||
</select>
|
||||
|
||||
@@ -56,6 +56,12 @@
|
||||
<select id="selectDdFeList" parameterType="DdFe" resultMap="DdFeResult">
|
||||
<include refid="selectDdFeVo"/>
|
||||
<where>
|
||||
<if test="ids != null and ids.length > 0">
|
||||
AND id IN
|
||||
<foreach collection="ids" item="id" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="code != null and code != ''">and code like concat('%', #{code}, '%')</if>
|
||||
<if test="grade != null and grade != ''">and grade = #{grade}</if>
|
||||
<if test="status != null and status != ''">and status = #{status}</if>
|
||||
|
||||
@@ -32,6 +32,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<select id="selectDdFsList" parameterType="DdFs" resultMap="DdFsResult">
|
||||
<include refid="selectDdFsVo"/>
|
||||
<where>
|
||||
<if test="ids != null and ids.length > 0">
|
||||
AND id IN
|
||||
<foreach collection="ids" item="id" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="code != null and code != ''"> and code like concat('%', #{code}, '%')</if>
|
||||
<if test="stat != null and stat != ''">and stat = #{stat}</if>
|
||||
<if test="tech != null and tech != ''"> and tech like concat('%', #{tech}, '%')</if>
|
||||
|
||||
@@ -103,6 +103,13 @@
|
||||
<select id="selectScBodyMeasureList" resultMap="ScBodyMeasureResult">
|
||||
<include refid="selectScBodyMeasureVo"/>
|
||||
<where>
|
||||
<if test="sc.ids != null and sc.ids.length > 0">
|
||||
AND sm.id IN
|
||||
<foreach collection="sc.ids" item="id" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="sc.ids == null or sc.ids.length == 0">
|
||||
<if test="manageTagsList != null and manageTagsList.size() > 0">
|
||||
<foreach collection="manageTagsList" item="tag" separator="or" open="and (" close=")">
|
||||
bs.manage_tags like concat('%', #{tag}, '%')
|
||||
@@ -142,6 +149,7 @@
|
||||
<if test="sc.userId != null">
|
||||
and sm.user_id = #{sc.userId}
|
||||
</if>
|
||||
</if>
|
||||
${sc.params.dataScope}
|
||||
</where>
|
||||
ORDER BY sm.create_time DESC
|
||||
|
||||
@@ -46,6 +46,13 @@
|
||||
<select id="selectScBodyScoreList" resultMap="ScBodyScoreResult">
|
||||
<include refid="selectScBodyScoreVo"/>
|
||||
<where>
|
||||
<if test="sc.ids != null and sc.ids.length > 0">
|
||||
AND sbs.id IN
|
||||
<foreach collection="sc.ids" item="id" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="sc.ids == null or sc.ids.length == 0">
|
||||
<if test="manageTagsList != null and manageTagsList.size() > 0">
|
||||
<foreach collection="manageTagsList" item="tag" separator="or" open="and (" close=")">
|
||||
bs.manage_tags like concat('%', #{tag}, '%')
|
||||
@@ -67,6 +74,7 @@
|
||||
<if test="sc.technician != null and sc.technician != ''">
|
||||
and sbs.technician like concat('%', #{sc.technician}, '%')
|
||||
</if>
|
||||
</if>
|
||||
${sc.params.dataScope}
|
||||
</where>
|
||||
ORDER BY sbs.create_time DESC
|
||||
|
||||
@@ -48,6 +48,13 @@
|
||||
<select id="selectScBreastRatingList" resultMap="ScBreastRatingResult">
|
||||
<include refid="selectScBreastRatingVo"/>
|
||||
<where>
|
||||
<if test="sc.ids != null and sc.ids.length > 0">
|
||||
AND sbr.id IN
|
||||
<foreach collection="sc.ids" item="id" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="sc.ids == null or sc.ids.length == 0">
|
||||
<if test="manageTagsList != null and manageTagsList.size() > 0">
|
||||
<foreach collection="manageTagsList" item="tag" separator="or" open="and (" close=")">
|
||||
bs.manage_tags like concat('%', #{tag}, '%')
|
||||
@@ -70,6 +77,7 @@
|
||||
<if test="sc.score != null">
|
||||
and sbr.score = #{sc.score}
|
||||
</if>
|
||||
</if>
|
||||
${sc.params.dataScope}
|
||||
</where>
|
||||
ORDER BY sbr.create_time DESC
|
||||
|
||||
@@ -40,6 +40,13 @@
|
||||
<select id="selectScChangeCommentList" resultMap="ScChangeCommentResult">
|
||||
<include refid="selectScChangeCommentVo"/>
|
||||
<where>
|
||||
<if test="sc.ids != null and sc.ids.length > 0">
|
||||
AND scc.id IN
|
||||
<foreach collection="sc.ids" item="id" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="sc.ids == null or sc.ids.length == 0">
|
||||
<if test="manageTagsList != null and manageTagsList.size() > 0">
|
||||
<foreach collection="manageTagsList" item="tag" separator="or" open="and (" close=")">
|
||||
bs.manage_tags like concat('%', #{tag}, '%')
|
||||
@@ -68,6 +75,7 @@
|
||||
<if test="sc.isDelete != null">
|
||||
and bs.is_delete = #{sc.isDelete}
|
||||
</if>
|
||||
</if>
|
||||
${sc.params.dataScope}
|
||||
</where>
|
||||
ORDER BY scc.create_time DESC
|
||||
|
||||
@@ -48,6 +48,13 @@
|
||||
<select id="selectScChangeEarList" resultMap="ScChangeEarResult">
|
||||
<include refid="selectScChangeEarVo"/>
|
||||
<where>
|
||||
<if test="sc.ids != null and sc.ids.length > 0">
|
||||
AND sce.id IN
|
||||
<foreach collection="sc.ids" item="id" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="sc.ids == null or sc.ids.length == 0">
|
||||
<if test="sc.sheepId != null">and sce.sheep_id = #{sc.sheepId}</if>
|
||||
<if test="manageTagsList != null and manageTagsList.size() > 0">
|
||||
<foreach collection="manageTagsList" item="tag" separator="or" open="and (" close=")">
|
||||
@@ -55,7 +62,9 @@
|
||||
or bs.electronic_tags like concat('%', #{tag}, '%'))
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="sc.technician != null and sc.technician != ''">and sce.technician like concat('%', #{sc.technician}, '%')</if>
|
||||
<if test="sc.technician != null and sc.technician != ''">and sce.technician like concat('%',
|
||||
#{sc.technician}, '%')
|
||||
</if>
|
||||
<if test="sc.earType != null">and sce.ear_type = #{sc.earType}</if>
|
||||
<if test="sc.newTag != null and sc.newTag != ''">and sce.newTag like concat('%', #{sc.newTag}, '%')</if>
|
||||
<if test="sc.oldTag != null and sc.oldTag != ''">and sce.oldTag like concat('%', #{sc.oldTag}, '%')</if>
|
||||
@@ -73,6 +82,7 @@
|
||||
<when test="sc.inGroup == 2">and bs.is_delete = 1</when>
|
||||
</choose>
|
||||
</if>
|
||||
</if>
|
||||
${sc.params.dataScope}
|
||||
</where>
|
||||
ORDER BY sce.create_time DESC
|
||||
|
||||
@@ -40,6 +40,13 @@
|
||||
<select id="selectScChangeVarietyList" resultMap="ScChangeVarietyResult">
|
||||
<include refid="selectScChangeVarietyVo"/>
|
||||
<where>
|
||||
<if test="sc.ids != null and sc.ids.length > 0">
|
||||
and scv.id IN
|
||||
<foreach collection="sc.ids" item="id" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="sc.ids == null or sc.ids.length == 0">
|
||||
<if test="manageTagsList != null and manageTagsList.size() > 0">
|
||||
<foreach collection="manageTagsList" item="tag" separator="or" open="and (" close=")">
|
||||
bs.manage_tags like concat('%', #{tag}, '%')
|
||||
@@ -65,6 +72,7 @@
|
||||
<if test="sc.isDelete != null">
|
||||
and bs.is_delete = #{sc.isDelete}
|
||||
</if>
|
||||
</if>
|
||||
${sc.params.dataScope}
|
||||
</where>
|
||||
ORDER BY scv.create_time DESC
|
||||
|
||||
@@ -54,6 +54,13 @@
|
||||
<select id="selectScTransGroupList" resultMap="ScTransGroupResult">
|
||||
<include refid="selectScTransGroupVo"/>
|
||||
<where>
|
||||
<if test="sc.ids != null and sc.ids.length > 0">
|
||||
and tg.id IN
|
||||
<foreach collection="sc.ids" item="id" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="sc.ids == null or sc.ids.length == 0">
|
||||
<if test="sc.manageTagsList != null and sc.manageTagsList.size() > 0">
|
||||
<foreach collection="sc.manageTagsList" item="tag" separator="or" open="and (" close=")">
|
||||
s.manage_tags LIKE CONCAT('%', #{tag}, '%')
|
||||
@@ -76,6 +83,7 @@
|
||||
<if test="sc.isDelete != null">
|
||||
and s.is_delete = #{sc.isDelete}
|
||||
</if>
|
||||
</if>
|
||||
${sc.params.dataScope}
|
||||
</where>
|
||||
ORDER BY tg.create_time DESC
|
||||
|
||||
@@ -55,6 +55,13 @@
|
||||
<select id="selectScTransitionInfoList" resultMap="ScTransitionInfoResult">
|
||||
<include refid="selectScTransitionInfoVo"/>
|
||||
<where>
|
||||
<if test="sc.ids != null and sc.ids.length > 0">
|
||||
and t.id IN
|
||||
<foreach collection="sc.ids" item="id" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="sc.ids == null or sc.ids.length == 0">
|
||||
<if test="manageTagsList != null and manageTagsList.size() > 0">
|
||||
<foreach collection="manageTagsList" item="tag" separator="or" open="and (" close=")">
|
||||
bs.manage_tags like concat('%', #{tag}, '%')
|
||||
@@ -81,6 +88,7 @@
|
||||
<if test="sc.currentRanchId != null">
|
||||
and bs.ranch_id = #{sc.currentRanchId}
|
||||
</if>
|
||||
</if>
|
||||
${sc.params.dataScope}
|
||||
</where>
|
||||
ORDER BY t.create_time DESC
|
||||
@@ -91,41 +99,41 @@
|
||||
WHERE t.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="varietyId != null">variety_id,</if>-->
|
||||
<!-- <if test="transTo != null and transTo != ''">trans_to,</if>-->
|
||||
<!-- <if test="transFrom != null and transFrom != ''">trans_from,</if>-->
|
||||
<!-- <if test="eventType != null and eventType != ''">event_type,</if>-->
|
||||
<!-- <if test="transType != null">trans_type,</if>-->
|
||||
<!-- <if test="transitionDate != null">transition_date,</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>-->
|
||||
<!-- <if test="userId != null">user_id,</if>-->
|
||||
<!-- <if test="deptId != null">dept_id,</if>-->
|
||||
<!-- </trim>-->
|
||||
<!-- <trim prefix="values (" suffix=")" suffixOverrides=",">-->
|
||||
<!-- <if test="sheepId != null">#{sheepId},</if>-->
|
||||
<!-- <if test="varietyId != null">#{varietyId},</if>-->
|
||||
<!-- <if test="transTo != null and transTo != ''">#{transTo},</if>-->
|
||||
<!-- <if test="transFrom != null and transFrom != ''">#{transFrom},</if>-->
|
||||
<!-- <if test="eventType != null and eventType != ''">#{eventType},</if>-->
|
||||
<!-- <if test="transType != null">#{transType},</if>-->
|
||||
<!-- <if test="transitionDate != null">#{transitionDate},</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>-->
|
||||
<!-- <if test="userId != null">#{userId},</if>-->
|
||||
<!-- <if test="deptId != null">#{deptId},</if>-->
|
||||
<!-- </trim>-->
|
||||
<!-- </insert>-->
|
||||
<!-- <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="varietyId != null">variety_id,</if>-->
|
||||
<!-- <if test="transTo != null and transTo != ''">trans_to,</if>-->
|
||||
<!-- <if test="transFrom != null and transFrom != ''">trans_from,</if>-->
|
||||
<!-- <if test="eventType != null and eventType != ''">event_type,</if>-->
|
||||
<!-- <if test="transType != null">trans_type,</if>-->
|
||||
<!-- <if test="transitionDate != null">transition_date,</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>-->
|
||||
<!-- <if test="userId != null">user_id,</if>-->
|
||||
<!-- <if test="deptId != null">dept_id,</if>-->
|
||||
<!-- </trim>-->
|
||||
<!-- <trim prefix="values (" suffix=")" suffixOverrides=",">-->
|
||||
<!-- <if test="sheepId != null">#{sheepId},</if>-->
|
||||
<!-- <if test="varietyId != null">#{varietyId},</if>-->
|
||||
<!-- <if test="transTo != null and transTo != ''">#{transTo},</if>-->
|
||||
<!-- <if test="transFrom != null and transFrom != ''">#{transFrom},</if>-->
|
||||
<!-- <if test="eventType != null and eventType != ''">#{eventType},</if>-->
|
||||
<!-- <if test="transType != null">#{transType},</if>-->
|
||||
<!-- <if test="transitionDate != null">#{transitionDate},</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>-->
|
||||
<!-- <if test="userId != null">#{userId},</if>-->
|
||||
<!-- <if test="deptId != null">#{deptId},</if>-->
|
||||
<!-- </trim>-->
|
||||
<!-- </insert>-->
|
||||
|
||||
<insert id="insertScTransitionInfoBatch">
|
||||
INSERT INTO sc_transition_info (
|
||||
@@ -135,7 +143,8 @@
|
||||
) VALUES
|
||||
<foreach collection="list" item="item" separator=",">
|
||||
(
|
||||
#{item.sheepId},#{item.sheepfoldId}, #{item.varietyId}, #{item.transTo}, #{item.transFrom}, #{item.eventType},
|
||||
#{item.sheepId},#{item.sheepfoldId}, #{item.varietyId}, #{item.transTo}, #{item.transFrom},
|
||||
#{item.eventType},
|
||||
#{item.transType},#{item.transitionDate}, #{item.technician}, #{item.status}, #{item.comment},
|
||||
#{item.createBy}, now(), #{item.userId},
|
||||
#{item.deptId}
|
||||
|
||||
@@ -43,6 +43,13 @@
|
||||
<select id="selectScCastrateList" resultMap="ScCastrateResult">
|
||||
<include refid="selectScCastrateVo"/>
|
||||
<where>
|
||||
<if test="sc.ids != null and sc.ids.length > 0">
|
||||
and sc.id IN
|
||||
<foreach collection="sc.ids" item="id" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="sc.ids == null or sc.ids.length == 0">
|
||||
<if test="manageTagsList != null and manageTagsList.size() > 0">
|
||||
<foreach collection="manageTagsList" item="tag" separator="or" open="and (" close=")">
|
||||
bs.manage_tags like concat('%', #{tag}, '%')
|
||||
@@ -62,6 +69,7 @@
|
||||
<if test="sc.isDelete != null">
|
||||
and bs.is_delete = #{sc.isDelete}
|
||||
</if>
|
||||
</if>
|
||||
${sc.params.dataScope}
|
||||
</where>
|
||||
ORDER BY sc.create_time DESC
|
||||
|
||||
@@ -40,6 +40,13 @@
|
||||
<select id="selectScFixHoofList" resultMap="ScFixHoofResult">
|
||||
<include refid="selectScFixHoofVo"/>
|
||||
<where>
|
||||
<if test="sc.ids != null and sc.ids.length > 0">
|
||||
and fh.id IN
|
||||
<foreach collection="sc.ids" item="id" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="sc.ids == null or sc.ids.length == 0">
|
||||
<if test="manageTagsList != null and manageTagsList.size() > 0">
|
||||
<foreach collection="manageTagsList" item="tag" separator="or" open="and (" close=")">
|
||||
bs.manage_tags like concat('%', #{tag}, '%')
|
||||
@@ -59,6 +66,7 @@
|
||||
<if test="sc.isDelete != null">
|
||||
and bs.is_delete = #{sc.isDelete}
|
||||
</if>
|
||||
</if>
|
||||
${sc.params.dataScope}
|
||||
</where>
|
||||
ORDER BY fh.create_time DESC
|
||||
|
||||
Reference in New Issue
Block a user