This commit is contained in:
wangjinlei
2024-05-09 17:42:31 +08:00
parent 7d8f0d85b3
commit 14c70bb6c5
5 changed files with 74 additions and 14 deletions

View File

@@ -0,0 +1,50 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.peanut.modules.common.dao.CourseCatalogueDao">
<select id="getCanBindProductAndCourse" resultType="com.peanut.modules.common.vo.CourseCatalogueVo">
select
t1.id as courseId,
t2.id as courseCatalogueId,
t1.title as courseTitle,
t2.title as CourseCatalogueTitle,
t2.image
from course_catalogue t1
left join course t2 on t1.course_id = t2.id
where
t1.del_flag = 0
and t2.del_flag = 0
<if test="keywords !=null and keywords != ''">
and t2.title like concat('%', #{keywords} , '%')
</if>
<if test="ids.size() > 0">
and t1.id not in
<foreach collection="ids" item="menu_id" separator="," open="(" close=")">
#{menu_id}
</foreach>
</if>
limit #{page},#{limit}
</select>
<select id="getCanBindProductAndCourseCount" resultType="java.lang.Integer">
select
count(*)
from course_catalogue t1
left join course t2 on t1.course_id = t2.id
where
t1.del_flag = 0
and t2.del_flag = 0
<if test="keywords !=null and keywords != ''">
and t2.title like concat('%', #{keywords} , '%')
</if>
<if test="ids.size() > 0">
and t1.id not in
<foreach collection="ids" item="menu_id" separator="," open="(" close=")">
#{menu_id}
</foreach>
</if>
</select>
</mapper>