智慧农业后台管理
Administrator
2022-07-01 0ea162c9bbd4e2ac337aae567005369fbc911032
src/main/java/org/springblade/modules/farm/mapper/FarmingRecordMapper.xml
@@ -123,4 +123,28 @@
        WHERE DATE_FORMAT(time, '%Y%m') = DATE_FORMAT(CURDATE(), '%Y%m')
          and dept_id = #{deptId}
    </select>
    <!--查询农事记录信息(种植开始起)-->
    <select id="getFarmingRecordByFarmPlantId" resultType="org.springblade.modules.farm.vo.FarmingRecordVO">
        select bu.real_name realName,sfr.time,case
                   when type = 0 then '施肥'
                   when type = 1 then '翻耕'
                   when type = 2 then '灌溉'
                   when type = 3 then '起垄'
                   when type = 4 then '用药'
                   when type = 5 then '追肥'
                   when type = 6 then '除草'
                   when type = 7 then '修剪'
                   when type = 8 then '浸种'
                   when type = 9 then '拌种'
                   when type = 10 then '移栽'
                   when type = 11 then '直播'
                   when type = 12 then '采收'
                   else '其他' end as typeName
        from sys_farming_record sfr
        left join blade_user bu on bu.id = sfr.operator
        where land_id = #{recovery.landId}
        and strain_id = #{recovery.strainId}
        order by sfr.time desc,sfr.create_time desc
    </select>
</mapper>