判断羊只的删除/未删除状态
This commit is contained in:
@@ -128,7 +128,8 @@
|
||||
<if test="sourceDate != null ">and source_date = #{sourceDate}</if>
|
||||
<if test="sourceRanchId != null ">and source_ranch_id = #{sourceRanchId}</if>
|
||||
<if test="comment != null and comment != ''">and comment = #{comment}</if>
|
||||
<if test="isDelete != null ">and is_delete = #{isDelete}</if>
|
||||
<if test="isDelete == null">and is_delete = 0</if>
|
||||
<if test="isDelete != null">and is_delete = #{isDelete}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
@@ -151,20 +152,24 @@
|
||||
bv.variety AS varietyName
|
||||
FROM bas_sheep s
|
||||
LEFT JOIN bas_sheep_variety bv ON s.variety_id = bv.id
|
||||
WHERE s.manage_tags = #{manageTags} LIMIT 1
|
||||
WHERE s.manage_tags = #{manageTags}
|
||||
AND s.is_delete = 0 LIMIT 1
|
||||
</select>
|
||||
|
||||
<select id="selectBasSheepBySheepfold" parameterType="BasSheep" resultMap="BasSheepResult">
|
||||
<include refid="selectBasSheepVo"/>
|
||||
<where>
|
||||
sheepfold_id = #{id}
|
||||
and is_delete = 0
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="getSheepByRanchId" resultMap="BasSheepResult">
|
||||
SELECT *
|
||||
FROM bas_sheep
|
||||
WHERE ranch_id = #{ranchId}
|
||||
<include refid="selectBasSheepVo"/>
|
||||
<where>
|
||||
ranch_id = #{ranchId}
|
||||
and is_delete = 0
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectBasSheepListByIds" parameterType="list" resultMap="BasSheepResult">
|
||||
@@ -320,10 +325,16 @@
|
||||
</delete>
|
||||
|
||||
<select id="existsByManageTag" resultType="int">
|
||||
SELECT COUNT(*) FROM bas_sheep WHERE manage_tags = #{tag} AND is_delete = 0
|
||||
SELECT COUNT(*)
|
||||
FROM bas_sheep
|
||||
WHERE manage_tags = #{tag}
|
||||
AND s.is_delete = 0
|
||||
</select>
|
||||
|
||||
<select id="existsByElectronicTag" resultType="int">
|
||||
SELECT COUNT(*) FROM bas_sheep WHERE electronic_tags = #{tag} AND is_delete = 0
|
||||
SELECT COUNT(*)
|
||||
FROM bas_sheep
|
||||
WHERE electronic_tags = #{tag}
|
||||
AND is_delete = 0
|
||||
</select>
|
||||
</mapper>
|
||||
Reference in New Issue
Block a user