|
@@ -28,6 +28,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<result property="remark" column="remark" />
|
|
|
<result property="companyName" column="companyName" />
|
|
|
<result property="typeName" column="typeName" />
|
|
|
+ <result property="sort" column="sort" />
|
|
|
<collection property="goodsAttributes" javaType="java.util.List" resultMap="GoodsAttributeResult" />
|
|
|
<collection property="goodsSizes" javaType="java.util.List" resultMap="GoodsSizeResult" />
|
|
|
<collection property="goodsColors" javaType="java.util.List" resultMap="GoodsColorResult" />
|
|
@@ -55,6 +56,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<sql id="selectGoodsInfoVo">
|
|
|
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.material,gi.putaway_flag, gi.del_flag, gi.create_time, gi.create_by, gi.update_time, gi.update_by, gi.remark,
|
|
|
+ gi.sort,
|
|
|
gt.name typeName,sc.company_name companyName,
|
|
|
ga.attribute_id,ga.value,gs.size,gc.color,
|
|
|
gta.attribute_name attributeName,gta.sort
|
|
@@ -69,10 +71,42 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
|
|
|
<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.create_time, gi.create_by, gi.update_time, gi.update_by, gi.remark,
|
|
|
- gi.putaway_flag,gi.weight,gi.material,gi.produced_time,
|
|
|
+ gi.putaway_flag,gi.weight,gi.material,gi.produced_time,gi.sort,
|
|
|
+ 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_user u on u.login_name = gi.create_by
|
|
|
+ left join sys_dept d on u.dept_id = d.dept_id
|
|
|
+ left join sys_company sc on sc.id =gi.company_id
|
|
|
+ <where>
|
|
|
+ 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 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>
|
|
|
+ <if test="des != null and des != ''"> and gi.des = #{des}</if>
|
|
|
+ <if test="delivery != null and delivery != ''"> and gi.delivery = #{delivery}</if>
|
|
|
+ <if test="producedTime != null "> and gi.produced_time = #{producedTime}</if>
|
|
|
+ <if test="producedAddress != null and producedAddress != ''"> and gi.produced_address = #{producedAddress}</if>
|
|
|
+ <if test="warehouseAddress != null and warehouseAddress != ''"> and gi.warehouse_address = #{warehouseAddress}</if>
|
|
|
+ <if test="weight != null and weight != ''"> and gi.weight = #{weight}</if>
|
|
|
+ <if test="material != null and material != ''"> and gi.material like concat('%', #{material}, '%')</if>
|
|
|
+ <if test="putawayFlag != null and putawayFlag != ''"> and gi.putaway_flag = #{putawayFlag}</if>
|
|
|
+ ${params.dataScope}
|
|
|
+ </where>
|
|
|
+ order by gi.putaway_flag ,gi.sort desc,gi.create_time
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <select id="selectGoodsInfoListByAdmin" 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.material,gi.produced_time,gi.sort,
|
|
|
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_user u on u.login_name = gi.create_by
|
|
|
+ left join sys_dept d on u.dept_id = d.dept_id
|
|
|
left join sys_company sc on sc.id =gi.company_id
|
|
|
<where>
|
|
|
gi.del_flag = "0"
|
|
@@ -90,8 +124,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<if test="weight != null and weight != ''"> and gi.weight = #{weight}</if>
|
|
|
<if test="material != null and material != ''"> and gi.material like concat('%', #{material}, '%')</if>
|
|
|
<if test="putawayFlag != null and putawayFlag != ''"> and gi.putaway_flag = #{putawayFlag}</if>
|
|
|
+ ${params.dataScope}
|
|
|
</where>
|
|
|
- order by gi.putaway_flag ,gi.create_time
|
|
|
+ order by gi.putaway_flag desc ,gi.sort desc,gi.create_time
|
|
|
</select>
|
|
|
|
|
|
<select id="selectGoodsInfoById" parameterType="Long" resultMap="GoodsInfoResult">
|
|
@@ -126,6 +161,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<if test="updateTime != null ">update_time,</if>
|
|
|
<if test="updateBy != null and updateBy != ''">update_by,</if>
|
|
|
<if test="remark != null and remark != ''">remark,</if>
|
|
|
+ <if test="sort != null and sort != ''">sort,</if>
|
|
|
</trim>
|
|
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
|
<if test="name != null and name != ''">#{name},</if>
|
|
@@ -148,6 +184,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<if test="updateTime != null ">#{updateTime},</if>
|
|
|
<if test="updateBy != null and updateBy != ''">#{updateBy},</if>
|
|
|
<if test="remark != null and remark != ''">#{remark},</if>
|
|
|
+ <if test="sort != null and sort != ''">#{sort},</if>
|
|
|
</trim>
|
|
|
</insert>
|
|
|
|
|
@@ -174,6 +211,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<if test="updateTime != null ">update_time = #{updateTime},</if>
|
|
|
<if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
|
|
|
<if test="remark != null and remark != ''">remark = #{remark},</if>
|
|
|
+ <if test="sort != null and sort != ''">sort = #{sort},</if>
|
|
|
</trim>
|
|
|
where id = #{id}
|
|
|
</update>
|
|
@@ -197,19 +235,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
</foreach>
|
|
|
</select>
|
|
|
|
|
|
- <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,gi.material,
|
|
|
- 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>
|
|
|
+
|
|
|
|
|
|
|
|
|
<select id="selectGoodsInfoCountByTypeId" parameterType="GoodsInfo" resultType="Integer">
|
|
@@ -223,7 +249,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
</select>
|
|
|
<select id="selectGoodsInfoListInWeb" 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.material,gi.produced_time,
|
|
|
+ gi.putaway_flag,gi.weight,gi.material,gi.produced_time,gi.sort,
|
|
|
gt.name typeName,sc.company_name companyName
|
|
|
from goods_info gi
|
|
|
left join goods_type gt on gt.id =gi.type_id
|
|
@@ -240,7 +266,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<if test="endPrice != null and endPrice!='' "> and gi.price <= #{endPrice}</if>
|
|
|
<if test="weight != null and weight != ''"> and gi.weight = #{weight}</if>
|
|
|
</where>
|
|
|
- order by gi.putaway_flag ,gi.create_time
|
|
|
+ order by gi.sort desc
|
|
|
</select>
|
|
|
|
|
|
<update id="putawayGooodsInfo">
|