1234567891011121314151617181920212223242526272829 |
- <?xml version="1.0" encoding="UTF-8" ?>
- <!DOCTYPE mapper
- PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
- "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
- <mapper namespace="org.dromara.bulk.mapper.DevelopmentOrderMapper">
- <resultMap id="statusCountMap" type="map">
- <id column="key" property="key" javaType="long"/>
- <result column="value" property="value" javaType="int"/>
- </resultMap>
- <select id="countStatusBatch" parameterType="java.util.Collection" resultMap="statusCountMap">
- SELECT `status` AS `key`, COUNT(*) AS `value`
- FROM fa_template_dev_order
- WHERE `status` IN
- <foreach item="status" collection="statusCodes" open="(" separator="," close=")">
- #{status}
- </foreach>
- GROUP BY `status`
- </select>
- <select id="getCountWithCondition" resultType="int">
- select COUNT(*) from fa_template_dev_order where `status` = #{status}
- <if test="statusFieldName != null and statusFieldName != ''">
- AND ${statusFieldName} != 0
- </if>
- </select>
- </mapper>
|