| | |
| | | <result property="parentId" column="parent_id" /> |
| | | <result property="status" column="status" /> |
| | | <result property="sort" column="sort" /> |
| | | <result property="delFlag" column="del_flag" /> |
| | | <result property="version" column="version" /> |
| | | <result property="createBy" column="create_by" /> |
| | | <result property="createTime" column="create_time" /> |
| | |
| | | </resultMap> |
| | | |
| | | <sql id="selectCategoryVo"> |
| | | select id, name, parent_id, category_type, status,sort,version, create_by, create_time, update_by, update_time, remark |
| | | select id, name, parent_id, category_type, status,sort,del_flag,version, create_by, create_time, update_by, update_time, remark |
| | | from sys_category |
| | | </sql> |
| | | |
| | | <update id="deleteByCategoryId" parameterType="java.lang.Long"> |
| | | update sys_category set del_flag=1 where id=#{categoryId} |
| | | </update> |
| | | |
| | | <select id="selectCategoryList" resultMap="SysCategoryResult"> |
| | | <include refid="selectCategoryVo"/> |
| | | <where> |
| | | and del_flag=0 |
| | | <if test="name != null and name != ''"> |
| | | AND name like concat('%', #{name}, '%') |
| | | </if> |
| | |
| | | </select> |
| | | |
| | | <select id="checkNameUnique" resultType="com.gkhy.exam.system.domain.SysCategory"> |
| | | select id,name,parent_id from sys_category where name=#{name} and parent_id=#{parentId} limit 1 |
| | | </select> |
| | | |
| | | <select id="selectCountOfCoure" resultType="java.lang.Integer"> |
| | | select count(1) from ex_course where category_id=#{categoryId} and del_flag=0 |
| | | </select> |
| | | |
| | | <select id="selectCountOfBank" resultType="java.lang.Integer"> |
| | | select count(1) from ex_question_bank where category_id=#{categoryId} and del_flag=0 |
| | | select id,name,parent_id from sys_category where name=#{name} and parent_id=#{parentId} and del_flag=0 limit 1 |
| | | </select> |
| | | |
| | | </mapper> |