123456789101112131415161718192021222324252627282930313233343536373839404142434445464748 |
- <?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.emato.biz.mapper.mall.MallGoodsMapper">
- <resultMap id="MallGoodsVO" type="com.emato.biz.domain.mall.MallGoodsVO">
- <result property="merchSn" column="merch_sn" />
- <result property="merchName" column="merch_name" />
- <result property="sku" column="sku" />
- <result property="plu" column="plu" />
- <result property="mychemId" column="mychem_id" />
- <result property="goodsName" column="name" />
- <result property="englishName" column="english_name" />
- <result property="brand" column="brand" />
- <result property="inveNum" column="goods_number" />
- </resultMap>
- <!-- 查询商品信息的字段 -->
- <sql id="selectMallGoodsVOColumns">
- t1.merch_sn,
- t1.sku,
- t1.plu,
- t1.mychem_id,
- t1.name,
- t1.english_name,
- t1.brand,
- t1.goods_number
- </sql>
- <!-- 查询商品信息 VO 列表 -->
- <select id="selectMallGoodsList" resultMap="MallGoodsVO">
- SELECT
- <include refid="selectMallGoodsVOColumns" />,
- t2.merch_name
- FROM
- mall_goods t1
- LEFT JOIN merchant_base t2 ON t1.merch_sn = t2.merch_sn
- <where>
- t1.is_delete = '0'
- <if test="merchSn != null and merchSn != ''"> and t1.merch_sn = #{merchSn}</if>
- <if test="sku != null and sku != ''"> and t1.sku = #{sku}</if>
- <if test="plu != null and plu != ''"> and t1.PLU = #{plu}</if>
- <if test="goodsName != null and goodsName != ''"> and t1.name like concat('%', #{goodsName}, '%')</if>
- </where>
- </select>
- </mapper>
|