浏览代码

fix 课程

he2802 4 年之前
父节点
当前提交
53075939ef

+ 15 - 1
zhongzheng-system/src/main/java/com/zhongzheng/modules/course/service/impl/CourseProjectTypeServiceImpl.java

@@ -81,7 +81,14 @@ public class CourseProjectTypeServiceImpl extends ServiceImpl<CourseProjectTypeM
     @Override
     public Boolean updateByEditBo(CourseProjectTypeEditBo bo) {
         CourseProjectType update = BeanUtil.toBean(bo, CourseProjectType.class);
-        validEntityBeforeSave(update);
+        CourseProjectTypeQueryBo courseProjectTypeQueryBo = new CourseProjectTypeQueryBo();
+        courseProjectTypeQueryBo.setProjectName(bo.getProjectName());
+        courseProjectTypeQueryBo.setEducationId(bo.getEducationId());
+        courseProjectTypeQueryBo.setId(bo.getId());
+        Collection<CourseProjectTypeVo> courseProjectTypeVos = baseMapper.queryList(courseProjectTypeQueryBo);
+        if (CollectionUtils.isEmpty(courseProjectTypeVos)){
+            validEntityBeforeSave(update);
+        }
         update.setUpdateTime(DateUtils.getNowTime());
         return this.updateById(update);
     }
@@ -92,6 +99,13 @@ public class CourseProjectTypeServiceImpl extends ServiceImpl<CourseProjectTypeM
      * @param entity 实体类数据
      */
     private void validEntityBeforeSave(CourseProjectType entity){
+        CourseProjectTypeQueryBo courseProjectTypeQueryBo = new CourseProjectTypeQueryBo();
+        courseProjectTypeQueryBo.setProjectName(entity.getProjectName());
+        courseProjectTypeQueryBo.setEducationId(entity.getEducationId());
+        Collection<CourseProjectTypeVo> courseProjectTypeVos = baseMapper.queryList(courseProjectTypeQueryBo);
+        if (!CollectionUtils.isEmpty(courseProjectTypeVos)){
+            throw new RuntimeException("项目重复");
+        }
         //TODO 做一些数据校验,如唯一约束
     }
 

+ 12 - 0
zhongzheng-system/src/main/resources/mapper/modules/course/CourseMapper.xml

@@ -96,6 +96,18 @@
         <if test="prefixName != null and prefixName != ''">
             AND c.prefix_name like concat('%', #{prefixName}, '%')
         </if>
+        <if test="courseName != null and courseName != ''">
+            AND c.course_name like concat('%', #{courseName}, '%')
+        </if>
+        <if test="publishStatus != null and publishStatus != ''">
+            AND c.publish_status = #{publishStatus}
+        </if>
+        <if test="schoolId != null and schoolId != ''">
+            AND c.school_id = #{schoolId}
+        </if>
+        <if test="majorId != null and majorId != ''">
+            AND c.major_id = #{majorId}
+        </if>
     </select>
 
     <select id="selectDetailById" parameterType="Long"  resultMap="CourseResultVo">

+ 12 - 0
zhongzheng-system/src/main/resources/mapper/modules/goods/GoodsMapper.xml

@@ -125,5 +125,17 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <if test="businessId != null and businessId != ''">
             AND g.business_id = #{businessId}
         </if>
+        <if test="schoolId != null and schoolId != ''">
+            AND g.school_id = #{schoolId}
+        </if>
+        <if test="majorId != null and majorId != ''">
+            AND g.major_id = #{majorId}
+        </if>
+          <if test="goodsStatus != null and goodsStatus != ''">
+            AND g.goods_status = #{goodsStatus}
+        </if>
+        <if test="studyStartTime != null and studyStartTime != '' and studyEndTime != null and studyEndTime != ''">
+            and #{studyStartTime} BETWEEN g.validity_start_time and g.validity_end_time or #{studyEndTime} BETWEEN g.validity_start_time and g.validity_end_time
+        </if>
     </select>
 </mapper>