| | |
| | | |
| | | <!--详情信息(自定义查询)--> |
| | | <select id="getLandInfo" resultType="org.springblade.modules.lang.vo.LandVO"> |
| | | select DISTINCT |
| | | select |
| | | l.user_id, |
| | | l.land_name, |
| | | l.land_type, |
| | |
| | | l.url, |
| | | bdb.dict_value dica |
| | | from sys_land l |
| | | LEFT JOIN blade_dict_biz bdb ON bdb.dict_key =l.land_unit |
| | | LEFT JOIN blade_dict_biz bdb ON l.land_unit = bdb.dict_key |
| | | where 1 = 1 |
| | | and l.is_deleted = 0 |
| | | AND bdb.code = 'landunit' |
| | | AND bdb.code = 'landunit' AND bdb.tenant_id = '000000' AND bdb.is_deleted = 0 |
| | | and l.id = #{land.id} |
| | | GROUP BY l.user_id,l.land_name,l.land_type,l.land_area,landRange,l.type,l.land_unit,l.url,dica |
| | | </select> |
| | | |
| | | <!--自定义地块数据--> |
| | |
| | | SELECT SUM(p.process_num) AS sum |
| | | FROM sys_process p |
| | | LEFT JOIN sys_land land ON land.id = p.land_id |
| | | LEFT JOIN sys_process_inv inv ON inv.product_id = p.process_id |
| | | WHERE 1=1 AND p.is_deleted = 0 |
| | | <if test="year!=null and year!=''"> |
| | | and YEAR ( p.sale_time ) = #{year} |
| | | </if> |
| | | <if test="farmId!=null and farmId!=''"> |
| | | and land.farm_id = #{farmId} |
| | | and (land.farm_id = #{farmId} or inv.fps_id = #{farmId}) |
| | | </if> |
| | | </select> |
| | | <select id="statisticsMonth" resultType="java.util.Map"> |
| | |
| | | <select id="statisticsStock" resultType="java.lang.Double"> |
| | | SELECT SUM(inv.product_inventory_num) as sum |
| | | FROM sys_process_inv inv |
| | | LEFT JOIN sys_farm_product_stock sfps ON sfps.id = inv.fps_id |
| | | LEFT JOIN sys_land land ON land.id = sfps.land_id |
| | | WHERE 1=1 AND inv.is_deleted = 0 |
| | | <if test="year!=null and year!=''"> |
| | | and YEAR ( inv.create_time ) = #{year} |
| | | </if> |
| | | <if test="farmId!=null and farmId!=''"> |
| | | and land.farm_id = #{farmId} |
| | | and inv.fps_id = #{farmId} |
| | | </if> |
| | | </select> |
| | | <select id="selectByFarmIdProductId" resultType="org.springblade.modules.processInv.entity.ProcessInv"> |