FeatureStatMapper.xml 1.4 KB

123456789101112131415161718192021222324252627282930313233343536
  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.gyee.wisdom.alarm.sharding.mapper.FeatureStatMapper">
  4. <select id="searchByCondition" parameterType="java.util.Map" resultType="com.gyee.wisdom.alarm.sharding.entity.FeatureStat">
  5. select * from FEATURE_STAT a
  6. <where>
  7. 1=1
  8. <if test="starttime !=null and endtime !=null">
  9. and statdate &gt;= #{starttime,jdbcType=DATE} and statdate &lt; #{endtime,jdbcType=DATE}
  10. </if>
  11. <if test="stationId !=null and stationId !=''">
  12. and a.stationid=#{stationId}
  13. </if>
  14. </where>
  15. order by a.id desc
  16. </select>
  17. <select id="searchAll" parameterType="java.util.Map" resultType="com.gyee.wisdom.alarm.sharding.entity.FeatureStat">
  18. select * from FEATURE_STAT a order by a.id desc
  19. </select>
  20. <select id="searchByCondition2" resultType="com.gyee.wisdom.alarm.sharding.entity.FeatureStat">
  21. select * from FEATURE_STAT a
  22. <where>
  23. and statdate &gt;= #{currentDate,jdbcType=DATE}
  24. <if test="stationId !=null and stationId !=''">
  25. and a.stationid=#{stationId}
  26. </if>
  27. </where>
  28. order by a.id desc
  29. </select>
  30. </mapper>