Merge branch 'main' of http://e19510c831.iok.la/admin/zhyc-sheep
This commit is contained in:
commit
346ba1a966
@ -10,8 +10,7 @@ import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
|
||||
* @author ruoyi
|
||||
*/
|
||||
@SpringBootApplication(exclude = { DataSourceAutoConfiguration.class })
|
||||
public class SheepApplication
|
||||
{
|
||||
public class SheepApplication {
|
||||
public static void main(String[] args)
|
||||
{
|
||||
// System.setProperty("spring.devtools.restart.enabled", "false");
|
||||
|
||||
@ -0,0 +1,8 @@
|
||||
package com.zhyc.module.Exception;
|
||||
|
||||
// 业务异常
|
||||
public class BusinessException extends RuntimeException {
|
||||
public BusinessException(String message) {
|
||||
super(message);
|
||||
}
|
||||
}
|
||||
@ -1,5 +1,6 @@
|
||||
package com.zhyc.module.biosafety.controller;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
@ -56,8 +57,13 @@ public class SwMedicineUsageController extends BaseController
|
||||
public void export(HttpServletResponse response, SwMedicineUsage swMedicineUsage)
|
||||
{
|
||||
List<SwMedicineUsage> list = swMedicineUsageService.selectSwMedicineUsageList(swMedicineUsage);
|
||||
List<SwMedicineUsage> resultList = new ArrayList<>();
|
||||
for (SwMedicineUsage medicineUsage : list) {
|
||||
medicineUsage.setSwMedicineUsageDetailsList(swMedicineUsageService.selectSwMedicineUsageDetailsById(medicineUsage.getId()));
|
||||
resultList.add(medicineUsage);
|
||||
}
|
||||
ExcelUtil<SwMedicineUsage> util = new ExcelUtil<SwMedicineUsage>(SwMedicineUsage.class);
|
||||
util.exportExcel(response, list, "药品使用记录数据");
|
||||
util.exportExcel(response, resultList, "药品使用记录数据");
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@ -28,27 +28,28 @@ public class SwMedicineUsage extends BaseEntity
|
||||
private Integer id;
|
||||
|
||||
/** 使用名称 */
|
||||
@Excel(name = "使用名称")
|
||||
@Excel(name = "使用名称",width = 20, needMerge = true)
|
||||
private String name;
|
||||
|
||||
/** 羊舍名称 */
|
||||
@Excel(name = "使用名称")
|
||||
@Excel(name = "使用名称" ,width = 20, needMerge = true)
|
||||
private String sheepfoldName;
|
||||
private Integer sheepfoldId;
|
||||
/** 耳号 */
|
||||
@Excel(name = "耳号")
|
||||
@Excel(name = "耳号",width = 20, needMerge = true)
|
||||
private String sheepNo;
|
||||
private Integer sheepId;
|
||||
/** 使用时间 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
@Excel(name = "使用日期", width = 30, dateFormat = "yyyy-MM-dd")
|
||||
@Excel(name = "使用日期", width = 30, dateFormat = "yyyy-MM-dd", needMerge = true)
|
||||
private Date datetime;
|
||||
|
||||
/** 使用类型 */
|
||||
@Excel(name = "使用类型")
|
||||
@Excel(name = "使用类型",width = 20, needMerge = true)
|
||||
private String useType;
|
||||
|
||||
/** 药品使用记录详情信息 */
|
||||
@Excel
|
||||
private List<SwMedicineUsageDetails> swMedicineUsageDetailsList;
|
||||
|
||||
|
||||
|
||||
@ -26,40 +26,40 @@ public class SwMedicineUsageDetails extends BaseEntity
|
||||
private Long id;
|
||||
|
||||
/** 药品使用记录id */
|
||||
@Excel(name = "药品使用记录id")
|
||||
// @Excel(name = "药品使用记录id")
|
||||
private Integer mediUsage;
|
||||
|
||||
/** 药品id */
|
||||
@Excel(name = "药品id")
|
||||
// @Excel(name = "药品id")
|
||||
private Long mediId;
|
||||
|
||||
/** 药品名称*/
|
||||
@Excel(name = "药品名称")
|
||||
@Excel(name = "药品名称",cellType = Excel.ColumnType.STRING)
|
||||
private String mediName;
|
||||
|
||||
/** 用量 */
|
||||
@Excel(name = "用量")
|
||||
@Excel(name = "用量",cellType = Excel.ColumnType.STRING)
|
||||
private String dosage;
|
||||
|
||||
/** 单位 */
|
||||
@Excel(name = "单位")
|
||||
@Excel(name = "单位",cellType = Excel.ColumnType.STRING)
|
||||
private String unit;
|
||||
|
||||
/** 使用方法 */
|
||||
@Excel(name = "使用方法")
|
||||
@Excel(name = "使用方法",cellType = Excel.ColumnType.STRING)
|
||||
private String usageId;
|
||||
|
||||
/** 使用时间 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@Excel(name = "使用时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
// @Excel(name = "使用时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date usetime;
|
||||
|
||||
/** 生产厂家 */
|
||||
@Excel(name = "生产厂家")
|
||||
@Excel(name = "生产厂家",cellType = Excel.ColumnType.STRING)
|
||||
private String manufacturer;
|
||||
|
||||
/** 生产批号 */
|
||||
@Excel(name = "生产批号")
|
||||
@Excel(name = "生产批号",cellType = Excel.ColumnType.STRING)
|
||||
private String batchNumber;
|
||||
|
||||
}
|
||||
|
||||
@ -107,8 +107,16 @@ public class Treatment extends BaseEntity
|
||||
@Excel(name = "备注")
|
||||
private String comment;
|
||||
public void setGender(String gender) {
|
||||
this.gender = gender;
|
||||
this.genderName = Gender.getDescByCode(Integer.valueOf(gender));
|
||||
this.gender = gender; // 保留原始字符串
|
||||
this.genderName = null; // 先清空
|
||||
if (gender != null && !gender.trim().isEmpty()) {
|
||||
try {
|
||||
this.genderName = Gender.getDescByCode(Integer.valueOf(gender.trim()));
|
||||
} catch (NumberFormatException ex) {
|
||||
// 可选:记录日志、或抛业务异常
|
||||
this.genderName = "未知";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 排序查询
|
||||
|
||||
@ -87,4 +87,6 @@ public interface SwMedicineUsageMapper
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteSwMedicineUsageDetailsByMediUsage(Integer id);
|
||||
|
||||
List<SwMedicineUsageDetails> selectSwMedicineUsageDetailsById(Integer id);
|
||||
}
|
||||
|
||||
@ -2,6 +2,7 @@ package com.zhyc.module.biosafety.service;
|
||||
|
||||
import java.util.List;
|
||||
import com.zhyc.module.biosafety.domain.SwMedicineUsage;
|
||||
import com.zhyc.module.biosafety.domain.SwMedicineUsageDetails;
|
||||
|
||||
/**
|
||||
* 药品使用记录Service接口
|
||||
@ -58,4 +59,6 @@ public interface ISwMedicineUsageService
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteSwMedicineUsageById(Integer id);
|
||||
|
||||
List<SwMedicineUsageDetails> selectSwMedicineUsageDetailsById(Integer id);
|
||||
}
|
||||
|
||||
@ -113,6 +113,11 @@ public class SwMedicineUsageServiceImpl implements ISwMedicineUsageService
|
||||
return swMedicineUsageMapper.deleteSwMedicineUsageById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<SwMedicineUsageDetails> selectSwMedicineUsageDetailsById(Integer id) {
|
||||
return swMedicineUsageMapper.selectSwMedicineUsageDetailsById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增药品使用记录详情信息
|
||||
*
|
||||
|
||||
@ -5,6 +5,7 @@ import java.util.List;
|
||||
import com.zhyc.common.utils.DateUtils;
|
||||
import com.zhyc.common.utils.SecurityUtils;
|
||||
import com.zhyc.common.utils.bean.BeanUtils;
|
||||
import com.zhyc.module.Exception.BusinessException;
|
||||
import com.zhyc.module.base.domain.SheepFile;
|
||||
import com.zhyc.module.base.mapper.SheepFileMapper;
|
||||
import com.zhyc.module.biosafety.domain.Diagnosis;
|
||||
@ -77,10 +78,10 @@ public class TreatmentServiceImpl implements ITreatmentService
|
||||
*/
|
||||
@Override
|
||||
@Transactional
|
||||
public int insertTreatment(Treatment treatment)
|
||||
{
|
||||
public int insertTreatment(Treatment treatment) {
|
||||
String username = SecurityUtils.getLoginUser().getUser().getNickName();
|
||||
// 使用记录的文件
|
||||
|
||||
// 药品使用记录公共字段
|
||||
SwMedicineUsage medicineUsage = new SwMedicineUsage();
|
||||
medicineUsage.setSwMedicineUsageDetailsList(treatment.getUsageDetails());
|
||||
medicineUsage.setName("羊只治疗");
|
||||
@ -88,25 +89,76 @@ public class TreatmentServiceImpl implements ITreatmentService
|
||||
medicineUsage.setDatetime(treatment.getDatetime());
|
||||
medicineUsage.setCreateBy(username);
|
||||
medicineUsage.setCreateTime(DateUtils.getNowDate());
|
||||
// 新增单挑数据
|
||||
|
||||
/* ---------------- 单只插入 ---------------- */
|
||||
if (treatment.getSheepId() != null) {
|
||||
// 1. 重复校验
|
||||
Treatment query = new Treatment();
|
||||
query.setDiseaseId(treatment.getDiseaseId());
|
||||
query.setDiseasePid(treatment.getDiseasePid());
|
||||
query.setSheepId(treatment.getSheepId());
|
||||
query.setStatus("0");
|
||||
|
||||
|
||||
|
||||
// 2. 羊只档案信息
|
||||
SheepFile sheepFile = sheepFileMapper.selectSheepFileById(treatment.getSheepId());
|
||||
|
||||
if (!treatmentMapper.selectTreatmentList(query).isEmpty()) {
|
||||
throw new BusinessException("该羊只已存在相同疾病的治疗记录,不能重复添加");
|
||||
}
|
||||
// 3. 保存药品使用记录
|
||||
medicineUsage.setSheepId(Math.toIntExact(treatment.getSheepId()));
|
||||
// 药品使用记录
|
||||
Integer id=medicineUsageService.insertSwMedicineUsage(medicineUsage);
|
||||
// 药品使用记录id
|
||||
treatment.setUsageId(id);
|
||||
Integer usageId = medicineUsageService.insertSwMedicineUsage(medicineUsage);
|
||||
|
||||
// 4. 组装治疗记录
|
||||
treatment.setUsageId(usageId);
|
||||
treatment.setCreateTime(DateUtils.getNowDate());
|
||||
treatment.setVariety(sheepFile.getVariety());
|
||||
treatment.setSheepType(sheepFile.getName());
|
||||
treatment.setMonthAge(sheepFile.getMonthAge());
|
||||
treatment.setGender(String.valueOf(sheepFile.getGender()));
|
||||
treatment.setBreed(sheepFile.getBreed());
|
||||
treatment.setParity(sheepFile.getParity());
|
||||
treatment.setLactDay(sheepFile.getLactationDay());
|
||||
treatment.setGestDay(sheepFile.getGestationDay());
|
||||
|
||||
// 5. 插入
|
||||
return treatmentMapper.insertTreatment(treatment);
|
||||
}
|
||||
|
||||
// 批量新增
|
||||
}else {
|
||||
/* ---------------- 批量插入 ---------------- */
|
||||
// 1. 收集所有重复耳号
|
||||
List<String> duplicateSheepIds = new ArrayList<>();
|
||||
for (String sheepId : treatment.getSheepIds()) {
|
||||
Treatment query = new Treatment();
|
||||
query.setDiseaseId(treatment.getDiseaseId());
|
||||
query.setDiseasePid(treatment.getDiseasePid());
|
||||
query.setSheepId(Long.valueOf(sheepId));
|
||||
query.setStatus("0");
|
||||
|
||||
if (!treatmentMapper.selectTreatmentList(query).isEmpty()) {
|
||||
String bsManageTags = sheepFileMapper.selectSheepFileById(Long.valueOf(sheepId)).getBsManageTags();
|
||||
duplicateSheepIds.add(bsManageTags);
|
||||
}
|
||||
}
|
||||
|
||||
// 2. 存在重复则一次性提示
|
||||
if (!duplicateSheepIds.isEmpty()) {
|
||||
|
||||
throw new BusinessException("以下耳号已存在相同疾病记录,无法添加:" + String.join("、", duplicateSheepIds));
|
||||
}
|
||||
|
||||
// 3. 全部合法,开始批量组装
|
||||
List<Treatment> treatments = new ArrayList<>();
|
||||
treatment.setCreateTime(DateUtils.getNowDate());
|
||||
|
||||
for (String sheepId : treatment.getSheepIds()) {
|
||||
SheepFile sheepFile = sheepFileMapper.selectSheepFileById(Long.valueOf(sheepId));
|
||||
|
||||
Treatment treat = new Treatment();
|
||||
BeanUtils.copyProperties(treatment, treat);
|
||||
|
||||
treat.setSheepId(Long.valueOf(sheepId));
|
||||
treat.setVariety(sheepFile.getVariety());
|
||||
treat.setSheepType(sheepFile.getName());
|
||||
@ -117,23 +169,17 @@ public class TreatmentServiceImpl implements ITreatmentService
|
||||
treat.setLactDay(sheepFile.getLactationDay());
|
||||
treat.setGestDay(sheepFile.getGestationDay());
|
||||
|
||||
// 药品使用记录
|
||||
medicineUsage.setSheepId(Integer.valueOf(sheepId));
|
||||
// 获取药品使用记录的id
|
||||
Integer usageId = medicineUsageService.insertSwMedicineUsage(medicineUsage);
|
||||
System.out.println(medicineUsage);
|
||||
System.out.println(usageId);
|
||||
treat.setUsageId(usageId);
|
||||
|
||||
treatments.add(treat);
|
||||
}
|
||||
// 药品使用记录
|
||||
medicineUsage.setSwMedicineUsageDetailsList(treatment.getUsageDetails());
|
||||
|
||||
|
||||
// 4. 批量插入
|
||||
return treatmentMapper.insertTreatmentList(treatments);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改治疗记录
|
||||
*
|
||||
@ -153,7 +199,9 @@ public class TreatmentServiceImpl implements ITreatmentService
|
||||
swMedicineUsage.setId(treatment.getUsageId());
|
||||
swMedicineUsage.setUpdateBy(username);
|
||||
medicineUsageMapper.updateSwMedicineUsage(swMedicineUsage);
|
||||
if (!treatment.getUsageDetails().isEmpty() || treatment.getUsageDetails().size() != 0){
|
||||
medicineUsageMapper.batchSwMedicineUsageDetails(treatment.getUsageDetails());
|
||||
}
|
||||
treatment.setUpdateBy(username);
|
||||
treatment.setUpdateTime(DateUtils.getNowDate());
|
||||
return treatmentMapper.updateTreatment(treatment);
|
||||
|
||||
@ -0,0 +1,4 @@
|
||||
package com.zhyc.module.enums;
|
||||
|
||||
public enum UseType {
|
||||
}
|
||||
@ -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,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_ear
|
||||
*
|
||||
@ -15,43 +18,70 @@ import com.zhyc.common.core.domain.BaseEntity;
|
||||
@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;
|
||||
@ -17,19 +18,24 @@ import com.zhyc.common.core.domain.BaseEntity;
|
||||
@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;
|
||||
}
|
||||
|
||||
@ -111,6 +111,26 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
where medi_usage = #{medi_usage}
|
||||
|
||||
</select>
|
||||
<select id="selectSwMedicineUsageDetailsById" resultMap="SwMedicineUsageDetailsResult">
|
||||
SELECT
|
||||
smud.id,
|
||||
smud.medi_usage,
|
||||
smud.medi_id,
|
||||
smud.dosage,
|
||||
smud.usetime,
|
||||
smud.manufacturer,
|
||||
smud.batch_number,
|
||||
sm.name AS name,
|
||||
su.name AS usageId,
|
||||
sunit.unit AS unit
|
||||
FROM
|
||||
sw_medicine_usage_details smud
|
||||
JOIN sw_medicine sm ON smud.medi_id = sm.id
|
||||
LEFT JOIN sw_usage su ON smud.usageId = su.id
|
||||
LEFT JOIN sw_unit sunit ON smud.unit = sunit.id
|
||||
WHERE
|
||||
smud.medi_usage = #{id}
|
||||
</select>
|
||||
|
||||
<insert id="insertSwMedicineUsage" parameterType="SwMedicineUsage" useGeneratedKeys="true" keyProperty="id">
|
||||
insert into sw_medicine_usage
|
||||
@ -173,10 +193,16 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
delete from sw_medicine_usage_details where medi_usage = #{mediUsage}
|
||||
</delete>
|
||||
|
||||
<insert id="batchSwMedicineUsageDetails">
|
||||
insert into sw_medicine_usage_details( id, medi_usage, medi_id, dosage, unit, usageId,usetime, manufacturer, batch_number) values
|
||||
<foreach item="item" index="index" collection="list" separator=",">
|
||||
( #{item.id}, #{item.mediUsage}, #{item.mediId}, #{item.dosage}, #{item.unit}, #{item.usageId}, #{item.usetime},#{item.manufacturer}, #{item.batchNumber})
|
||||
|
||||
<!-- 修改后的正确SQL -->
|
||||
<insert id="batchSwMedicineUsageDetails" parameterType="java.util.List">
|
||||
insert into sw_medicine_usage_details(id, medi_usage, medi_id, dosage, unit, usageId, usetime, manufacturer, batch_number)
|
||||
values
|
||||
<foreach collection="list" item="item" separator=",">
|
||||
(#{item.id}, #{item.mediUsage}, #{item.mediId}, #{item.dosage},
|
||||
#{item.unit}, #{item.usageId}, #{item.usetime},
|
||||
#{item.manufacturer}, #{item.batchNumber})
|
||||
</foreach>
|
||||
</insert>
|
||||
|
||||
</mapper>
|
||||
@ -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>
|
||||
<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>
|
||||
<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,6 +16,8 @@
|
||||
<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">
|
||||
@ -33,7 +35,9 @@
|
||||
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