hanfucheng 9 hónapja
szülő
commit
4e9353dde9

+ 17 - 9
src/main/resources/mapper/housingconstruction/CenterdataTHousingconstructionViewMapper.xml

@@ -163,16 +163,23 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     </select>
 
     <select id="getRealnameuserList" parameterType="CenterdataTHousingconstructionRealnameuser" resultType="map">
-        SELECT a.enterprise_user_type type,
-               count(a.id) num
-        FROM centerdata_t_housingconstruction_realnameuser a
-                 LEFT JOIN ${database_system}.sys_dept d ON a.dept_id = d.dept_id
-        <where>
-            <if test="enterpriseId != null  and enterpriseId != ''"> and a.enterprise_id = #{enterpriseId}</if>
-            ${params.dataScope}
-        </where>
+        SELECT
+            b.dict_value type,
+            count( a.id ) num
+        FROM
+            ${database_system}.sys_dict_data b
+            LEFT JOIN ( SELECT a.id, a.enterprise_user_type FROM
+                        centerdata_t_housingconstruction_realnameuser a
+                        LEFT JOIN ${database_system}.sys_dept d ON a.dept_id = d.dept_id
+                        <where>
+                            <if test="enterpriseId != null  and enterpriseId != ''"> and a.enterprise_id = #{enterpriseId}</if>
+                            ${params.dataScope}
+                        </where>
+                        ) a ON a.enterprise_user_type = b.dict_value
+        WHERE
+            b.dict_type = 'enterprise_user_type'
         GROUP BY
-            a.enterprise_user_type
+            b.dict_value
     </select>
 
     <select id="getDeliverymanList" parameterType="CenterdataTHousingconstructionDeliveryPersonnel" resultType="map">
@@ -337,6 +344,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             a.state = 'state_4'
         <if test="enterpriseId != null  and enterpriseId != ''"> and a.enterprise_id = #{enterpriseId}</if>
         <if test="steelcylinderNumber != null  and steelcylinderNumber != ''"> and a.steelcylinder_number like concat('%', #{steelcylinderNumber}, '%')</if>
+        <if test="state != null  and state != ''"> and DATE( b.delivery_time ) = DATE( NOW( ) )</if>
             ${params.dataScope}
     </select>