DevelopmentOrderMapper.xml 1.1 KB

1234567891011121314151617181920212223242526272829
  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="org.dromara.bulk.mapper.DevelopmentOrderMapper">
  6. <resultMap id="statusCountMap" type="map">
  7. <id column="key" property="key" javaType="long"/>
  8. <result column="value" property="value" javaType="int"/>
  9. </resultMap>
  10. <select id="countStatusBatch" parameterType="java.util.Collection" resultMap="statusCountMap">
  11. SELECT `status` AS `key`, COUNT(*) AS `value`
  12. FROM fa_template_dev_order
  13. WHERE `status` IN
  14. <foreach item="status" collection="statusCodes" open="(" separator="," close=")">
  15. #{status}
  16. </foreach>
  17. GROUP BY `status`
  18. </select>
  19. <select id="getCountWithCondition" resultType="int">
  20. select COUNT(*) from fa_template_dev_order where `status` = #{status}
  21. <if test="statusFieldName != null and statusFieldName != ''">
  22. AND ${statusFieldName} != 0
  23. </if>
  24. </select>
  25. </mapper>