| | |
| | | <result property="delFlag" column="del_flag" /> |
| | | <result property="companyId" column="company_id" /> |
| | | <result property="privatize" column="privatize" /> |
| | | <result property="period" column="period" /> |
| | | <result property="message" column="message" /> |
| | | <result property="version" column="version" /> |
| | | <result property="createBy" column="create_by" /> |
| | | <result property="createTime" column="create_time" /> |
| | |
| | | <result property="updateTime" column="update_time" /> |
| | | <result property="remark" column="remark" /> |
| | | <result property="companyName" column="company_name" /> |
| | | <result property="categoryName" column="category_name" /> |
| | | <association property="period" javaType="java.lang.Long" select="getCoursePeriod" column="{courseId=id}"/> |
| | | </resultMap> |
| | | |
| | | <sql id="selectCourseVo"> |
| | | select a.id, a.name, a.category_id, a.status, a.logo,a.sort,a.introduce,a.state,a.company_id, |
| | | a.privatize,a.period,a.version, a.create_by, a.create_time, a.update_by, a.update_time, a.remark,b.name as company_name |
| | | select a.id, a.name, a.category_id, a.status, a.logo,a.sort,a.introduce,a.state,a.company_id,a.message, |
| | | a.privatize,a.version, a.create_by, a.create_time, a.update_by, a.update_time, a.remark,b.name as company_name,c.name as category_name |
| | | from ex_course a |
| | | left join sys_company b on b.id=a.company_id |
| | | left join sys_category c on c.id=a.category_id |
| | | </sql> |
| | | |
| | | <update id="deleteByCourseId"> |
| | | update ex_course set de_flag=1 where id=#{courseId} |
| | | update ex_course set del_flag=1 where id=#{courseId} |
| | | </update> |
| | | |
| | | <select id="selectCourseList" resultMap="ExCourseResult"> |
| | |
| | | </select> |
| | | |
| | | <select id="checkNameUnique" resultType="com.gkhy.exam.system.domain.ExCourse"> |
| | | select id,name from ex_course where name=#{name} and company_id=#{companyId} and del_flag=0 limit 1 |
| | | select id,name from ex_course where name=#{name} and del_flag=0 |
| | | <if test="companyId!=null"> |
| | | and company_id=#{companyId} |
| | | </if> |
| | | limit 1 |
| | | </select> |
| | | |
| | | <select id="selectCourseState" resultType="java.lang.Integer"> |
| | | select state from ex_course where id=#{courseId} |
| | | </select> |
| | | |
| | | <select id="selectCountByCategoryId" resultType="java.lang.Integer"> |
| | | select count(1) from ex_course where category_id=#{categoryId} and del_flag=0 |
| | | </select> |
| | | |
| | | <select id="getCoursePeriod" resultType="java.lang.Long"> |
| | | select sum(b.resource_length) from ex_course_chapter_period a |
| | | inner join ex_resource b on a.resource_id=b.id |
| | | where a.course_id=#{courseId} |
| | | </select> |
| | | </mapper> |