WebRoot/WEB-INF/classes/com/shop/mapper/OsCategoryMapper.xml

(开头部分) 9KB

这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。

<?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.shop.dao.OsCategoryMapper">
    <resultMap id="BaseResultMap" type="com.shop.po.OsCategory">
        <id column="category_id" jdbcType="BIGINT" property="categoryId"/>
        <result column="parent_id" jdbcType="BIGINT" property="parentId"/>
        <result column="name" jdbcType="VARCHAR" property="name"/>
        <result column="sort" jdbcType="INTEGER" property="sort"/>
        <result column="type" jdbcType="TINYINT" property="type"/>
        <result column="create_time" jdbcType="TIMESTAMP" property="createTime"/>
        <result column="update_time" jdbcType="TIMESTAMP" property="updateTime"/>
        <result column="page_title" jdbcType="VARCHAR" property="pageTitle"/>
        <result column="page_description" jdbcType="VARCHAR" property="pageDescription"/>
        <result column="page_keyword" jdbcType="VARCHAR" property="pageKeyword"/>
        <result column="remarks" jdbcType="VARCHAR" property="remarks"/>
    </resultMap>
    <resultMap id="IndexCategory" type="com.shop.vo.CategoryVO">
        <id column="category_id" jdbcType="BIGINT" property="categoryId"/>
        <result column="name" jdbcType="VARCHAR" property="name"/>
        <collection property="products" ofType="com.shop.po.OsProduct">
            <id column="product_id" jdbcType="BIGINT" property="productId"/>
            <result column="product_number" jdbcType="BIGINT" property="productNumber"/>
            <result column="pname" jdbcType="VARCHAR" property="name"/>
            <result column="show_price" jdbcType="DECIMAL" property="showPrice"/>
            <result column="introduce" jdbcType="VARCHAR" property="introduce"/>
            <result column="pic_img" jdbcType="VARCHAR" property="picImg"/>
            <result column="create_time" jdbcType="TIMESTAMP" property="createTime"/>
            <result column="update_time" jdbcType="TIMESTAMP" property="updateTime"/>
            <result column="page_title" jdbcType="VARCHAR" property="pageTitle"/>
            <result column="page_description" jdbcType="VARCHAR" property="pageDescription"/>
            <result column="remarks" jdbcType="VARCHAR" property="remarks"/>
        </collection>
    </resultMap>
    <sql id="Base_Column_List">
		category_id, parent_id, name, sort, type, create_time,
		update_time, page_title,
		page_description,
		page_keyword, remarks
	</sql>
    <select id="selectByPrimaryKey" parameterType="java.lang.Long"
            resultMap="BaseResultMap">
        select
        <include refid="Base_Column_List"/>
        from os_category
        where category_id = #{categoryId,jdbcType=BIGINT}
    </select>

    <select id="selectParentCategoryByProductId" parameterType="java.lang.Long"
            resultMap="BaseResultMap">
		SELECT DISTINCT
            oc2.category_id,
            oc2. `name`
        FROM
            os_category oc1,
            os_category oc2,
            os_product_category opc
        WHERE
            oc1.category_id = opc.category_id
        AND oc1.parent_id = oc2.category_id
        AND opc.product_id = #{productId,jdbcType=BIGINT}
后面还有 211 行代码,购买后查看完整代码

24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明

AI 解读 AI

登录后可用,每次 10 算力,解读结果公开显示在下面。

还没有人解读过这个文件。