断奶录入问题,断奶查询问题,干奶录入问题,干奶查询问题,死亡录入问题,死亡查询问题

This commit is contained in:
ll
2026-02-01 21:47:56 +08:00
parent 13e0f68289
commit 464126195d
18 changed files with 628 additions and 962 deletions

View File

@@ -14,7 +14,6 @@
<result property="createBy" column="create_by" />
<result property="createTime" column="create_time" />
<result property="comment" column="comment" />
<!-- 联表查询字段 -->
<result property="manageTags" column="bs_manage_tags" />
<result property="variety" column="variety" />
<result property="sheepfoldName" column="sheepfold_name" />
@@ -33,17 +32,36 @@
<select id="selectScDryMilkList" parameterType="ScDryMilk" resultMap="ScDryMilkResult">
<include refid="selectScDryMilkVo"/>
<where>
<if test="sheepId != null and sheepId != ''"> and d.sheep_id = #{sheepId}</if>
<if test="manageTags != null and manageTags != ''"> and s.bs_manage_tags like concat('%', #{manageTags}, '%')</if>
<if test="datetime != null "> and d.datetime = #{datetime}</if>
<if test="manageTagsList != null and manageTagsList.size() > 0">
AND s.bs_manage_tags IN
<foreach collection="manageTagsList" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</if>
<if test="(manageTagsList == null or manageTagsList.size() == 0) and manageTags != null and manageTags != ''">
AND s.bs_manage_tags like concat('%', #{manageTags}, '%')
</if>
<if test="params.beginTime != null and params.beginTime != ''">
AND d.datetime &gt;= #{params.beginTime}
</if>
<if test="params.endTime != null and params.endTime != ''">
AND d.datetime &lt;= #{params.endTime}
</if>
<if test="status != null "> and d.status = #{status}</if>
<if test="sheepfold != null "> and d.sheepfold = #{sheepfold}</if>
<if test="tecahnician != null and tecahnician != ''"> and d.tecahnician like concat('%', #{tecahnician}, '%')</if>
<if test="createBy != null and createBy != ''"> and d.create_by = #{createBy}</if>
<if test="createTime != null "> and d.create_time = #{createTime}</if>
<if test="variety != null and variety != ''"> and s.variety like concat('%', #{variety}, '%')</if>
</where>
order by d.create_time desc
order by d.datetime desc
</select>
<select id="selectSheepEarNumberList" resultType="String">
SELECT bs_manage_tags
FROM sheep_file
WHERE bs_manage_tags LIKE concat('%', #{query}, '%')
LIMIT 20
</select>
<select id="selectScDryMilkById" parameterType="Long" resultMap="ScDryMilkResult">
@@ -51,9 +69,8 @@
where d.id = #{id}
</select>
<!-- 根据耳号查询羊只ID -->
<select id="selectSheepIdByManageTags" parameterType="String" resultType="Long">
select id from sheep_file where bs_manage_tags = #{manageTags}
select id from sheep_file where bs_manage_tags = #{manageTags} limit 1
</select>
<insert id="insertScDryMilk" parameterType="ScDryMilk" useGeneratedKeys="true" keyProperty="id">