You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

84 lines
5.2 KiB

<?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.qs.serve.modules.goods.mapper.GoodsCustomerPriceMapper">
<resultMap id="goodsCustomerPriceMap" type="com.qs.serve.modules.goods.entity.GoodsCustomerPrice" >
<result property="id" column="id"/>
<result property="supplierId" column="supplier_id"/>
<result property="supplierCode" column="supplier_code"/>
<result property="supplierName" column="supplier_name"/>
<result property="skuCode" column="sku_code"/>
<result property="skuId" column="sku_id"/>
<result property="skuName" column="sku_name"/>
<result property="skuUnit" column="sku_unit"/>
<result property="initPrice" column="init_price"/>
<result property="realPrice" column="real_price"/>
<result property="maker" column="maker"/>
<result property="makerCode" column="maker_code"/>
<result property="markTime" column="mark_time"/>
<result property="createTime" column="create_time"/>
<result property="createBy" column="create_by"/>
<result property="updateTime" column="update_time"/>
<result property="updateBy" column="update_by"/>
<result property="tenantId" column="tenant_id"/>
<result property="delFlag" column="del_flag"/>
</resultMap>
<sql id="goodsCustomerPriceSql">
goods_customer_price.`id`,
goods_customer_price.`supplier_id`,
goods_customer_price.`supplier_code`,
goods_customer_price.`supplier_name`,
goods_customer_price.`sku_code`,
goods_customer_price.`sku_id`,
goods_customer_price.`sku_name`,
goods_customer_price.`sku_unit`,
goods_customer_price.`init_price`,
goods_customer_price.`real_price`,
goods_customer_price.`maker`,
goods_customer_price.`maker_code`,
goods_customer_price.`mark_time` </sql>
<select id="selectGoodsCustomerPriceList" parameterType="com.qs.serve.modules.goods.entity.GoodsCustomerPrice" resultMap="goodsCustomerPriceMap">
SELECT <include refid="goodsCustomerPriceSql"/>,
goods_sku.book_belong,
goods_sku.book_name
FROM `goods_customer_price` `goods_customer_price`
left join goods_sku on goods_customer_price.sku_id = goods_sku.id
<where>
and goods_sku.del_flag = 0
and `goods_customer_price`.`del_flag` = 0
<if test="query.id != null"> and `goods_customer_price`.`id` = #{query.id}</if>
<if test="query.supplierId != null"> and `goods_customer_price`.`supplier_id` = #{query.supplierId}</if>
<if test="query.supplierCode != null"> and `goods_customer_price`.`supplier_code` = #{query.supplierCode}</if>
<if test="query.supplierName != null and query.supplierName != ''"> and `goods_customer_price`.`supplier_name` = #{query.supplierName}</if>
<if test="query.skuCode != null and query.skuCode != ''"> and `goods_customer_price`.`sku_code` = #{query.skuCode}</if>
<if test="query.skuId != null and query.skuId != ''"> and `goods_customer_price`.`sku_id` = #{query.skuId}</if>
<if test="query.skuName != null and query.skuName != ''"> and `goods_customer_price`.`sku_name` = #{query.skuName}</if>
<if test="query.skuUnit != null and query.skuUnit != ''"> and `goods_customer_price`.`sku_unit` = #{query.skuUnit}</if>
<if test="query.initPrice != null"> and `goods_customer_price`.`init_price` = #{query.initPrice}</if>
<if test="query.realPrice != null"> and `goods_customer_price`.`real_price` = #{query.realPrice}</if>
<if test="query.maker != null and query.maker != ''"> and `goods_customer_price`.`maker` = #{query.maker}</if>
<if test="query.makerCode != null and query.makerCode != ''"> and `goods_customer_price`.`maker_code` = #{query.makerCode}</if>
<if test="query.markTime != null"> and `goods_customer_price`.`mark_time` = #{query.markTime}</if>
<if test="query.createTime != null"> and `goods_customer_price`.`create_time` = #{query.createTime}</if>
<if test="query.createBy != null and query.createBy != ''"> and `goods_customer_price`.`create_by` = #{query.createBy}</if>
<if test="query.updateTime != null"> and `goods_customer_price`.`update_time` = #{query.updateTime}</if>
<if test="query.updateBy != null and query.updateBy != ''"> and `goods_customer_price`.`update_by` = #{query.updateBy}</if>
<if test="query.tenantId != null and query.tenantId != ''"> and `goods_customer_price`.`tenant_id` = #{query.tenantId}</if>
<if test="query.delFlag != null"> and `goods_customer_price`.`del_flag` = #{query.delFlag}</if>
<if test="query.bookCodeList!=null and query.bookCodeList.size > 0">
and `goods_sku`.`book_belong` in
<foreach collection="query.bookCodeList" item ="selectId" index="i" open="(" close=")" separator=",">
#{selectId}
</foreach>
</if>
</where>
</select>
</mapper>