KwpGoodsMapper.xml 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
  3. <mapper namespace="com.sckw.product.dao.KwpGoodsMapper">
  4. <select id="getGoodsLists" resultType="com.sckw.product.model.KwpGoods">
  5. select
  6. id, ent_id,supply_ent_id,agent_ent_id,code,name, type_id, amount, unit, spec, tax_rate, trading, advance_price, manager,is_agent,
  7. performed_amount,thumb,added_time,shelf_time,remark,status, create_by, create_time, update_by, update_time,del_flag
  8. from kwp_goods
  9. <where>
  10. del_flag = 0 and ent_id = #{entId}
  11. <if test="queryParam.keywords != null and queryParam.keywords != ''">
  12. and name LIKE concat('%',#{queryParam.keywords},'%')
  13. </if>
  14. <if test="queryParam.startCreateTime != null ">
  15. and create_time &gt;= #{queryParam.startCreateTime}
  16. </if>
  17. <if test="queryParam.endCreateTime != null ">
  18. and create_time &lt;= #{queryParam.endCreateTime}
  19. </if>
  20. <if test="queryParam.status != null and queryParam.status.size() > 0 ">
  21. and status in ()
  22. <foreach item="item" index="index" collection="#{queryParam.status}" open="(" separator="," close=")">
  23. #{item}
  24. </foreach>
  25. </if>
  26. <if test="queryParam.goodsTypes != null and queryParam.goodsTypes.size() > 0 ">
  27. and goods_type in
  28. <foreach item="item" index="index" collection="#{queryParam.goodsTypes}" open="(" separator="," close=")">
  29. #{item}
  30. </foreach>
  31. </if>
  32. <if test="queryParam.tradings != null and queryParam.tradings.size() > 0 ">
  33. and trading in
  34. <foreach item="item" index="index" collection="#{queryParam.tradings}" open="(" separator="," close=")">
  35. #{item}
  36. </foreach>
  37. </if>
  38. </where>
  39. ORDER BY create_time desc
  40. </select>
  41. </mapper>