ソースを参照

搜索条件新增

change 3 年 前
コミット
83761d4e8d

+ 4 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/user/service/impl/UserPlanServiceImpl.java

@@ -11,6 +11,7 @@ import com.zhongzheng.common.utils.DateUtils;
 import com.zhongzheng.modules.course.vo.CourseVo;
 import com.zhongzheng.modules.goods.vo.GoodsUserVo;
 import com.zhongzheng.modules.goods.vo.GoodsVo;
+import com.zhongzheng.modules.inform.mapper.InformUserMapper;
 import com.zhongzheng.modules.user.bo.UserPlanGoodsAddBo;
 import com.zhongzheng.modules.user.domain.UserPlanGoods;
 import com.zhongzheng.modules.user.service.IUserPlanCourceService;
@@ -50,6 +51,9 @@ public class UserPlanServiceImpl extends ServiceImpl<UserPlanMapper, UserPlan> i
     @Autowired
     private IUserPlanGoodsService userPlanGoodsService;
 
+    @Autowired
+    private InformUserMapper informUserMapper;
+
 
 
     @Override

+ 24 - 10
zhongzheng-system/src/main/resources/mapper/modules/inform/InformUserMapper.xml

@@ -132,17 +132,31 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 
     <select id="selectGradeId" parameterType="map" resultType="Long">
         SELECT
-            cgu.grade_id
+            g.*,
+            (SELECT cet.education_name FROM  course_education_type cet  where cet.id = g.education_type_id) as education_name,
+            (SELECT cet.project_name FROM  course_project_type cet where cet.id = g.project_id) as project_name,
+            (SELECT cet.business_name FROM  course_business cet  where cet.id = g.business_id) as business_name,
+            ( SELECT
+                  cgu.grade_id
+              FROM
+                  class_grade_user cgu
+                      LEFT JOIN class_grade_goods cgg on cgu.grade_id = cgg.grade_id
+                      LEFT JOIN class_grade cg on cg.grade_id = cgg.grade_id
+              WHERE
+                  cgu.user_id = up.user_id
+                and cgg.goods_id = upg.source_id
+                and cg.`status` = 1
+                and cgu.`status` = 1
+              ORDER BY cgu.create_time desc
+            LIMIT 1) as gradeId
+
         FROM
-            class_grade_user cgu
-                LEFT JOIN class_grade_goods cgg on cgu.grade_id = cgg.grade_id
-                LEFT JOIN class_grade cg on cg.grade_id = cgg.grade_id
+            goods g
+            LEFT JOIN user_plan_goods upg on g.goods_id = upg.source_id
+            LEFT JOIN user_plan up on upg.plan_id = up.plan_id
         WHERE
-            cgu.user_id = #{userId}
-          and cgg.goods_id = #{goodsId}
-          and cg.`status` = 1
-          and cgu.`status` = 1
-        ORDER BY cgu.create_time desc
-            LIMIT 1
+            1=1
+          and upg.plan_id=#{planId}
+          and g.goods_type =1
     </select>
 </mapper>

+ 1 - 1
zhongzheng-system/src/main/resources/mapper/modules/user/UserPlanGoodsMapper.xml

@@ -129,7 +129,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             g.*,
             (SELECT cet.education_name FROM  course_education_type cet  where cet.id = g.education_type_id) as education_name,
             (SELECT cet.project_name FROM  course_project_type cet where cet.id = g.project_id) as project_name,
-            (SELECT cet.business_name FROM  course_business cet  where cet.id = g.business_id) as business_name
+            (SELECT cet.business_name FROM  course_business cet  where cet.id = g.business_id) as business_name,
         FROM
             goods g
                 LEFT JOIN user_plan_goods upg on g.goods_id = upg.source_id