修改根据耳号进行查询

This commit is contained in:
piaobo 2025-08-26 17:04:33 +08:00
parent fba29a69a1
commit fd7e83dc77
4 changed files with 24 additions and 3 deletions

View File

@ -35,6 +35,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<include refid="selectDewormVo"/> <include refid="selectDewormVo"/>
<where> <where>
<if test="sheepId != null "> and sheep_id = #{sheepId}</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> <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="technical != null and technical != ''"> and technical = #{technical}</if> <if test="technical != null and technical != ''"> and technical = #{technical}</if>
</where> </where>

View File

@ -34,9 +34,16 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</sql> </sql>
<select id="selectHealthList" parameterType="Health" resultMap="HealthResult"> <select id="selectHealthList" parameterType="Health" resultMap="HealthResult">
<include refid="selectHealthVo"/> select s.id, datetime, sheep_id, usage_id, variety, sheep_type, s.gender, month_age, s.parity, breed, technical,
s.comment, s.update_by, s.update_time, s.create_by, s.create_time,
bs.manage_tags sheep_no
from sw_health s
left join bas_sheep bs on s.sheep_id = bs.id
<where> <where>
<if test="datetime != null "> and datetime = #{datetime}</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="params.beginDatetime != null and params.beginDatetime != '' and params.endDatetime != null and params.endDatetime != ''"> and datetime between #{params.beginDatetime} and #{params.endDatetime}</if>
<if test="technical != null and technical != ''"> and technical = #{technical}</if> <if test="technical != null and technical != ''"> and technical = #{technical}</if>
</where> </where>
ORDER BY datetime DESC ORDER BY datetime DESC

View File

@ -32,10 +32,15 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</sql> </sql>
<select id="selectImmunityList" parameterType="Immunity" resultMap="ImmunityResult"> <select id="selectImmunityList" parameterType="Immunity" resultMap="ImmunityResult">
<include refid="selectImmunityVo"/> select s.id, datetime, sheep_id, usage_id, variety, sheep_type, s.gender, month_age, s.parity, breed, technical,
s.comment, s.update_by, s.update_time, s.create_by, s.create_time,
bs.manage_tags sheep_no
from sw_immunity s
left join bas_sheep bs on s.sheep_id = bs.id
<where> <where>
<if test="sheepId != null "> and sheep_id = #{sheepId}</if> <if test="sheepId != null "> and sheep_id = #{sheepId}</if>
<if test="sheepType != null "> and sheep_type = #{sheepType}</if> <if test="sheepType != null "> and sheep_type = #{sheepType}</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> <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="technical != null and technical != ''"> and technical = #{technical}</if> <if test="technical != null and technical != ''"> and technical = #{technical}</if>
</where> </where>

View File

@ -44,9 +44,17 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</sql> </sql>
<select id="selectTreatmentList" parameterType="Treatment" resultMap="TreatmentResult"> <select id="selectTreatmentList" parameterType="Treatment" resultMap="TreatmentResult">
<include refid="selectTreatmentVo"/> select t.id, diag_id, sheep_id, variety, sheep_type, month_age, t.gender, t.parity, breed, lact_day, gest_day, datetime, disease_id, disease_pid, veterinary, usage_id,status, t.comment, t.update_by, t.update_time, t.create_by, t.create_time,
bs.manage_tags,
sd.name disease_name,
sd2.name disease_pname
from sw_treatment t
left join bas_sheep bs on t.sheep_id = bs.id
left join sw_disease sd on t.disease_id = sd.id
left join sw_disease sd2 on t.disease_pid = sd2.id
<where> <where>
<if test="sheepId != null "> and sheep_id = #{sheepId}</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> <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="diseaseId != null "> and disease_id = #{diseaseId}</if> <if test="diseaseId != null "> and disease_id = #{diseaseId}</if>
<if test="status != null and status !=''"> and status = #{status}</if> <if test="status != null and status !=''"> and status = #{status}</if>