| | |
| | | </insert> |
| | | |
| | | <update id="updateCatalogueData"> |
| | | UPDATE `train_exam`.`catalogue_data` |
| | | SET |
| | | UPDATE `catalogue_data` |
| | | <set> |
| | | <if test="companyId!=null"> |
| | | `company_id` = #{companyId}, |
| | | </if> |
| | |
| | | <if test="content!=null and content!=''"> |
| | | `content` = #{content}, |
| | | </if> |
| | | <if test="analysic!=null and analysic!=''"> |
| | | <if test="analysis!=null and analysis!=''"> |
| | | `analysis` = #{analysis}, |
| | | </if> |
| | | <if test="delFlag!=null and delFlag!=''"> |
| | | `del_flag` = #{delFlag}, |
| | | </if> |
| | | <if test="updateBy!=null and update!=''"> |
| | | <if test="updateBy!=null and updateBy!=''"> |
| | | `update_by` = #{updateBy}, |
| | | </if> |
| | | <if test="updateTime!=null"> |
| | | `update_time` = #{updateTime} |
| | | </if> |
| | | </set> |
| | | WHERE |
| | | `id` = #{id} |
| | | </update> |
| | | <update id="updateCatalogueDataFile"> |
| | | UPDATE `train_exam`.`catalogue_data_file` |
| | | UPDATE `catalogue_data_file` |
| | | <set> |
| | | <if test="catalogueId!=null"> |
| | | `catalogue_id` = #{catalogueId}, |
| | | </if> |
| | |
| | | `type` = #{type}, |
| | | </if> |
| | | <if test="delFlag != null and delFlag != ''" > |
| | | del_flag = #{item.delFlag}, |
| | | del_flag = #{delFlag}, |
| | | </if> |
| | | <if test="updateBy != null" > |
| | | update_by = #{updateBy}, |
| | |
| | | <if test="updateTime != null" > |
| | | update_time = #{updateTime} |
| | | </if> |
| | | </set> |
| | | where id = #{id} |
| | | </update> |
| | | <update id="updateCatalogueDataFileByCompanyId"> |
| | | UPDATE catalogue_data_file set del_flag = #{delFlag} ,update_by = #{updateBy} , update_time=#{updateTime} where company_id =#{companyId} and catalogue_id = #{catalogueId} |
| | | </update> |
| | | |
| | | <select id="selectCatalogueList" resultType="com.gkhy.exam.system.domain.vo.CatalogueVo"> |
| | |
| | | <if test="type!=null"> |
| | | and type = #{type} |
| | | </if> |
| | | ORDER BY create_time ASC |
| | | ORDER BY |
| | | CAST(SUBSTRING_INDEX(number, '.', 1) AS UNSIGNED) ASC, |
| | | CAST(SUBSTRING_INDEX(SUBSTRING_INDEX(number, '.', 2), '.', -1) AS UNSIGNED) ASC, -- 第二级 |
| | | CAST( |
| | | CASE |
| | | WHEN LENGTH(number) - LENGTH(REPLACE(number, '.', '')) >= 2 |
| | | THEN SUBSTRING_INDEX(number, '.', -1) |
| | | ELSE '0' |
| | | END AS UNSIGNED |
| | | ) ASC |
| | | </select> |
| | | <select id="selectCatalogueDataList" resultType="com.gkhy.exam.system.domain.vo.CatalogueDataVo"> |
| | | SELECT |
| | |
| | | SELECT |
| | | id, |
| | | `catalogue_data_id`, |
| | | company_id, |
| | | catalogue_id, |
| | | `name`, |
| | | `file_path`, |
| | | file_name, |
| | | `type`, |
| | | `create_by`, |
| | | `create_time` |
| | | FROM |
| | | catalogue_data_file |
| | | WHERE |
| | | company_id = #{companyId} and catalogue_id = #{catalogueId} |
| | | company_id = #{companyId} and catalogue_id = #{catalogueId} and del_flag =1 |
| | | </select> |
| | | <select id="selectByCompanyId" resultType="com.gkhy.exam.system.domain.CatalogueData"> |
| | | SELECT |
| | | `id`, |
| | | `company_id`, |
| | | name, |
| | | `catalogue_id`, |
| | | `content`, |
| | | `analysis`, |
| | |
| | | `update_time` |
| | | FROM |
| | | catalogue_data |
| | | where company_id = #{companyId} and del_flag = 1 |
| | | where company_id = #{companyId} and del_flag = 1 and catalogue_id = #{catalogueId} |
| | | |
| | | </select> |
| | | <select id="selectCatalogueDataById" resultType="com.gkhy.exam.system.domain.CatalogueData"> |
| | | SELECT |
| | | `id`, |
| | | `company_id`, |
| | | `catalogue_id`, |
| | | `content`, |
| | | `analysis`, |
| | | `del_flag`, |
| | | `create_by`, |
| | | `create_time`, |
| | | `update_by`, |
| | | `update_time` |
| | | FROM |
| | | catalogue_data where del_flag = 1 and id=#{catalogueDataId} |
| | | </select> |
| | | </mapper> |