StoreAdsServiceDaoImplMapper.xml 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159
  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <!DOCTYPE mapper
  3. PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
  4. "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
  5. <mapper namespace="storeAdsServiceDaoImpl">
  6. <!-- 保存商户广告信息 add by wuxw 2018-07-03 -->
  7. <insert id="saveStoreAdsInfo" parameterType="Map">
  8. insert into store_ads(
  9. ad_name,ad_type,share_id,start_time,page_url,state,end_time,advert_type,ads_id,seq,url
  10. ) values (
  11. #{adName},#{adType},#{shareId},#{startTime},#{pageUrl},#{state},#{endTime},#{advertType},#{adsId},#{seq},#{url}
  12. )
  13. </insert>
  14. <!-- 查询商户广告信息 add by wuxw 2018-07-03 -->
  15. <select id="getStoreAdsInfo" parameterType="Map" resultType="Map">
  16. select t.ad_name,t.ad_name adName,t.ad_type,t.ad_type adType,t.share_id,t.share_id
  17. shareId,t.start_time,t.start_time startTime,t.page_url,t.page_url pageUrl,t.status_cd,t.status_cd
  18. statusCd,t.state,t.end_time,t.end_time endTime,t.advert_type,t.advert_type advertType,t.ads_id,t.ads_id
  19. adsId,t.seq,t.url
  20. from store_ads t
  21. where 1 =1
  22. <if test="adName !=null and adName != ''">
  23. and t.ad_name= #{adName}
  24. </if>
  25. <if test="adType !=null and adType != ''">
  26. and t.ad_type= #{adType}
  27. </if>
  28. <if test="shareId !=null and shareId != ''">
  29. and t.share_id= #{shareId}
  30. </if>
  31. <if test="startTime !=null and startTime != ''">
  32. and t.start_time= #{startTime}
  33. </if>
  34. <if test="pageUrl !=null and pageUrl != ''">
  35. and t.page_url= #{pageUrl}
  36. </if>
  37. <if test="statusCd !=null and statusCd != ''">
  38. and t.status_cd= #{statusCd}
  39. </if>
  40. <if test="state !=null and state != ''">
  41. and t.state= #{state}
  42. </if>
  43. <if test="endTime !=null and endTime != ''">
  44. and t.end_time= #{endTime}
  45. </if>
  46. <if test="advertType !=null and advertType != ''">
  47. and t.advert_type= #{advertType}
  48. </if>
  49. <if test="adsId !=null and adsId != ''">
  50. and t.ads_id= #{adsId}
  51. </if>
  52. <if test="seq !=null and seq != ''">
  53. and t.seq= #{seq}
  54. </if>
  55. <if test="url !=null and url != ''">
  56. and t.url= #{url}
  57. </if>
  58. order by t.create_time desc
  59. <if test="page != -1 and page != null ">
  60. limit #{page}, #{row}
  61. </if>
  62. </select>
  63. <!-- 修改商户广告信息 add by wuxw 2018-07-03 -->
  64. <update id="updateStoreAdsInfo" parameterType="Map">
  65. update store_ads t set t.status_cd = #{statusCd}
  66. <if test="newBId != null and newBId != ''">
  67. ,t.b_id = #{newBId}
  68. </if>
  69. <if test="adName !=null and adName != ''">
  70. , t.ad_name= #{adName}
  71. </if>
  72. <if test="adType !=null and adType != ''">
  73. , t.ad_type= #{adType}
  74. </if>
  75. <if test="shareId !=null and shareId != ''">
  76. , t.share_id= #{shareId}
  77. </if>
  78. <if test="startTime !=null and startTime != ''">
  79. , t.start_time= #{startTime}
  80. </if>
  81. <if test="pageUrl !=null and pageUrl != ''">
  82. , t.page_url= #{pageUrl}
  83. </if>
  84. <if test="state !=null and state != ''">
  85. , t.state= #{state}
  86. </if>
  87. <if test="endTime !=null and endTime != ''">
  88. , t.end_time= #{endTime}
  89. </if>
  90. <if test="advertType !=null and advertType != ''">
  91. , t.advert_type= #{advertType}
  92. </if>
  93. <if test="seq !=null and seq != ''">
  94. , t.seq= #{seq}
  95. </if>
  96. <if test="url !=null and url != ''">
  97. , t.url= #{url}
  98. </if>
  99. where 1=1
  100. <if test="adsId !=null and adsId != ''">
  101. and t.ads_id= #{adsId}
  102. </if>
  103. </update>
  104. <!-- 查询商户广告数量 add by wuxw 2018-07-03 -->
  105. <select id="queryStoreAdssCount" parameterType="Map" resultType="Map">
  106. select count(1) count
  107. from store_ads t
  108. where 1 =1
  109. <if test="adName !=null and adName != ''">
  110. and t.ad_name= #{adName}
  111. </if>
  112. <if test="adType !=null and adType != ''">
  113. and t.ad_type= #{adType}
  114. </if>
  115. <if test="shareId !=null and shareId != ''">
  116. and t.share_id= #{shareId}
  117. </if>
  118. <if test="startTime !=null and startTime != ''">
  119. and t.start_time= #{startTime}
  120. </if>
  121. <if test="pageUrl !=null and pageUrl != ''">
  122. and t.page_url= #{pageUrl}
  123. </if>
  124. <if test="statusCd !=null and statusCd != ''">
  125. and t.status_cd= #{statusCd}
  126. </if>
  127. <if test="state !=null and state != ''">
  128. and t.state= #{state}
  129. </if>
  130. <if test="endTime !=null and endTime != ''">
  131. and t.end_time= #{endTime}
  132. </if>
  133. <if test="advertType !=null and advertType != ''">
  134. and t.advert_type= #{advertType}
  135. </if>
  136. <if test="adsId !=null and adsId != ''">
  137. and t.ads_id= #{adsId}
  138. </if>
  139. <if test="seq !=null and seq != ''">
  140. and t.seq= #{seq}
  141. </if>
  142. <if test="url !=null and url != ''">
  143. and t.url= #{url}
  144. </if>
  145. </select>
  146. </mapper>