消毒药品查询检疫记录修改

This commit is contained in:
piaobo 2025-08-20 17:27:12 +08:00
parent 0122acc5b1
commit 7249cd9dfc
5 changed files with 45 additions and 19 deletions

View File

@ -11,7 +11,7 @@ import com.zhyc.common.annotation.Excel;
import com.zhyc.common.core.domain.BaseEntity; import com.zhyc.common.core.domain.BaseEntity;
/** /**
* 驱虫对象 sw_deworm * 驱虫对象 sw_dih
* *
* @author ruoyi * @author ruoyi
* @date 2025-07-15 * @date 2025-07-15

View File

@ -35,8 +35,8 @@ public class Disinfect extends BaseEntity
private Integer[] sheepfoldIds; private Integer[] sheepfoldIds;
/** 消毒日期 */ /** 消毒日期 */
@JsonFormat(pattern = "yyyy-MM-dd HH:mm") @JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "消毒日期", width = 30, dateFormat = "yyyy-MM-dd HH:mm") @Excel(name = "消毒日期", width = 30, dateFormat = "yyyy-MM-dd")
private Date datetime; private Date datetime;
/** 技术员 */ /** 技术员 */
@ -58,6 +58,8 @@ public class Disinfect extends BaseEntity
/** 备注 */ /** 备注 */
@Excel(name = "备注") @Excel(name = "备注")
private String comment; private String comment;
/** 药品名称用于查询*/
private String mediName;
// 药品使用 // 药品使用
private List<SwMedicineUsageDetails> usageDetails; private List<SwMedicineUsageDetails> usageDetails;

View File

@ -63,7 +63,7 @@ public class QuarantineReportServiceImpl implements IQuarantineReportService
String username = SecurityUtils.getLoginUser().getUser().getNickName(); String username = SecurityUtils.getLoginUser().getUser().getNickName();
quarantineReport.setCreateBy(username); quarantineReport.setCreateBy(username);
quarantineReport.setCreateTime(DateUtils.getNowDate()); quarantineReport.setCreateTime(DateUtils.getNowDate());
if (quarantineReport.getResult()==null){ if (quarantineReport.getResult()==null || quarantineReport.getResult().length()==0){
quarantineReport.setStatus(0); quarantineReport.setStatus(0);
}else { }else {
quarantineReport.setStatus(1); quarantineReport.setStatus(1);

View File

@ -28,16 +28,39 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</sql> </sql>
<select id="selectDisinfectList" parameterType="Disinfect" resultMap="DisinfectResult"> <select id="selectDisinfectList" parameterType="Disinfect" resultMap="DisinfectResult">
<include refid="selectDisinfectVo"/> SELECT sd.id,
<where> sd.sheepfold_id,
<if test="sheepfoldId != null "> and sheepfold_id = #{sheepfoldId}</if> sd.datetime,
<if test="datetime != null "> and datetime = #{datetime}</if> sd.technician,
<if test="technician != null and technician != ''"> and technician = #{technician}</if> sd.way,
<if test="way != null and way != ''"> and way = #{way}</if> sd.usage_id,
<if test="usageId != null "> and usage_id = #{usageId}</if> sd.ratio,
<if test="ratio != null and ratio != ''"> and ratio = #{ratio}</if> sd.comment,
<if test="comment != null and comment != ''"> and comment = #{comment}</if> sd.update_by,
</where> sd.update_time,
sd.create_by,
sd.create_time,
ds.sheepfold_name
FROM sw_disinfect sd
LEFT JOIN da_sheepfold ds ON ds.id = sd.sheepfold_id
WHERE 1 = 1
<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>
<if test="way != null and way != ''"> AND sd.way = #{way}</if>
<if test="usageId != null"> AND sd.usage_id = #{usageId}</if>
<if test="ratio != null and ratio != ''"> AND sd.ratio = #{ratio}</if>
<if test="comment != null and comment != ''"> AND sd.comment = #{comment}</if>
<!-- 子表过滤条件:仅保留满足药品名称的记录 -->
<if test="mediName != null and mediName != ''">
AND EXISTS (
SELECT 1
FROM sw_medicine_usage_details mud
JOIN sw_medicine sm ON sm.id = mud.medi_id
WHERE mud.medi_usage = sd.usage_id
AND sm.name like concat('%',#{mediName},'%')
)
</if>
</select> </select>
<select id="selectDisinfectById" parameterType="Long" resultMap="DisinfectResult"> <select id="selectDisinfectById" parameterType="Long" resultMap="DisinfectResult">
@ -71,7 +94,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="createBy != null">create_by = #{createBy},</if> <if test="createBy != null">create_by = #{createBy},</if>
<if test="createTime != null">create_time = #{createTime},</if> <if test="createTime != null">create_time = #{createTime},</if>
</trim> </trim>
where sd.id = #{id} where id = #{id}
</update> </update>
<delete id="deleteDisinfectById" parameterType="Long"> <delete id="deleteDisinfectById" parameterType="Long">

View File

@ -30,11 +30,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</resultMap> </resultMap>
<sql id="selectQuarantineReportVo"> <sql id="selectQuarantineReportVo">
select sqr.id, sheep_type,sheep_id, datetime, quar_item, sample_type, sampler, quar_officer, result, status, select sqr.id, sheep_type,sqr.gender,sqr.parity,sqr.breed,sqr.month_age,sheep_id, datetime, quar_item, sample_type, sampler, quar_officer, result, status,
sqr.update_by, sqr.update_time, sqr.create_by, sqr.create_time, sqr.update_by, sqr.update_time, sqr.create_by, sqr.create_time,
sqi.name as item_name, sqi.name as item_name,
sqs.name as sample, sqs.name as sample,
sf.bs_manage_tags sheep_no,sf.gender,sf.parity,sf.breed,sf.month_age sf.bs_manage_tags sheep_no
from sw_quarantine_report sqr from sw_quarantine_report sqr
left join sw_quarantine_items sqi on sqr.quar_item = sqi.id left join sw_quarantine_items sqi on sqr.quar_item = sqi.id
left join sw_quarantine_sample sqs on sqr.sample_type = sqs.id left join sw_quarantine_sample sqs on sqr.sample_type = sqs.id
@ -48,10 +48,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="params.beginDatetime != null and params.beginDatetime != '' and params.endDatetime != null and params.endDatetime != ''"> and datetime between #{params.beginDatetime} and #{params.endDatetime}</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>
<if test="quarItem != null "> and quar_item = #{quarItem}</if> <if test="quarItem != null "> and quar_item = #{quarItem}</if>
<if test="sampleType != null "> and sample_type = #{sampleType}</if> <if test="sampleType != null "> and sample_type = #{sampleType}</if>
<if test="sampler != null and sampler != ''"> and sampler = #{sampler}</if> <if test="sampler != null and sampler != ''"> and sampler like concat('%',#{sampler},'%') </if>
<if test="quarOfficer != null and quarOfficer != ''"> and quar_officer = #{quarOfficer}</if> <if test="quarOfficer != null and quarOfficer != ''"> and quar_officer like concat('%',#{quarOfficer},'%')</if>
<if test="result != null "> and result = #{result}</if> <if test="result != null "> and result = #{result}</if>
<if test="status != null "> and status = #{status}</if> <if test="status != null "> and status = #{status}</if>
<if test="sheepType != null and sheepType!= ''"> and sqr.sheep_type=#{sheepType}</if>
</where> </where>
</select> </select>