GroupBuyBatchServiceDaoImplMapper.xml 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119
  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="groupBuyBatchServiceDaoImpl">
  6. <!-- 保存拼团批次信息 add by wuxw 2018-07-03 -->
  7. <insert id="saveGroupBuyBatchInfo" parameterType="Map">
  8. insert into group_buy_batch(
  9. batch_end_time,batch_id,store_id,setting_id,batch_start_time,cur_batch
  10. ) values (
  11. #{batchEndTime},#{batchId},#{storeId},#{settingId},#{batchStartTime},#{curBatch}
  12. )
  13. </insert>
  14. <!-- 查询拼团批次信息 add by wuxw 2018-07-03 -->
  15. <select id="getGroupBuyBatchInfo" parameterType="Map" resultType="Map">
  16. select t.batch_end_time,t.batch_end_time batchEndTime,t.status_cd,t.status_cd statusCd,t.batch_id,t.batch_id
  17. batchId,t.store_id,t.store_id storeId,t.setting_id,t.setting_id settingId,t.batch_start_time,t.batch_start_time
  18. batchStartTime,t.cur_batch,t.cur_batch curBatch,t.create_time createTime,gbs.group_buy_name groupBuyName
  19. from group_buy_batch t
  20. left join group_buy_setting gbs on t.setting_id = gbs.setting_id and t.store_id = gbs.store_id and gbs.status_cd = '0'
  21. where 1 =1
  22. <if test="batchEndTime !=null and batchEndTime != ''">
  23. and t.batch_end_time= #{batchEndTime}
  24. </if>
  25. <if test="statusCd !=null and statusCd != ''">
  26. and t.status_cd= #{statusCd}
  27. </if>
  28. <if test="batchId !=null and batchId != ''">
  29. and t.batch_id= #{batchId}
  30. </if>
  31. <if test="storeId !=null and storeId != ''">
  32. and t.store_id= #{storeId}
  33. </if>
  34. <if test="settingId !=null and settingId != ''">
  35. and t.setting_id= #{settingId}
  36. </if>
  37. <if test="batchStartTime !=null and batchStartTime != ''">
  38. and t.batch_start_time= #{batchStartTime}
  39. </if>
  40. <if test="curBatch !=null and curBatch != ''">
  41. and t.cur_batch= #{curBatch}
  42. </if>
  43. order by t.create_time desc
  44. <if test="page != -1 and page != null ">
  45. limit #{page}, #{row}
  46. </if>
  47. </select>
  48. <!-- 修改拼团批次信息 add by wuxw 2018-07-03 -->
  49. <update id="updateGroupBuyBatchInfo" parameterType="Map">
  50. update group_buy_batch t set t.status_cd = #{statusCd}
  51. <if test="newBId != null and newBId != ''">
  52. ,t.b_id = #{newBId}
  53. </if>
  54. <if test="batchEndTime !=null and batchEndTime != ''">
  55. , t.batch_end_time= #{batchEndTime}
  56. </if>
  57. <if test="batchStartTime !=null and batchStartTime != ''">
  58. , t.batch_start_time= #{batchStartTime}
  59. </if>
  60. <if test="curBatch !=null and curBatch != ''">
  61. , t.cur_batch= #{curBatch}
  62. </if>
  63. where 1=1
  64. <if test="batchId !=null and batchId != ''">
  65. and t.batch_id= #{batchId}
  66. </if>
  67. <if test="settingId !=null and settingId != ''">
  68. and t.setting_id= #{settingId}
  69. </if>
  70. <if test="storeId !=null and storeId != ''">
  71. and t.store_id= #{storeId}
  72. </if>
  73. <if test="defaultCurBatch !=null and defaultCurBatch != ''">
  74. and t.cur_batch= #{defaultCurBatch}
  75. </if>
  76. </update>
  77. <!-- 查询拼团批次数量 add by wuxw 2018-07-03 -->
  78. <select id="queryGroupBuyBatchsCount" parameterType="Map" resultType="Map">
  79. select count(1) count
  80. from group_buy_batch t
  81. where 1 =1
  82. <if test="batchEndTime !=null and batchEndTime != ''">
  83. and t.batch_end_time= #{batchEndTime}
  84. </if>
  85. <if test="statusCd !=null and statusCd != ''">
  86. and t.status_cd= #{statusCd}
  87. </if>
  88. <if test="batchId !=null and batchId != ''">
  89. and t.batch_id= #{batchId}
  90. </if>
  91. <if test="storeId !=null and storeId != ''">
  92. and t.store_id= #{storeId}
  93. </if>
  94. <if test="settingId !=null and settingId != ''">
  95. and t.setting_id= #{settingId}
  96. </if>
  97. <if test="batchStartTime !=null and batchStartTime != ''">
  98. and t.batch_start_time= #{batchStartTime}
  99. </if>
  100. <if test="curBatch !=null and curBatch != ''">
  101. and t.cur_batch= #{curBatch}
  102. </if>
  103. </select>
  104. </mapper>