<?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.yami.shop.dao.ShopCategoryMapper">


    <select id="treeShopCategory" resultType="com.yami.shop.bean.vo.FrontCategoryVO">
        SELECT s.*
        FROM tz_shop_category s
                 left join tz_front_category f on s.code = f.code
        where s.shop_id = #{shopId}
          and s.is_delete = 0
          and f.is_delete = 0
    </select>

    <update id="deleteByCode">
        UPDATE tz_front_category
        SET is_delete = 1
        WHERE code = #{code}
    </update>

    <update id="deleteByParentCode">
        UPDATE tz_front_category
        SET is_delete = 1
        WHERE parent_code = #{parentCode}
    </update>
</mapper>
