he2802 2 år sedan
förälder
incheckning
3ad7e56ea1

+ 10 - 9
zhongzheng-system/src/main/resources/mapper/modules/order/OrderBusinessConfigGoodsMapper.xml

@@ -63,16 +63,16 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 
     <select id="selectList" parameterType="com.zhongzheng.modules.order.bo.OrderBusinessConfigGoodsQueryBo" resultMap="OrderBusinessConfigGoodsVoResult">
         SELECT
-            bcg.*,
-            cs.subject_name,
-            obc.config_name
+        bcg.config_id,
+        any_value ( obc.config_name ) config_name,
+        group_concat( bcg.goods_ids ) goods_ids
         FROM
-            order_business_config_goods bcg
-            LEFT JOIN order_business_config obc ON bcg.config_id = obc.id
-            LEFT JOIN course_business cb ON obc.business_id = cb.id
-            LEFT JOIN course_project_type cpt ON cb.project_id = cpt.id
-            LEFT JOIN course_education_type cet ON cet.id = cpt.education_id
-                LEFT JOIN course_subject cs on bcg.subject_id = cs.id
+        order_business_config_goods bcg
+        LEFT JOIN order_business_config obc ON bcg.config_id = obc.id
+        LEFT JOIN course_business cb ON obc.business_id = cb.id
+        LEFT JOIN course_project_type cpt ON cb.project_id = cpt.id
+        LEFT JOIN course_education_type cet ON cet.id = cpt.education_id
+        LEFT JOIN course_subject cs on bcg.subject_id = cs.id
         WHERE
         obc.`status` = 1
         and bcg.`status` = 1
@@ -106,6 +106,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <if test="subjectName != null and subjectName != ''">
             and cs.subject_name = #{subjectName}
         </if>
+        GROUP BY bcg.config_id
     </select>
 
 </mapper>