|
|
|
@ -20,14 +20,18 @@ |
|
|
|
|
</resultMap> |
|
|
|
|
|
|
|
|
|
<select id="selectBlockCropPage" resultMap="BlockCropResult"> |
|
|
|
|
select t2.id,t2.block_area,t2.block_name,t2.block_type,t2.block_color,t2.position_str,t1.species_id |
|
|
|
|
,t1.authentication_pic from traceability_cropper t1 |
|
|
|
|
left join traceability_block t2 on t1.block_id = t2.id |
|
|
|
|
where t1.deleted is false and t1.plant_end = 1 |
|
|
|
|
<if test="reqVO.blockName !=null and reqVO.blockName !=''"> and t2.block_name like concat('%',#{reqVO.blockName},'%')</if> |
|
|
|
|
<if test="reqVO.blockType !=null"> and t2.block_type =#{reqVO.blockType}</if> |
|
|
|
|
select t2.id,t2.block_area,t2.block_name,t2.block_type,t2.block_color,t2.position_str, |
|
|
|
|
(select GROUP_CONCAT(ifnull(t1.species_id,'')) from traceability_cropper t1 where t1.block_id = t2.id |
|
|
|
|
<if test="reqVO.speciesId !=null"> and t1.species_id =#{reqVO.speciesId}</if> |
|
|
|
|
group by t2.id |
|
|
|
|
order by t1.create_time desc |
|
|
|
|
and t1.deleted is false and t1.plant_end = 1 ) as species_id, |
|
|
|
|
(select GROUP_CONCAT(ifnull(t1.authentication_pic,'')) from traceability_cropper t1 where t1.block_id = t2.id |
|
|
|
|
<if test="reqVO.speciesId !=null"> and t1.species_id =#{reqVO.speciesId}</if> |
|
|
|
|
and t1.deleted is false and t1.plant_end = 1) as authentication_pic |
|
|
|
|
from traceability_block t2 |
|
|
|
|
<where> |
|
|
|
|
<if test="reqVO.blockName !=null and reqVO.blockName !=''"> and t2.block_name like concat('%',#{reqVO.blockName},'%')</if> |
|
|
|
|
<if test="reqVO.blockType !=null"> and t2.block_type =#{reqVO.blockType}</if> |
|
|
|
|
</where> |
|
|
|
|
order by t2.create_time desc |
|
|
|
|
</select> |
|
|
|
|
</mapper> |