<!--<?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.backendsys.mapper.Cms.CmsArticleCategoryMapper">-->

<!--    <sql id="includeArticleCategory">-->
<!--        id,-->
<!--        id article_category_id,-->
<!--        COALESCE(parent_id, '') parent_id,-->
<!--        category_name,-->
<!--        COALESCE(category_description, '') category_description,-->
<!--        sort,-->
<!--        status-->
<!--    </sql>-->

<!--    <resultMap id="resultMapArticleCategory" type="java.util.LinkedHashMap">-->
<!--        <id property="id" column="id" jdbcType="BIGINT"/>-->
<!--        <result property="parent_id" column="parent_id" javaType="java.lang.Long"/>-->
<!--        <result property="category_name" column="category_name" />-->
<!--        <result property="category_description" column="category_description" />-->
<!--        <result property="sort" column="sort" javaType="java.lang.Integer" />-->
<!--        <result property="status" column="status" javaType="java.lang.Integer" />-->
<!--    </resultMap>-->

<!--    <resultMap id="resultMapArticleCategoryDetail" type="java.util.LinkedHashMap">-->
<!--        <id property="id" column="id" jdbcType="BIGINT"/>-->
<!--        <result property="parent_id" column="parent_id" javaType="java.lang.Long"/>-->
<!--        <result property="category_name" column="category_name" />-->
<!--        <result property="category_description" column="category_description" />-->
<!--        <result property="sort" column="sort" javaType="java.lang.Integer" />-->
<!--        <result property="status" column="status" javaType="java.lang.Integer" />-->
<!--    </resultMap>-->

<!--    <select id="queryArticleCategoryList" resultMap="resultMapArticleCategory">-->
<!--        SELECT <include refid="includeArticleCategory" />-->
<!--        FROM cms_article_category-->
<!--        <where>-->
<!--            <if test="category_name != null and category_name != ''">-->
<!--                AND category_name LIKE CONCAT('%', #{category_name}, '%')-->
<!--            </if>-->
<!--            <if test="status != null and status != ''">-->
<!--                AND status = #{status}-->
<!--            </if>-->
<!--        </where>-->
<!--        ORDER BY sort DESC-->
<!--    </select>-->

<!--    <select id="queryArticleCategoryDetail" resultMap="resultMapArticleCategoryDetail">-->
<!--        SELECT <include refid="includeArticleCategory" />-->
<!--        FROM cms_article_category-->
<!--        WHERE id = #{article_category_id}-->
<!--    </select>-->

<!--    <insert id="insertArticleCategory" parameterType="com.backendsys.entity.Cms.CmsArticleCategoryDTO"-->
<!--        useGeneratedKeys="true" keyProperty="article_category_id">-->
<!--        INSERT INTO cms_article_category (category_name-->
<!--            <if test="category_description != null and category_description != ''">, category_description</if>-->
<!--            <if test="parent_id != null and parent_id != ''">, parent_id</if>-->
<!--            <if test="sort != null and sort != ''">, sort</if>-->
<!--            <if test="status != null and status != ''">, status</if>-->
<!--        )-->
<!--        VALUES (#{category_name}-->
<!--            <if test="category_description != null and category_description != ''">, #{category_description}</if>-->
<!--            <if test="parent_id != null and parent_id != ''">, #{parent_id}</if>-->
<!--            <if test="sort != null and sort != ''">, #{sort}</if>-->
<!--            <if test="status != null and status != ''">, #{status}</if>-->
<!--        )-->
<!--    </insert>-->

<!--    <update id="updateArticleCategory" parameterType="com.backendsys.entity.Cms.CmsArticleCategoryDTO"-->
<!--        useGeneratedKeys="true" keyProperty="article_category_id">-->
<!--        UPDATE cms_article_category-->
<!--        SET category_name = #{category_name}-->
<!--            <if test="category_description != null and category_description != ''">, category_description = #{category_description}</if>-->
<!--            <if test="parent_id != null and parent_id != ''">, parent_id = #{parent_id}</if>-->
<!--            <if test="sort != null and sort != ''">, sort = #{sort}</if>-->
<!--            <if test="status != null and status != ''">, status = #{status}</if>-->
<!--        WHERE id = #{article_category_id}-->
<!--    </update>-->

<!--    <delete id="deleteArticleCategory">-->
<!--        DELETE FROM cms_article_category WHERE id = #{article_category_id}-->
<!--    </delete>-->

<!--</mapper>-->