Kaynağa Gözat

fix查询材料库、外协库四个值

LLL 1 yıl önce
ebeveyn
işleme
fea824f150

+ 6 - 6
module_kzks/src/main/java/org/jeecg/modules/costModelClPrice/mapper/xml/CostModelClPriceMapper.xml

@@ -3,9 +3,9 @@
 <mapper namespace="org.jeecg.modules.costModelClPrice.mapper.CostModelClPriceMapper">
 
     <select id="selectClPriceValue" parameterType="org.jeecg.modules.costModelXmxqCl.entity.CostModelXmxqCl" resultType="org.jeecg.modules.costModelXmxqCl.entity.CostModelXmxqCl">
-        select max(CONVERT(danjia, DECIMAL)) as maxDanjia,
-               min(CONVERT(danjia, DECIMAL)) as minDanjia,
-               avg(CONVERT(danjia, DECIMAL)) as aveDanjia,
+        select ifnull(max(CONVERT(danjia, DECIMAL)),0) as maxDanjia,
+               ifnull(min(CONVERT(danjia, DECIMAL)),0) as minDanjia,
+               ifnull(avg(CONVERT(danjia, DECIMAL)),0) as aveDanjia,
                ifnull((select danjia from kzks_cost_model_cl_price
             <where>
                 <if test="wlbm != null  and wlbm != ''">and wlbm = #{wlbm}</if>
@@ -14,9 +14,9 @@
                 <if test="pici != null  and pici != ''">and pici = #{pici}</if>
             </where>
                ORDER BY caigou_time DESC limit 1),0) as recentDanjia,
-               max(CONVERT(danjia, DECIMAL)) * #{number} as maxPrice,
-               min(CONVERT(danjia, DECIMAL)) * #{number} as minPrice,
-               avg(CONVERT(danjia, DECIMAL)) * #{number} as avePrice,
+               ifnull(max(CONVERT(danjia, DECIMAL)),0) * #{number} as maxPrice,
+               ifnull(min(CONVERT(danjia, DECIMAL)),0) * #{number} as minPrice,
+               ifnull(avg(CONVERT(danjia, DECIMAL)),0) * #{number} as avePrice,
                ifnull((select danjia from kzks_cost_model_cl_price
             <where>
                 <if test="wlbm != null  and wlbm != ''">and wlbm = #{wlbm}</if>

+ 8 - 8
module_kzks/src/main/java/org/jeecg/modules/costModelWxPrice/mapper/xml/CostModelWxPriceMapper.xml

@@ -4,14 +4,14 @@
 
     <select id="selectWxPriceValue" parameterType="org.jeecg.modules.costModelXmxqWx.entity.CostModelXmxqWx" resultType="org.jeecg.modules.costModelXmxqWx.entity.CostModelXmxqWx">
         select
-        CONVERT(max_price, DECIMAL) as maxDanjia,
-        CONVERT(min_price, DECIMAL) as minDanjia,
-        CONVERT(ave_price, DECIMAL) as aveDanjia,
-        CONVERT(ave_price, DECIMAL) as recentDanjia,
-        CONVERT(max_price, DECIMAL) * #{number} as maxPrice,
-        CONVERT(min_price, DECIMAL) * #{number} as minPrice,
-        CONVERT(ave_price, DECIMAL) * #{number} as avePrice,
-        CONVERT(ave_price, DECIMAL) * #{number} as recentPrice,
+        ifnull(CONVERT(max_price, DECIMAL),0) as maxDanjia,
+        ifnull(CONVERT(min_price, DECIMAL),0) as minDanjia,
+        ifnull(CONVERT(ave_price, DECIMAL),0) as aveDanjia,
+        ifnull(CONVERT(ave_price, DECIMAL),0) as recentDanjia,
+        ifnull(CONVERT(max_price, DECIMAL),0) * #{number} as maxPrice,
+        ifnull(CONVERT(min_price, DECIMAL),0) * #{number} as minPrice,
+        ifnull(CONVERT(ave_price, DECIMAL),0) * #{number} as avePrice,
+        ifnull(CONVERT(ave_price, DECIMAL),0) * #{number} as recentPrice,
         #{xiangmuId} as xiangmuId,
         #{xiangmuName} as xiangmuName,
         #{wxProject} as wxProject,