|
|
|
@ -55,4 +55,38 @@ |
|
|
|
|
<select id="getFarmingRecordsCount" resultType="java.lang.Integer"> |
|
|
|
|
select count(*) from traceability_husbandry_record where cropper_id=#{cropperId} and batch=#{batch} and deleted=0 |
|
|
|
|
</select> |
|
|
|
|
<select id="selectRecoveryRecordPage" |
|
|
|
|
resultType="com.cjy.traceability.module.traceability.controller.admin.recoveryrecord.vo.RecoveryRecordRespVO"> |
|
|
|
|
SELECT |
|
|
|
|
t.id, |
|
|
|
|
t.cropper_id, |
|
|
|
|
t.product_name, |
|
|
|
|
t.batch, |
|
|
|
|
t.husbandry_id, |
|
|
|
|
t.production, |
|
|
|
|
t.job_time, |
|
|
|
|
t.operator, |
|
|
|
|
t.job_way, |
|
|
|
|
t3.species_name, |
|
|
|
|
t2.block_name, |
|
|
|
|
t4.quality_result, |
|
|
|
|
t4.quality_inspection |
|
|
|
|
FROM |
|
|
|
|
traceability_recovery_record t |
|
|
|
|
LEFT JOIN traceability_cropper t1 ON t1.id = t.cropper_id |
|
|
|
|
LEFT JOIN traceability_block t2 ON t2.id = t1.block_id |
|
|
|
|
LEFT JOIN traceability_species t3 ON t3.id = t1.species_id |
|
|
|
|
LEFT JOIN traceability_product t4 ON t4.cropper_id = t.cropper_id AND t4.batch = t.batch |
|
|
|
|
<where> |
|
|
|
|
<if test="reqVO.productName != null and reqVO.productName != ''"> AND t.product_name LIKE CONCAT( '%', #{reqVO.productName}, '%' )</if> |
|
|
|
|
<if test="reqVO.batch != null and reqVO.batch != ''"> AND t.batch = #{reqVO.batch}</if> |
|
|
|
|
<if test="reqVO.jobTime != null and reqVO.jobTime.length == 2"> |
|
|
|
|
AND t.job_time BETWEEN #{reqVO.jobTime[0]} AND #{reqVO.jobTime[1]} |
|
|
|
|
</if> |
|
|
|
|
<if test="reqVO.baseId != null and reqVO.baseId != ''"> AND t2.base_id = #{reqVO.baseId}</if> |
|
|
|
|
AND t.deleted = 0 |
|
|
|
|
</where> |
|
|
|
|
ORDER BY |
|
|
|
|
t.job_time DESC |
|
|
|
|
</select> |
|
|
|
|
</mapper> |
|
|
|
|