智慧农业后台管理
guoshilong
2022-09-27 d1dfff01c9a4d0e502596f575a227ee78cfbb15b
大屏修改加工产品统计
3 files modified
14 ■■■■■ changed files
src/main/java/org/springblade/modules/lang/mapper/LandMapper.xml 7 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/process/mapper/ProcessMapper.xml 3 ●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/processInv/mapper/ProcessInvMapper.xml 4 ●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/lang/mapper/LandMapper.xml
@@ -127,7 +127,7 @@
    <!--详情信息(自定义查询)-->
    <select id="getLandInfo" resultType="org.springblade.modules.lang.vo.LandVO">
        select DISTINCT
        select
               l.user_id,
               l.land_name,
               l.land_type,
@@ -138,12 +138,11 @@
               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>
    <!--自定义地块数据-->
src/main/java/org/springblade/modules/process/mapper/ProcessMapper.xml
@@ -74,12 +74,13 @@
    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">
src/main/java/org/springblade/modules/processInv/mapper/ProcessInvMapper.xml
@@ -96,14 +96,12 @@
    <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">