PopularProdVoMapper.xml 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  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.xingxi.web.controller.business.popular.mapper.PopularProdVoMapper">
  4. <resultMap type="PopularProdVo" id="PopularProdVoResult">
  5. <result property="id" column="id" />
  6. <result property="mercProdId" column="mercProdId" />
  7. <result property="sort" column="sort" />
  8. <result property="delFlag" column="delFlag" />
  9. <result property="createUser" column="createUser" />
  10. <result property="createTime" column="createTime" />
  11. <result property="updateUser" column="updateUser" />
  12. <result property="updateTime" column="updateTime" />
  13. <result property="prodId" column="prodId" />
  14. <result property="prodName" column="prodName" />
  15. <result property="attrName" column="attrName" />
  16. </resultMap>
  17. <sql id="selectPopularProdVo">
  18. select t_popular_prod.id
  19. , t_popular_prod.mercProdId
  20. , t_popular_prod.sort
  21. , t_popular_prod.delFlag
  22. , t_popular_prod.createUser
  23. , t_popular_prod.createTime
  24. , t_popular_prod.updateUser
  25. , t_popular_prod.updateTime
  26. , m_merchant_prod.prodId
  27. , m_prod.prodName
  28. , m_prod_attr.attrName
  29. from t_popular_prod
  30. inner join m_merchant_prod on m_merchant_prod.mercProdId = t_popular_prod.mercProdId
  31. inner join m_prod on m_prod.id = m_merchant_prod.prodId
  32. inner join m_prod_attr on m_prod_attr.prodId = m_merchant_prod.prodId and m_prod_attr.prodAttrId = m_merchant_prod.prodAttrId
  33. </sql>
  34. <select id="selectPopularProdVoList" parameterType="PopularProdVo" resultMap="PopularProdVoResult">
  35. <include refid="selectPopularProdVo"/>
  36. <where>
  37. <if test="mercProdId != null "> and t_popular_prod.mercProdId = #{mercProdId}</if>
  38. <if test="sort != null "> and t_popular_prod.sort = #{sort}</if>
  39. <if test="delFlag != null and delFlag != ''"> and t_popular_prod.delFlag = #{delFlag}</if>
  40. <if test="createUser != null and createUser != ''"> and t_popular_prod.createUser = #{createUser}</if>
  41. <if test="createTime != null "> and t_popular_prod.createTime = #{createTime}</if>
  42. <if test="updateUser != null and updateUser != ''"> and t_popular_prod.updateUser = #{updateUser}</if>
  43. <if test="updateTime != null "> and t_popular_prod.updateTime = #{updateTime}</if>
  44. <if test="prodName != null and prodName != ''"> and m_prod.prodName like concat('%', #{prodName}, '%')</if>
  45. <if test="attrName != null and attrName != ''"> and m_prod_attr.attrName like concat('%', #{attrName}, '%')</if>
  46. </where>
  47. order by t_popular_prod.sort
  48. </select>
  49. </mapper>