This commit is contained in:
2026-01-27 15:36:01 +08:00
parent 5bcfadfd85
commit 7890c4d792
5 changed files with 46 additions and 5 deletions

View File

@@ -38,6 +38,7 @@ public class SwMedicineUsage extends BaseEntity
/** 耳号 */
@Excel(name = "耳号",width = 20, needMerge = true)
private String sheepNo;
private String[] sheepNos;
private Integer sheepId;
/** 使用时间 */
@JsonFormat(pattern = "yyyy-MM-dd")

View File

@@ -46,6 +46,14 @@ public class SwMedicineUsageServiceImpl implements ISwMedicineUsageService
@Override
public List<SwMedicineUsage> selectSwMedicineUsageList(SwMedicineUsage swMedicineUsage)
{
String[] sheepNos = null;
if (swMedicineUsage.getSheepNo() != null && !swMedicineUsage.getSheepNo().isEmpty()) {
if (swMedicineUsage.getSheepNo().contains(" ")) {
sheepNos = swMedicineUsage.getSheepNo().split(" ");
swMedicineUsage.setSheepNos(sheepNos);
swMedicineUsage.setSheepNo(null);
}
}
return swMedicineUsageMapper.selectSwMedicineUsageList(swMedicineUsage);
}

View File

@@ -73,6 +73,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="sheepNo != null and sheepNo != ''">
AND bs.manage_tags LIKE CONCAT('%', #{sheepNo}, '%')
</if>
<if test="sheepNos != null and sheepNos.length > 0">
AND (
<foreach collection="sheepNos" item="item" separator=" OR " open="" close="">
bs.manage_tags LIKE CONCAT('%', #{item}, '%')
</foreach>
)
</if>
<!-- 4. 使用时间区间 -->
<if test="params.beginUseTime != null and params.endUseTime != null">