1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677 |
- <?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.abi.qms.platform.dao.mapper.BaseSkuMapper">
- <!--603版 已作废-->
- <!--<!– 通用查询映射结果 –>
- <resultMap id="BaseResultMap" type="com.abi.qms.platform.dao.entity.BaseSku">
- <id column="id" property="id" />
- <result column="sku_code" property="skuCode" />
- <result column="sku_name" property="skuName" />
- <result column="brand_code" property="brandCode" />
- <result column="sub_brand_code" property="subBrandCode" />
- <result column="valid" property="valid" />
- <result column="create_time" property="createTime" />
- <result column="create_by" property="createBy" />
- <result column="update_time" property="updateTime" />
- <result column="update_by" property="updateBy" />
- <result column="is_delete" property="isDelete" />
- </resultMap>
- <!– 通用查询结果列 –>
- <sql id="Base_Column_List">
- id, sku_code, sku_name, brand_code, sub_brand_code, valid, create_time, create_by, update_time, update_by, is_delete
- </sql>
- <select id="listSku" resultType="com.abi.qms.platform.dao.vo.result.BaseSkuVO">
- SELECT
- bs.id,
- bs.sku_code,
- bs.sku_name,
- bs.brand_code,
- bs.sub_brand_code,
- bs.create_time,
- bs.create_by,
- bs.update_time,
- bs.update_by,
- bs.valid,
- bb.brand_name as brand_name,
- bb1.brand_name as sub_brand_name
- FROM `base_sku` bs
- LEFT JOIN base_brand bb on bs.brand_code = bb.brand_code
- LEFT JOIN base_brand bb1 on bs.sub_brand_code = bb1.brand_code
- <where>
- bs.is_delete = 0
- <if test="param.skuName != null and param.skuName != ''">
- AND bs.sku_name LIKE CONCAT('%',#{param.skuName},'%')
- </if>
- <if test="param.brandCode != null">
- AND bs.brand_code = #{param.brandCode}
- </if>
- <if test="param.valid != null">
- AND bs.valid = #{param.valid}
- </if>
- </where>
- order by bs.update_time desc
- </select>
- <select id="selectSkuById" resultType="com.abi.qms.platform.dao.vo.result.BaseSkuVO">
- SELECT
- bs.id,
- bs.sku_code,
- bs.sku_name,
- bs.brand_code,
- bs.sub_brand_code,
- bs.create_time,
- bs.create_by,
- bs.update_time,
- bs.update_by,
- bs.valid,
- bb.brand_name as brand_name,
- bb1.brand_name as sub_brand_name
- FROM `base_sku` bs
- LEFT JOIN base_brand bb on bs.brand_code = bb.brand_code
- LEFT JOIN base_brand bb1 on bs.sub_brand_code = bb1.brand_code
- where bs.id = #{id} and bs.is_delete = 0
- </select>-->
- </mapper>
|