|
@@ -33,7 +33,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
</resultMap>
|
|
|
|
|
|
<resultMap type="GoodsAttribute" id="GoodsAttributeResult">
|
|
|
- <result property="id" column="id" />
|
|
|
+ <result property="id" column="goods_attribute_id" />
|
|
|
<result property="goodsId" column="goods_id" />
|
|
|
<result property="attributeId" column="attribute_id" />
|
|
|
<result property="attributeName" column="attributeName" />
|
|
@@ -41,12 +41,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<result property="value" column="value" />
|
|
|
</resultMap>
|
|
|
<resultMap type="GoodsColor" id="GoodsColorResult">
|
|
|
- <result property="id" column="id" />
|
|
|
+ <result property="id" column="goods_color_id" />
|
|
|
<result property="goodsId" column="goods_id" />
|
|
|
<result property="color" column="color" />
|
|
|
</resultMap>
|
|
|
<resultMap type="GoodsSize" id="GoodsSizeResult">
|
|
|
- <result property="id" column="id" />
|
|
|
+ <result property="id" column="goods_size_id" />
|
|
|
<result property="goodsId" column="goods_id" />
|
|
|
<result property="size" column="size" />
|
|
|
</resultMap>
|
|
@@ -67,8 +67,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
</sql>
|
|
|
|
|
|
<select id="selectGoodsInfoList" parameterType="GoodsInfo" resultMap="GoodsInfoResult">
|
|
|
- select gi.id, gi.name, gi.company_id, gi.type_id, gi.price, gi.cover, gi.slideshow, gi.des, gi.delivery, gi.produced_time, gi.produced_address,
|
|
|
- gi.warehouse_address, gi.weight,gi.putaway_flag, gi.del_flag, gi.create_time, gi.create_by, gi.update_time, gi.update_by, gi.remark,
|
|
|
+ select gi.id, gi.name, gi.company_id, gi.type_id, gi.price, gi.cover, gi.slideshow, gi.create_time, gi.create_by, gi.update_time, gi.update_by, gi.remark,
|
|
|
+ gi.putaway_flag,gi.weight,gi.produced_time,
|
|
|
gt.name typeName,sc.company_name companyName
|
|
|
from goods_info gi
|
|
|
left join goods_type gt on gt.id =gi.type_id
|
|
@@ -77,7 +77,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
gi.del_flag = "0"
|
|
|
<if test="name != null and name != ''"> and gi.name like concat('%', #{name}, '%')</if>
|
|
|
<if test="companyId != null "> and gi.company_id = #{companyId}</if>
|
|
|
- <if test="typeId != null "> and gi.type_id = #{typeId}</if>
|
|
|
+ <if test="typeId != null "> and find_in_set(#{typeId},gt.ancestors) </if>
|
|
|
<if test="price != null "> and gi.price = #{price}</if>
|
|
|
<if test="cover != null and cover != ''"> and gi.cover = #{cover}</if>
|
|
|
<if test="slideshow != null and slideshow != ''"> and gi.slideshow = #{slideshow}</if>
|
|
@@ -182,5 +182,19 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
#{id}
|
|
|
</foreach>
|
|
|
</delete>
|
|
|
+
|
|
|
+ <select id="selectGoodsInfoHotList" parameterType="GoodsInfo" resultMap="GoodsInfoResult">
|
|
|
+ select gi.id, gi.name, gi.company_id, gi.type_id, gi.price, gi.cover, gi.slideshow, gi.create_time, gi.create_by, gi.update_time, gi.update_by, gi.remark,
|
|
|
+ gi.putaway_flag,gi.weight,gi.produced_time,
|
|
|
+ gt.name typeName,sc.company_name companyName
|
|
|
+ from goods_info gi
|
|
|
+ left join goods_type gt on gt.id =gi.type_id
|
|
|
+ left join sys_company sc on sc.id =gi.company_id
|
|
|
+ where
|
|
|
+ gi.del_flag = "0"
|
|
|
+ and gi.putaway_flag = "1"
|
|
|
+ order by gi.create_time
|
|
|
+ limit 0,10
|
|
|
+ </select>
|
|
|
|
|
|
</mapper>
|