ProductMapper.xml 3.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  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.caimei365.commodity.mapper.ProductMapper">
  4. <select id="getBigTypeList" resultType="com.caimei365.commodity.model.vo.BigTypeVo">
  5. select
  6. bigTypeID as bigTypeId, typeSort, `name`, bigTypeCode, wwwValidFlag, crmValidFlag, wwwIcon, crmIcon, addTime, sortIndex
  7. from bigtype
  8. where
  9. typeSort = #{typeSort}
  10. <if test="source == 'www'.toString()">
  11. and wwwValidFlag = '1'
  12. </if>
  13. <if test="source == 'crm'.toString()">
  14. and crmValidFlag = '1'
  15. </if>
  16. order by ifnull(sortIndex,10000) , addTime DESC
  17. </select>
  18. <select id="getSmallTypeList" resultType="com.caimei365.commodity.model.vo.SmallTypeVo">
  19. select
  20. smallTypeID as smallTypeId, bigTypeID as bigTypeId, `name`, smallTypeCode, wwwValidFlag, crmValidFlag, wwwIcon, crmIcon, addTime, sortIndex
  21. from smalltype
  22. where bigTypeID = #{bigTypeId}
  23. <if test="source == 'www'.toString()">
  24. and wwwValidFlag = '1'
  25. </if>
  26. <if test="source == 'crm'.toString()">
  27. and crmValidFlag = '1'
  28. </if>
  29. order by ifnull(sortIndex,10000), addTime DESC
  30. </select>
  31. <select id="getTinyTypeList" resultType="com.caimei365.commodity.model.vo.TinyTypeVo">
  32. select
  33. tinyTypeID as tinyTypeId, smallTypeID as smallTypeId, `name`, tinyTypeCode, wwwValidFlag, crmValidFlag, wwwIcon, crmIcon, addTime, sortIndex
  34. from tinytype
  35. where smallTypeID = #{smallTypeId}
  36. <if test="source == 'www'.toString()">
  37. and wwwValidFlag = '1'
  38. </if>
  39. <if test="source == 'crm'.toString()">
  40. and crmValidFlag = '1'
  41. </if>
  42. order by ifnull(sortIndex,10000), addTime DESC
  43. </select>
  44. <select id="getPageTypeSort" resultType="java.lang.Integer">
  45. select typeSort from cm_page
  46. where id = #{pageId} and enabledStatus = '1'
  47. </select>
  48. <select id="getHotSearchByPageId" resultType="com.caimei365.commodity.model.vo.HotSearchVo">
  49. select
  50. id, pageId, name, isHot, link, linkParam, linkType, pcStatus, sort, appletsStatus, creationTime,
  51. from
  52. cm_page_hot_search
  53. where
  54. pageId = #{pageId}
  55. <if test="source == 1">
  56. and pcStatus = 1
  57. </if>
  58. <if test="source == 2">
  59. and appletsStatus = 1
  60. </if>
  61. order by sort desc, creationTime desc
  62. </select>
  63. <select id="getFloorByPageId" resultType="com.caimei365.commodity.model.vo.PageFloorVo">
  64. select id, title ,description as detail
  65. from cm_page_centre
  66. where pageId = #{pageId}
  67. <if test="source == 1">
  68. and enabledStatus = 1
  69. </if>
  70. <if test="source == 2">
  71. and crmEnabledStatus = 1
  72. </if>
  73. order by -sort desc, createDate desc
  74. </select>
  75. <select id="getFloorContentById" resultType="com.caimei365.commodity.model.vo.FloorContentVo">
  76. select
  77. id, floorId, centreId, templateType, pcAdsImage1, pcAdsImage2, pcAdsImage3,
  78. appletsAdsImage1, appletsAdsImage2, appletsAdsImage3, adsLink1, adsLink2, adsLink3
  79. from new_page_floor_content where centreId = #{id}
  80. </select>
  81. <select id="getFloorImageById" resultType="com.caimei365.commodity.model.vo.FloorImageVo">
  82. select
  83. id, floorId, centreId, productId, name, link, image, label, pcStatus, appletsStatus, sort, createDate
  84. from new_page_floor_image
  85. where centreId = #{id}
  86. <if test="source == 1">
  87. and pcStatus = 1
  88. </if>
  89. <if test="source == 2">
  90. and appletsStatus = 1
  91. </if>
  92. order by sort desc, createDate desc
  93. </select>
  94. </mapper>