tangchuanxing_branch
CR7 9 months ago
parent d6e9456248
commit e30358b7b5

@ -0,0 +1,34 @@
<?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.BrandMapper">
<!-- resultMap定义了数据库表字段与Java对象属性之间的映射关系 -->
<resultMap id="BaseResultMap" type="com.yami.shop.bean.model.Brand">
<!--
@mbg.generated 表示这个注释是由MyBatis Generator自动生成的用于警告不要手动编辑
-->
<id column="brand_id" jdbcType="BIGINT" property="brandId" />
<result column="brand_name" jdbcType="VARCHAR" property="brandName" />
<result column="brand_pic" jdbcType="VARCHAR" property="brandPic" />
<result column="user_id" jdbcType="VARCHAR" property="userId" />
<result column="memo" jdbcType="VARCHAR" property="memo" />
<result column="seq" jdbcType="INTEGER" property="seq" />
<result column="status" jdbcType="INTEGER" property="status" />
<result column="brief" jdbcType="VARCHAR" property="brief" />
<result column="rec_time" jdbcType="TIMESTAMP" property="recTime" />
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
<result column="first_char" jdbcType="VARCHAR" property="firstChar" />
<result column="content" jdbcType="LONGVARCHAR" property="content" />
</resultMap>
<!-- 查询语句,根据品牌名称查询品牌信息 -->
<select id="getByBrandName" resultMap="BaseResultMap">
select * from tz_brand where brand_name = #{brandName}
</select>
<!-- 查询语句根据分类ID查询品牌列表 -->
<select id="listByCategoryId" resultMap="BaseResultMap">
select b.brand_name,b.brand_id from tz_brand b
left join tz_category_brand cb on cb.brand_id = b.brand_id
where cb.category_id = #{categoryId}
</select>
</mapper>
Loading…
Cancel
Save