ActivityShopDao.xml 3.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  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.sqx.modules.activity.dao.ActivityShopDao">
  4. <select id="pageShopByActivityId" resultType="com.sqx.modules.activity.vo.ActivityShopVO">
  5. select
  6. ach.id as activityShopId,
  7. ach.shop_id,
  8. ach.activity_id,
  9. gs.shop_name,
  10. gs.phone as shopPhone,
  11. st.shop_type_name,
  12. gs.shop_cover as shopImg,
  13. gs.shop_banner as shopSwiperImg
  14. from activity_shop ach
  15. left join goods_shop gs on gs.shop_id = ach.shop_id
  16. left join shop_type st on st.id = gs.shop_type_id
  17. where ach.activity_id = ${activityId}
  18. </select>
  19. <resultMap id="shopActivityGroupVO" type="com.sqx.modules.activity.vo.ShopActivityGroupVO">
  20. <result column="shop_id" property="shopId"/>
  21. <collection property="activityTypeGroups" ofType="com.sqx.modules.activity.vo.ShopActivityGroupVO$ActivityTypeGroup">
  22. <result column="type" property="activityType"/>
  23. <collection property="activityInGroups" ofType="com.sqx.modules.activity.vo.ShopActivityGroupVO$ActivityInGroup">
  24. <result column="title" property="activityTitle"/>
  25. <result column="end_time" property="activityEndTime"/>
  26. <result column="suit_type" property="suitType"/>
  27. <result column="limit_type" property="limitType"/>
  28. <result column="limit_value" property="limitValue"/>
  29. </collection>
  30. </collection>
  31. </resultMap>
  32. <select id="getShopActivityGroup" resultMap="shopActivityGroupVO">
  33. select
  34. ach.shop_id,
  35. a.type,
  36. a.title,
  37. a.end_time,
  38. ach.suit_type,
  39. ach.limit_type,
  40. ach.limit_value
  41. from activity_shop ach
  42. left join activity a on a.id = ach.activity_id
  43. where ach.shop_id = #{shopId}
  44. </select>
  45. <select id="getActivityByShopIds" resultType="com.sqx.modules.activity.vo.ShopActivityVO">
  46. select
  47. ach.id activityShopId,
  48. ach.shop_id,
  49. ach.activity_id,
  50. a.type activityType,
  51. a.title activityName,
  52. a.image activityImage,
  53. a.start_time,
  54. a.end_time
  55. from activity_shop ach
  56. left join activity a on a.id = ach.activity_id
  57. where
  58. ach.shop_id in
  59. <foreach collection="shopIds" index="index" item="item" open="(" separator="," close=")">
  60. #{item}
  61. </foreach>
  62. </select>
  63. <select id="getShopActivityBOByShopId" resultType="com.sqx.modules.activity.bo.ShopActivityBO">
  64. select
  65. a.id activityId,
  66. ach.id activityShopId,
  67. ach.shop_id,
  68. ach.suit_type,
  69. ach.limit_type,
  70. ach.limit_value,
  71. a.title,
  72. a.content,
  73. a.type,
  74. a.start_time,
  75. a.end_time,
  76. a.config
  77. from activity_shop ach
  78. left join activity a on ach.activity_id = a.id
  79. where ach.shop_id = #{shopId}
  80. and a.enable_flag = '1'
  81. and a.del_flag = '0'
  82. </select>
  83. </mapper>