Updated BlockMapper.xml to modify the "selectList" query by moving the "<where>" block inside the "<if>" condition.

main
Tuzki 2 years ago
parent 859eda55e1
commit cf7961cc0d
  1. 6
      cjy-module-traceability/cjy-module-traceability-biz/src/main/resources/mapper/block/BlockMapper.xml

@ -50,11 +50,11 @@
</select>
<select id="selectList" resultMap="BlockResult">
select t1.id,t1.block_name from traceability_block t1 where t1.deleted = false and t1.base_id =#{baseId}
<where>
<if test="status == 2">
and t1.id not in (select t2.block_id from traceability_cropper t2 where t2.deleted = false and t2.plant_end = 1)
</if>
</where>
</select>
</mapper>
</mapper>

Loading…
Cancel
Save