Helius
2020-12-27 e5b55dc1854d2635d745e3911cf1dc162d1b81d8
zq-erp/src/main/resources/mybatis/mapper/hive/ShoppingGoodsDao.xml
@@ -1228,4 +1228,43 @@
   </select>
   <select id="selectShoppingGoodsApiInPage" resultType="com.matrix.system.app.vo.ShoppingGoodsListVo">
      select
         id id,
         code goodsCode,
         name name,
         seal_pice price,
         is_present isPresent,
         unit unit,
         measure measure,
         a.good_type goodsType
      from shopping_goods a
      where 1=1 and staus = '上架'
      <if test="record.queryKey != null and record.queryKey != ''">
         and (instr(name,#{record.queryKey}) or instr(code ,#{record.queryKey}) or instr(zjm ,#{record.queryKey}))
      </if>
      <if test="record.cateId!=null">
         and a.cate_id in ( select b.id from shopping_goods_category b where (b.id=#{record.cateId} or b.parent_id=#{record.cateId}))
      </if>
      <if test="pageVo !=null"><!-- 判断pageVo对象是否为空 -->
         <if test="pageVo.sort !=null  and pageVo.order !=null">
            order by ${pageVo.sort} ${pageVo.order}
         </if>
         <if test="pageVo.offset >=0  and pageVo.limit >0">
            limit #{pageVo.offset},#{pageVo.limit}
         </if>
      </if>
   </select>
   <select id="selectShopppingGoodsAipTotal" resultType="java.lang.Integer">
      select count(1)
      from shopping_goods a
      where 1=1 and staus = '上架'
      <if test="record.queryKey != null and record.queryKey != ''">
         and (instr(name,#{record.queryKey}) or instr(code ,#{record.queryKey}) or instr(zjm ,#{record.queryKey}))
      </if>
      <if test="record.cateId!=null">
         and a.cate_id in ( select b.id from shopping_goods_category b where (b.id=#{record.cateId} or b.parent_id=#{record.cateId}))
      </if>
   </select>
</mapper>