StoreWdOpcloseMapper.xml 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116
  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="com.ruoyi.demo.mapper.StoreWdOpcloseDao">
  6. <select id="selectWdOpenTimes" resultType="com.ruoyi.demo.entity.vo.OpcloseTimeVo">
  7. SELECT
  8. start_time time,
  9. COUNT(*) count
  10. FROM
  11. `bl_store_wd_opclose`
  12. <trim prefix="where" prefixOverrides="and">
  13. <if test="addrCodes != null">
  14. <foreach collection="addrCodes" item="code" open="and addr_code in (" separator="," close=")">
  15. #{code,jdbcType=VARCHAR}
  16. </foreach>
  17. </if>
  18. <if test="typeCodeBys != null">
  19. <foreach collection="typeCodeBys" item="code" open="and type_code_by in (" separator="," close=")">
  20. #{code,jdbcType=VARCHAR}
  21. </foreach>
  22. </if>
  23. </trim>
  24. GROUP BY
  25. start_time
  26. ORDER BY
  27. count DESC;
  28. </select>
  29. <select id="selectWdCloseTimes" resultType="com.ruoyi.demo.entity.vo.OpcloseTimeVo">
  30. SELECT
  31. end_time time,
  32. COUNT(*) count
  33. FROM
  34. `bl_store_wd_opclose`
  35. <trim prefix="where" prefixOverrides="and">
  36. <if test="addrCodes != null">
  37. <foreach collection="addrCodes" item="code" open="and addr_code in (" separator="," close=")">
  38. #{code,jdbcType=VARCHAR}
  39. </foreach>
  40. </if>
  41. <if test="typeCodeBys != null">
  42. <foreach collection="typeCodeBys" item="code" open="and type_code_by in (" separator="," close=")">
  43. #{code,jdbcType=VARCHAR}
  44. </foreach>
  45. </if>
  46. </trim>
  47. GROUP BY
  48. end_time
  49. ORDER BY
  50. count DESC;
  51. </select>
  52. <select id="selectBrandOpenTimes" resultType="com.ruoyi.demo.entity.vo.OpcloseTimeVo">
  53. SELECT
  54. brand_id,
  55. brand_name,
  56. start_time time,
  57. COUNT(*) count
  58. FROM
  59. `bl_store_wd_opclose`
  60. <trim prefix="where" prefixOverrides="and">
  61. <if test="brandIds != null">
  62. <foreach collection="brandIds" item="id" open="and brand_id in (" separator="," close=")">
  63. #{id,jdbcType=VARCHAR}
  64. </foreach>
  65. </if>
  66. <if test="addrCodes != null">
  67. <foreach collection="addrCodes" item="code" open="and addr_code in (" separator="," close=")">
  68. #{code,jdbcType=VARCHAR}
  69. </foreach>
  70. </if>
  71. <if test="typeCodeBys != null">
  72. <foreach collection="typeCodeBys" item="code" open="and type_code_by in (" separator="," close=")">
  73. #{code,jdbcType=VARCHAR}
  74. </foreach>
  75. </if>
  76. </trim>
  77. GROUP BY
  78. brand_id,
  79. brand_name,
  80. start_time
  81. ORDER BY
  82. count DESC;
  83. </select>
  84. <select id="selectBrandCloseTimes" resultType="com.ruoyi.demo.entity.vo.OpcloseTimeVo">
  85. SELECT
  86. brand_id,
  87. brand_name,
  88. end_time time,
  89. COUNT(*) count
  90. FROM
  91. `bl_store_wd_opclose`
  92. <trim prefix="where" prefixOverrides="and">
  93. <if test="brandIds != null">
  94. <foreach collection="brandIds" item="id" open="and brand_id in (" separator="," close=")">
  95. #{id,jdbcType=VARCHAR}
  96. </foreach>
  97. </if>
  98. <if test="addrCodes != null">
  99. <foreach collection="addrCodes" item="code" open="and addr_code in (" separator="," close=")">
  100. #{code,jdbcType=VARCHAR}
  101. </foreach>
  102. </if>
  103. <if test="typeCodeBys != null">
  104. <foreach collection="typeCodeBys" item="code" open="and type_code_by in (" separator="," close=")">
  105. #{code,jdbcType=VARCHAR}
  106. </foreach>
  107. </if>
  108. </trim>
  109. GROUP BY
  110. brand_id,
  111. brand_name,
  112. end_time
  113. ORDER BY
  114. count DESC;
  115. </select>
  116. </mapper>