课程修改第二次
parent
b7730707c5
commit
795e3e5461
@ -0,0 +1,51 @@
|
|||||||
|
<?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.zhiyun.zhiyun03.course.mapper.CourseMapper">
|
||||||
|
|
||||||
|
|
||||||
|
<update id="updateCourseById">
|
||||||
|
update course
|
||||||
|
<set >
|
||||||
|
<if test="courseName != null" >
|
||||||
|
course_name=#{courseName},
|
||||||
|
</if>
|
||||||
|
<if test="courseUrl != null" >
|
||||||
|
course_url=#{courseUrl},
|
||||||
|
</if>
|
||||||
|
<if test="courseBrief != null" >
|
||||||
|
course_brief=#{courseBrief},
|
||||||
|
</if>
|
||||||
|
<if test="dirId != null" >
|
||||||
|
dir_id=#{dirId},
|
||||||
|
</if>
|
||||||
|
<if test="courseIcon != null" >
|
||||||
|
course_icon=#{courseIcon}
|
||||||
|
</if>
|
||||||
|
</set>
|
||||||
|
<where>
|
||||||
|
<if test="id!=null">
|
||||||
|
id = #{id}
|
||||||
|
</if>
|
||||||
|
</where>
|
||||||
|
</update>
|
||||||
|
|
||||||
|
|
||||||
|
<select id="queryCourse" resultType="com.zhiyun.zhiyun03.course.vo.CourseVo">
|
||||||
|
select c.id,c.course_name,c.course_brief,c.course_url,d.dir_name,c.course_icon,c.course_addtime,c.course_updatetime
|
||||||
|
from course as c
|
||||||
|
inner join
|
||||||
|
(select * from directory) as d
|
||||||
|
on c.dir_id = d.id
|
||||||
|
-- where d.id=c.dir_id
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="queryCourseById" resultType="com.zhiyun.zhiyun03.course.vo.CourseVo">
|
||||||
|
select c.id,c.course_name,c.course_brief,c.course_url,d.dir_name,c.course_icon,c.course_addtime,c.course_updatetime
|
||||||
|
from course as c
|
||||||
|
inner join
|
||||||
|
(select * from directory) as d
|
||||||
|
on c.dir_id = d.id
|
||||||
|
where c.id =#{id}
|
||||||
|
</select>
|
||||||
|
|
||||||
|
</mapper>
|
Loading…
Reference in New Issue