后台服务
No puede seleccionar más de 25 temas Los temas deben comenzar con una letra o número, pueden incluir guiones ('-') y pueden tener hasta 35 caracteres de largo.

65 líneas
1.9 KiB

  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.iformall.mapper.WxChartDataMapper">
  4. <resultMap id="BaseResultMap" type="com.iformall.domain.po.WxChartDataEntity">
  5. <id column="id" jdbcType="BIGINT" property="id"/>
  6. <result column="tenant_id" jdbcType="VARCHAR" property="tenantId"/>
  7. <result column="parent_tenant_id" jdbcType="VARCHAR" property="parentTenantId" />
  8. <result column="type" jdbcType="INTEGER" property="type"/>
  9. <result column="result" jdbcType="VARCHAR" property="result"/>
  10. <result column="querytime" jdbcType="TIMESTAMP" property="querytime"/>
  11. <result column="createtime" jdbcType="TIMESTAMP" property="createtime"/>
  12. </resultMap>
  13. <sql id="allColumns">
  14. `id`,`tenant_id`,`parent_tenant_id`,`type`,`result`,`querytime`,`createtime`
  15. </sql>
  16. <sql id="dynamicWhereConditions">
  17. where 1 = 1
  18. <if test=" null != id ">
  19. and `id` = #{id}
  20. </if>
  21. <if test=" null != tenantId and '' != tenantId">
  22. and `tenant_id` = #{tenantId}
  23. </if>
  24. <if test=" null != parentTenantId and '' != parentTenantId">
  25. and `parent_tenant_id` = #{parentTenantId}
  26. </if>
  27. <if test=" null != type ">
  28. and `type` = #{type}
  29. </if>
  30. <if test=" null != querytime ">
  31. and `querytime` = #{querytime}
  32. </if>
  33. <if test=" null != startTime ">
  34. and `querytime` &gt;= #{startTime}
  35. </if>
  36. <if test=" null != endTime ">
  37. and `querytime` &lt;= #{endTime}
  38. </if>
  39. order by querytime
  40. </sql>
  41. <select id="findList" parameterType="com.iformall.domain.po.WxChartDataEntity" resultMap="BaseResultMap">
  42. select
  43. <include refid="allColumns"/>
  44. from wx_chart_data
  45. <include refid="dynamicWhereConditions"/>
  46. </select>
  47. <select id="findSumResult" parameterType="com.iformall.domain.po.WxChartDataEntity" resultType="long">
  48. select IFNULL(sum(result),0)
  49. from wx_chart_data
  50. <include refid="dynamicWhereConditions"/>
  51. </select>
  52. </mapper>