| | |
| | | VALUES |
| | | ( #{catalogueId},#{companyId}, #{name}, #{filePath},#{fileName}, #{type}, #{createBy}, #{createTime} ) |
| | | </insert> |
| | | <insert id="insertCatalogue" useGeneratedKeys="true" keyProperty="id"> |
| | | INSERT INTO `catalogue` ( `parent_id`, `number`, `mess`, `type`,`company_id` ) |
| | | VALUES |
| | | ( |
| | | #{parentId}, |
| | | #{number}, |
| | | #{mess}, |
| | | #{type}, |
| | | #{companyId} |
| | | ) |
| | | </insert> |
| | | |
| | | <update id="updateCatalogueData"> |
| | | UPDATE `catalogue_data` |
| | |
| | | <select id="selectCatalogueList" resultType="com.gkhy.exam.system.domain.vo.CatalogueVo"> |
| | | SELECT |
| | | `id`, |
| | | company_id, |
| | | `parent_id`, |
| | | `number`, |
| | | `mess`, |
| | |
| | | FROM |
| | | catalogue |
| | | WHERE del_flag = 1 |
| | | <if test="type!=null"> |
| | | <if test="type!=null and type!=''"> |
| | | and type = #{type} |
| | | </if> |
| | | <if test="companyId!=null and companyId!=''"> |
| | | and company_id = #{companyId} |
| | | </if> |
| | | ORDER BY |
| | | CAST(SUBSTRING_INDEX(number, '.', 1) AS UNSIGNED) ASC, |
| | | CAST(SUBSTRING_INDEX(SUBSTRING_INDEX(number, '.', 2), '.', -1) AS UNSIGNED) ASC, -- 第二级 |