Procházet zdrojové kódy

搜索条件新增

change před 3 roky
rodič
revize
a0b08d0583

+ 3 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/inform/mapper/InformUserMapper.java

@@ -5,6 +5,7 @@ import com.zhongzheng.modules.inform.bo.InformUserQueryBo;
 import com.zhongzheng.modules.inform.domain.InformUser;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import com.zhongzheng.modules.inform.vo.InformUserVo;
+import org.apache.ibatis.annotations.Param;
 
 import java.util.List;
 
@@ -19,4 +20,6 @@ public interface InformUserMapper extends BaseMapper<InformUser> {
     List<InformUserVo> queryUserList(InformUserQueryBo bo);
 
     List<ExamUserApplyVo> listUserApply();
+
+    Long selectGradeId(@Param("goodsId") Long goodsId,@Param("userId") Long userId);
 }

+ 4 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/inform/service/impl/InformUserServiceImpl.java

@@ -93,6 +93,10 @@ public class InformUserServiceImpl extends ServiceImpl<InformUserMapper, InformU
                 informVo.setInformCourseVo(iInformCourseService.queryCourse(informVo.getInformId()));
                 informUserVo.setInformVo(informVo);
             }
+            if(informUserVo.getGoodsId() != null && informUserVo.getGradeId() != null){
+                Long gradeId = baseMapper.selectGradeId(informUserVo.getGoodsId(),bo.getUserId());
+                informUserVo.setGradeId(gradeId);
+            }
         }
         return informUserVos;
     }

+ 16 - 0
zhongzheng-system/src/main/resources/mapper/modules/inform/InformUserMapper.xml

@@ -129,4 +129,20 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         AND (SELECT COUNT(1) FROM user_subscribe us where us.apply_id = ea.apply_id and us.user_id = cgu.user_id and us.exam_status in (2,3,4) and us.exam_status != 1) > 0
         and (SELECT COUNT(1) FROM inform_remind_business ifb where g.business_id = ifb.business_id and ifb.remind_id = 13) >0
     </select>
+
+    <select id="selectGradeId" parameterType="map" resultType="Long">
+        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 = #{userId}
+          and cgg.goods_id = #{goodsId}
+          and cg.`status` = 1
+          and cgu.`status` = 1
+        ORDER BY cgu.create_time desc
+            LIMIT 1
+    </select>
 </mapper>