|
@@ -1,32 +1,33 @@
|
|
|
<?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.ygj.yuemum.dao.college.CollegeCurriculumCoreDao" >
|
|
|
-
|
|
|
- <resultMap id="BaseResultMap" type="com.ygj.yuemum.domain.college.CollegeCurriculumCore" >
|
|
|
- <id column="id" property="id" jdbcType="INTEGER" />
|
|
|
- <result column="c_code" property="c_code" jdbcType="INTEGER" />
|
|
|
- <result column="c_name" property="c_name" jdbcType="VARCHAR" />
|
|
|
- <result column="c_type" property="c_type" jdbcType="VARCHAR" />
|
|
|
- <result column="c_step" property="c_step" jdbcType="INTEGER" />
|
|
|
- <result column="isvideo" property="isvideo" jdbcType="INTEGER" />
|
|
|
- <result column="video_href" property="video_href" jdbcType="VARCHAR" />
|
|
|
- <result column="istest" property="istest" jdbcType="INTEGER" />
|
|
|
- <result column="testid" property="testid" jdbcType="INTEGER" />
|
|
|
- <result column="credit" property="credit" jdbcType="INTEGER" />
|
|
|
- <result column="video_length" property="video_length" jdbcType="INTEGER" />
|
|
|
- <result column="img_head_href" property="img_head_href" jdbcType="VARCHAR" />
|
|
|
- <result column="c_desc" property="c_desc" jdbcType="VARCHAR" />
|
|
|
- <result column="c_content" property="c_content" jdbcType="VARCHAR" />
|
|
|
- <result column="t_image_href" property="t_image_href" jdbcType="VARCHAR" />
|
|
|
- <result column="t_name" property="t_name" jdbcType="VARCHAR" />
|
|
|
- <result column="t_desc" property="t_desc" jdbcType="VARCHAR" />
|
|
|
- <result column="pcount" property="pcount" jdbcType="INTEGER" />
|
|
|
- <result column="positive" property="positive" jdbcType="INTEGER" />
|
|
|
- <result column="negative" property="negative" jdbcType="INTEGER" />
|
|
|
+<mapper namespace="com.ygj.yuemum.dao.college.CollegeCurriculumCoreDao">
|
|
|
+
|
|
|
+ <resultMap id="BaseResultMap" type="com.ygj.yuemum.domain.college.CollegeCurriculumCore">
|
|
|
+ <id column="id" property="id" jdbcType="INTEGER"/>
|
|
|
+ <result column="c_code" property="c_code" jdbcType="VARCHAR"/>
|
|
|
+ <result column="c_seq" property="c_seq" jdbcType="INTEGER"/>
|
|
|
+ <result column="c_name" property="c_name" jdbcType="VARCHAR"/>
|
|
|
+ <result column="c_type" property="c_type" jdbcType="VARCHAR"/>
|
|
|
+ <result column="c_step" property="c_step" jdbcType="INTEGER"/>
|
|
|
+ <result column="isvideo" property="isvideo" jdbcType="INTEGER"/>
|
|
|
+ <result column="video_href" property="video_href" jdbcType="VARCHAR"/>
|
|
|
+ <result column="istest" property="istest" jdbcType="INTEGER"/>
|
|
|
+ <result column="testid" property="testid" jdbcType="INTEGER"/>
|
|
|
+ <result column="credit" property="credit" jdbcType="INTEGER"/>
|
|
|
+ <result column="video_length" property="video_length" jdbcType="VARCHAR"/>
|
|
|
+ <result column="img_head_href" property="img_head_href" jdbcType="VARCHAR"/>
|
|
|
+ <result column="c_desc" property="c_desc" jdbcType="VARCHAR"/>
|
|
|
+ <result column="c_content" property="c_content" jdbcType="VARCHAR"/>
|
|
|
+ <result column="t_image_href" property="t_image_href" jdbcType="VARCHAR"/>
|
|
|
+ <result column="t_name" property="t_name" jdbcType="VARCHAR"/>
|
|
|
+ <result column="t_desc" property="t_desc" jdbcType="VARCHAR"/>
|
|
|
+ <result column="pcount" property="pcount" jdbcType="INTEGER"/>
|
|
|
+ <result column="positive" property="positive" jdbcType="INTEGER"/>
|
|
|
+ <result column="negative" property="negative" jdbcType="INTEGER"/>
|
|
|
</resultMap>
|
|
|
<!--获取所有数据-->
|
|
|
|
|
|
- <select id="getAll" resultType="com.ygj.yuemum.domain.college.CollegeCurriculumCore" >
|
|
|
+ <select id="getAll" resultType="com.ygj.yuemum.domain.college.CollegeCurriculumCore">
|
|
|
select
|
|
|
*
|
|
|
from college_curriculum_core
|
|
@@ -34,7 +35,98 @@
|
|
|
</select>
|
|
|
|
|
|
|
|
|
- <select id="queryCoreByStep" resultType="com.ygj.yuemum.domain.college.CollegeCurriculumCore" parameterType="com.ygj.yuemum.domain.college.CollegeCurriculumCore">
|
|
|
+ <select id="queryUserLearningCoreDetail" resultType="com.ygj.yuemum.domain.college.ReturnUserLearningCoreDetail" parameterType="com.ygj.yuemum.domain.college.CollegeCurriculumQuery">
|
|
|
+ SELECT
|
|
|
+ ccc.c_code,
|
|
|
+ ccc.c_name,
|
|
|
+ ccc.pcount,
|
|
|
+ ccc.credit,
|
|
|
+ ccc.video_length,
|
|
|
+ ccc.img_head_href,
|
|
|
+ ccc.t_image_href,
|
|
|
+ ccc.t_name,
|
|
|
+ ccc.t_desc,
|
|
|
+ ccc.c_desc,
|
|
|
+ ccc.isvideo,
|
|
|
+ ccc.istest,
|
|
|
+ (select result from college_test_detail where id = ccc.testid and openid = #{openid,jdbcType=VARCHAR}) test_result,
|
|
|
+ (select status from college_learning_detail where c_code = ccc.c_code and open_id = #{openid,jdbcType=VARCHAR} order by `status` desc limit 1) `status`,
|
|
|
+ (select rate from college_learning_detail where c_code = ccc.c_code and open_id = #{openid,jdbcType=VARCHAR} order by `status` desc limit 1) `rate`
|
|
|
+ FROM
|
|
|
+ college_curriculum_core as ccc
|
|
|
+ WHERE
|
|
|
+ id = #{id,jdbcType=INTEGER}
|
|
|
+ </select>
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ <select id="queryCoreDetail" resultType="com.ygj.yuemum.domain.college.ReturnUserLearningCoreDetail"
|
|
|
+ parameterType="com.ygj.yuemum.domain.college.CollegeCurriculumQuery">
|
|
|
+ SELECT
|
|
|
+ ccc.c_name,
|
|
|
+ ccc.pcount,
|
|
|
+ ccc.t_image_href,
|
|
|
+ ccc.t_name,
|
|
|
+ ccc.c_content,
|
|
|
+ ccc.positive,
|
|
|
+ ccc.t_desc,
|
|
|
+ ccc.isvideo,
|
|
|
+ (select status from college_learning_detail where c_code = ccc.c_code and open_id = #{openid,jdbcType=VARCHAR} order by `status` desc limit 1) `status`,
|
|
|
+ (select rate from college_learning_detail where c_code = ccc.c_code and open_id = #{openid,jdbcType=VARCHAR} order by `status` desc limit 1) `rate`
|
|
|
+ FROM
|
|
|
+ college_curriculum_core as ccc
|
|
|
+ WHERE
|
|
|
+ id = #{id,jdbcType=INTEGER}
|
|
|
+ order by id desc
|
|
|
+ </select>
|
|
|
+
|
|
|
+
|
|
|
+ <select id="queryUserLearningCore" resultType="com.ygj.yuemum.domain.college.CollegeCurriculumCore"
|
|
|
+ parameterType="com.ygj.yuemum.domain.college.CollegeCurriculumQuery">
|
|
|
+ SELECT
|
|
|
+ cc.id,
|
|
|
+ cc.c_code,
|
|
|
+ c_seq,
|
|
|
+ c_name,
|
|
|
+ c_type,
|
|
|
+ c_step,
|
|
|
+ c_desc,
|
|
|
+ cc.credit,
|
|
|
+ img_head_href,
|
|
|
+ cd.c_code AS cd_code,
|
|
|
+ IFNULL(cd.`status`,0) status,
|
|
|
+ pcount,
|
|
|
+ positive,
|
|
|
+ negative,
|
|
|
+ t_name,
|
|
|
+ t_desc,
|
|
|
+ t_image_href,
|
|
|
+ c_content,
|
|
|
+ istest,
|
|
|
+ isvideo,
|
|
|
+ testid,
|
|
|
+ video_href,
|
|
|
+ video_length
|
|
|
+ FROM
|
|
|
+ college_curriculum_core AS cc
|
|
|
+ LEFT JOIN ( SELECT * FROM college_learning_detail WHERE open_id = #{openid,jdbcType=VARCHAR} ORDER BY id DESC LIMIT 1 ) AS cd ON cc.c_code = cd.c_code
|
|
|
+ WHERE
|
|
|
+ c_type = #{c_type,jdbcType=VARCHAR}
|
|
|
+ and
|
|
|
+ c_seq <= (SELECT
|
|
|
+ max(c_seq)
|
|
|
+ FROM
|
|
|
+ college_curriculum_core
|
|
|
+ where
|
|
|
+ c_type = #{c_type,jdbcType=VARCHAR}
|
|
|
+ and
|
|
|
+ FIND_IN_SET(#{c_step,jdbcType=INTEGER},c_step))
|
|
|
+ ORDER BY
|
|
|
+ c_seq desc
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <select id="queryCoreByStep" resultType="com.ygj.yuemum.domain.college.CollegeCurriculumCore"
|
|
|
+ parameterType="com.ygj.yuemum.domain.college.CollegeCurriculumCore">
|
|
|
select
|
|
|
*
|
|
|
from college_curriculum_core
|
|
@@ -46,202 +138,212 @@
|
|
|
</select>
|
|
|
|
|
|
|
|
|
- <select id="selectByPrimaryKey" resultType="com.ygj.yuemum.domain.college.CollegeCurriculumCore" parameterType="java.lang.Integer" >
|
|
|
+ <select id="selectByPrimaryKey" resultType="com.ygj.yuemum.domain.college.CollegeCurriculumCore"
|
|
|
+ parameterType="java.lang.Integer">
|
|
|
select
|
|
|
*
|
|
|
from college_curriculum_core
|
|
|
where id = #{id,jdbcType=INTEGER}
|
|
|
</select>
|
|
|
|
|
|
- <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer" >
|
|
|
+ <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
|
|
|
delete from college_curriculum_core
|
|
|
where id = #{id,jdbcType=INTEGER}
|
|
|
</delete>
|
|
|
|
|
|
- <insert id="insertSelective" parameterType="com.ygj.yuemum.domain.college.CollegeCurriculumCore" >
|
|
|
+ <insert id="insertSelective" parameterType="com.ygj.yuemum.domain.college.CollegeCurriculumCore">
|
|
|
insert into college_curriculum_core
|
|
|
- <trim prefix="(" suffix=")" suffixOverrides="," >
|
|
|
- <if test="c_code != null" >
|
|
|
+ <trim prefix="(" suffix=")" suffixOverrides=",">
|
|
|
+ <if test="c_code != null">
|
|
|
c_code,
|
|
|
</if>
|
|
|
- <if test="c_name != null" >
|
|
|
+ <if test="c_seq != null">
|
|
|
+ c_seq,
|
|
|
+ </if>
|
|
|
+ <if test="c_name != null">
|
|
|
c_name,
|
|
|
</if>
|
|
|
- <if test="c_type != null" >
|
|
|
+ <if test="c_type != null">
|
|
|
c_type,
|
|
|
</if>
|
|
|
- <if test="c_step != null" >
|
|
|
+ <if test="c_step != null">
|
|
|
c_step,
|
|
|
</if>
|
|
|
- <if test="isvideo != null" >
|
|
|
+ <if test="isvideo != null">
|
|
|
isvideo,
|
|
|
</if>
|
|
|
- <if test="video_href != null" >
|
|
|
+ <if test="video_href != null">
|
|
|
video_href,
|
|
|
</if>
|
|
|
|
|
|
- <if test="istest != null" >
|
|
|
+ <if test="istest != null">
|
|
|
istest,
|
|
|
</if>
|
|
|
- <if test="testid != null" >
|
|
|
+ <if test="testid != null">
|
|
|
testid,
|
|
|
</if>
|
|
|
- <if test="credit != null" >
|
|
|
+ <if test="credit != null">
|
|
|
credit,
|
|
|
</if>
|
|
|
- <if test="video_length != null" >
|
|
|
+ <if test="video_length != null">
|
|
|
video_length,
|
|
|
</if>
|
|
|
- <if test="img_head_href != null" >
|
|
|
+ <if test="img_head_href != null">
|
|
|
img_head_href,
|
|
|
</if>
|
|
|
- <if test="c_desc != null" >
|
|
|
+ <if test="c_desc != null">
|
|
|
c_desc,
|
|
|
</if>
|
|
|
- <if test="c_content != null" >
|
|
|
+ <if test="c_content != null">
|
|
|
c_content,
|
|
|
</if>
|
|
|
- <if test="t_image_href != null" >
|
|
|
+ <if test="t_image_href != null">
|
|
|
t_image_href,
|
|
|
</if>
|
|
|
- <if test="t_name != null" >
|
|
|
+ <if test="t_name != null">
|
|
|
t_name,
|
|
|
</if>
|
|
|
- <if test="video_href != null" >
|
|
|
+ <if test="video_href != null">
|
|
|
video_href,
|
|
|
</if>
|
|
|
- <if test="t_desc != null" >
|
|
|
+ <if test="t_desc != null">
|
|
|
t_desc,
|
|
|
</if>
|
|
|
- <if test="pcount != null" >
|
|
|
+ <if test="pcount != null">
|
|
|
pcount,
|
|
|
</if>
|
|
|
- <if test="positive != null" >
|
|
|
+ <if test="positive != null">
|
|
|
positive,
|
|
|
</if>
|
|
|
- <if test="negative != null" >
|
|
|
+ <if test="negative != null">
|
|
|
negative
|
|
|
</if>
|
|
|
</trim>
|
|
|
- <trim prefix="values (" suffix=")" suffixOverrides="," >
|
|
|
- <if test="c_code != null" >
|
|
|
+ <trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
|
+ <if test="c_code != null">
|
|
|
#{c_code,jdbcType=VARCHAR},
|
|
|
</if>
|
|
|
- <if test="c_name != null" >
|
|
|
+ <if test="c_seq != null">
|
|
|
+ #{c_seq,jdbcType=INTEGER},
|
|
|
+ </if>
|
|
|
+ <if test="c_name != null">
|
|
|
#{c_name,jdbcType=VARCHAR},
|
|
|
</if>
|
|
|
- <if test="c_type != null" >
|
|
|
+ <if test="c_type != null">
|
|
|
#{c_type,jdbcType=VARCHAR},
|
|
|
</if>
|
|
|
- <if test="c_step != null" >
|
|
|
+ <if test="c_step != null">
|
|
|
#{c_step,jdbcType=INTEGER},
|
|
|
</if>
|
|
|
- <if test="isvideo != null" >
|
|
|
+ <if test="isvideo != null">
|
|
|
#{isvideo,jdbcType=INTEGER},
|
|
|
</if>
|
|
|
- <if test="video_href != null" >
|
|
|
+ <if test="video_href != null">
|
|
|
#{video_href,jdbcType=VARCHAR},
|
|
|
</if>
|
|
|
- <if test="istest != null" >
|
|
|
+ <if test="istest != null">
|
|
|
#{istest,jdbcType=INTEGER},
|
|
|
</if>
|
|
|
- <if test="testid != null" >
|
|
|
+ <if test="testid != null">
|
|
|
#{testid,jdbcType=INTEGER},
|
|
|
</if>
|
|
|
- <if test="credit != null" >
|
|
|
+ <if test="credit != null">
|
|
|
#{credit,jdbcType=INTEGER},
|
|
|
</if>
|
|
|
- <if test="video_length != null" >
|
|
|
- #{video_length,jdbcType=INTEGER},
|
|
|
+ <if test="video_length != null">
|
|
|
+ #{video_length,jdbcType=VARCHAR},
|
|
|
</if>
|
|
|
- <if test="img_head_href != null" >
|
|
|
+ <if test="img_head_href != null">
|
|
|
#{img_head_href,jdbcType=VARCHAR},
|
|
|
</if>
|
|
|
- <if test="c_desc != null" >
|
|
|
+ <if test="c_desc != null">
|
|
|
#{c_desc,jdbcType=VARCHAR},
|
|
|
</if>
|
|
|
- <if test="c_content != null" >
|
|
|
+ <if test="c_content != null">
|
|
|
#{c_content,jdbcType=VARCHAR},
|
|
|
</if>
|
|
|
- <if test="t_image_href != null" >
|
|
|
+ <if test="t_image_href != null">
|
|
|
#{t_image_href,jdbcType=VARCHAR},
|
|
|
</if>
|
|
|
- <if test="t_name != null" >
|
|
|
+ <if test="t_name != null">
|
|
|
#{t_name,jdbcType=VARCHAR},
|
|
|
</if>
|
|
|
- <if test="t_desc != null" >
|
|
|
+ <if test="t_desc != null">
|
|
|
#{t_desc,jdbcType=VARCHAR},
|
|
|
</if>
|
|
|
- <if test="pcount != null" >
|
|
|
+ <if test="pcount != null">
|
|
|
#{pcount,jdbcType=VARCHAR},
|
|
|
</if>
|
|
|
- <if test="positive != null" >
|
|
|
+ <if test="positive != null">
|
|
|
#{positive,jdbcType=INTEGER},
|
|
|
</if>
|
|
|
- <if test="negative != null" >
|
|
|
+ <if test="negative != null">
|
|
|
#{negative,jdbcType=INTEGER}
|
|
|
</if>
|
|
|
</trim>
|
|
|
</insert>
|
|
|
|
|
|
- <update id="updateByPrimaryKeySelective" parameterType="com.ygj.yuemum.domain.college.CollegeCurriculumCore" >
|
|
|
+ <update id="updateByPrimaryKeySelective" parameterType="com.ygj.yuemum.domain.college.CollegeCurriculumCore">
|
|
|
update college_curriculum_core
|
|
|
- <set >
|
|
|
- <if test="c_code != null" >
|
|
|
+ <set>
|
|
|
+ <if test="c_code != null">
|
|
|
c_code = #{c_code,jdbcType=VARCHAR},
|
|
|
</if>
|
|
|
- <if test="c_name != null" >
|
|
|
+ <if test="c_seq != null">
|
|
|
+ c_seq = #{c_seq,jdbcType=INTEGER},
|
|
|
+ </if>
|
|
|
+ <if test="c_name != null">
|
|
|
c_name = #{c_name,jdbcType=VARCHAR},
|
|
|
</if>
|
|
|
- <if test="c_type != null" >
|
|
|
+ <if test="c_type != null">
|
|
|
c_type = #{c_type,jdbcType=VARCHAR},
|
|
|
</if>
|
|
|
- <if test="c_step != null" >
|
|
|
+ <if test="c_step != null">
|
|
|
c_step = #{c_step,jdbcType=INTEGER},
|
|
|
</if>
|
|
|
- <if test="isvideo != null" >
|
|
|
+ <if test="isvideo != null">
|
|
|
isvideo = #{isvideo,jdbcType=INTEGER},
|
|
|
</if>
|
|
|
- <if test="video_href != null" >
|
|
|
+ <if test="video_href != null">
|
|
|
video_href = #{video_href,jdbcType=VARCHAR},
|
|
|
</if>
|
|
|
- <if test="istest != null" >
|
|
|
+ <if test="istest != null">
|
|
|
istest = #{istest,jdbcType=INTEGER},
|
|
|
</if>
|
|
|
- <if test="testid != null" >
|
|
|
+ <if test="testid != null">
|
|
|
testid = #{testid,jdbcType=INTEGER},
|
|
|
</if>
|
|
|
- <if test="credit != null" >
|
|
|
+ <if test="credit != null">
|
|
|
credit = #{credit,jdbcType=INTEGER},
|
|
|
</if>
|
|
|
- <if test="video_length != null" >
|
|
|
- video_length = #{video_length,jdbcType=INTEGER},
|
|
|
+ <if test="video_length != null">
|
|
|
+ video_length = #{video_length,jdbcType=VARCHAR},
|
|
|
</if>
|
|
|
- <if test="img_head_href != null" >
|
|
|
+ <if test="img_head_href != null">
|
|
|
img_head_href = #{img_head_href,jdbcType=VARCHAR},
|
|
|
</if>
|
|
|
- <if test="c_desc != null" >
|
|
|
+ <if test="c_desc != null">
|
|
|
c_desc = #{c_desc,jdbcType=VARCHAR},
|
|
|
</if>
|
|
|
- <if test="c_content != null" >
|
|
|
+ <if test="c_content != null">
|
|
|
c_content = #{c_content,jdbcType=VARCHAR},
|
|
|
</if>
|
|
|
- <if test="t_image_href != null" >
|
|
|
+ <if test="t_image_href != null">
|
|
|
t_image_href = #{t_image_href,jdbcType=VARCHAR},
|
|
|
</if>
|
|
|
- <if test="t_name != null" >
|
|
|
+ <if test="t_name != null">
|
|
|
t_name = #{t_name,jdbcType=VARCHAR},
|
|
|
</if>
|
|
|
- <if test="t_desc != null" >
|
|
|
+ <if test="t_desc != null">
|
|
|
t_desc = #{t_desc,jdbcType=VARCHAR},
|
|
|
</if>
|
|
|
- <if test="pcount != null" >
|
|
|
+ <if test="pcount != null">
|
|
|
pcount = #{pcount,jdbcType=INTEGER},
|
|
|
</if>
|
|
|
- <if test="positive != null" >
|
|
|
+ <if test="positive != null">
|
|
|
positive = #{positive,jdbcType=INTEGER},
|
|
|
</if>
|
|
|
- <if test="negative != null" >
|
|
|
+ <if test="negative != null">
|
|
|
negative = #{negative,jdbcType=INTEGER}
|
|
|
</if>
|
|
|
</set>
|