Merge remote-tracking branch 'main/main'

This commit is contained in:
2025-07-21 19:28:52 +08:00
7 changed files with 216 additions and 64 deletions

View File

@@ -52,19 +52,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="groupId != null"> AND m.group_id = #{groupId}</if>
<if test="bsManageTags != null and bsManageTags.size > 0">
AND s.bs_manage_tags IN
<foreach collection="bsManageTags" item="bsManageTag " open="(" separator="," close=")">
#{bsManageTag}
<foreach collection="bsManageTags" item="tag" open="(" separator="," close=")">
#{tag}
</foreach>
</if>
</where>
ORDER BY m.id
</select>
<select id="selectBasSheepGroupMappingById" parameterType="Long" resultMap="BasSheepGroupMappingResult">
<include refid="selectBasSheepGroupMappingVo"/>
@@ -102,4 +97,32 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
#{id}
</foreach>
</delete>
<!-- 根据耳号查询羊只ID -->
<select id="selectSheepIdsByEarTags" parameterType="list" resultType="map">
SELECT id, manage_tags
FROM bas_sheep
WHERE manage_tags IN
<foreach collection="earTags" item="tag" open="(" separator="," close=")">
#{tag}
</foreach>
</select>
<!-- 批量插入 -->
<insert id="batchInsert" parameterType="java.util.List">
INSERT INTO bas_sheep_group_mapping (sheep_id, group_id)
VALUES
<foreach collection="list" item="item" separator=",">
(#{item.sheepId}, #{item.groupId})
</foreach>
</insert>
<select id="selectListByGroupId"
resultMap="BasSheepGroupMappingResult">
SELECT id, sheep_id, group_id
FROM bas_sheep_group_mapping
WHERE group_id = #{groupId}
</select>
</mapper>