SmartWarningMapper.xml 687 B

123456789101112131415161718
  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.template.mapper.SmartWarningMapper">
  4. <select id="warningType" resultType="java.lang.String">
  5. SELECT type FROM `smart_warning` GROUP BY type
  6. </select>
  7. <select id="behaviourList" resultType="com.template.model.vo.BehaviourListVo">
  8. SELECT
  9. sw.type as typeName,
  10. COUNT( sw.type ) AS typeCount,
  11. ( SELECT COUNT( 0 ) FROM smart_warning sw2 ) AS totalCount
  12. FROM
  13. `smart_warning` sw
  14. GROUP BY
  15. sw.type
  16. </select>
  17. </mapper>