| <?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="com.moral.api.mapper.WindModelMapper"> | 
|   | 
|         <!-- 通用查询映射结果 --> | 
|         <resultMap id="BaseResultMap" type="com.moral.api.entity.WindModel"> | 
|                     <id column="id" property="id" /> | 
|                     <result column="json" property="json" /> | 
|                     <result column="value" property="value" /> | 
|         </resultMap> | 
|   | 
|     <select id="selectWindModel" resultType="java.util.Map"> | 
|         select * from wind_model | 
|         <where> | 
|             <foreach collection="map.entrySet()" item="value" index="key"> | 
|                 AND ABS((select JSON_EXTRACT(json, '$.${key}') FROM wind_model)-#{value})<![CDATA[<]]>10 | 
|             </foreach> | 
|         </where> | 
|     </select> | 
| </mapper> |