| <?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.zy.acs.manager.manager.mapper.CodeMapper"> | 
|   | 
|     <!-- 关联查询sql --> | 
|     <sql id="selectSql"> | 
|         SELECT a.* | 
|         FROM man_code a | 
|         <where> | 
|             AND a.deleted = 0 | 
|             <if test="param.id != null"> | 
|                 AND a.id = #{param.id} | 
|             </if> | 
|             <if test="param.data != null"> | 
|                 AND a.data = #{param.data} | 
|             </if> | 
|             <if test="param.status != null"> | 
|                 AND a.status = #{param.status} | 
|             </if> | 
|             <if test="param.keywords != null"> | 
|                 AND ( | 
|                 a.memo LIKE CONCAT('%', #{param.keywords}, '%') | 
|                 OR a.memo LIKE CONCAT('%', #{param.keywords}, '%') | 
|                 ) | 
|             </if> | 
|         </where> | 
|     </sql> | 
|   | 
|     <select id="selectMinAndMaxByPoint" resultType="java.util.Map"> | 
|         SELECT | 
|         ROUND(MIN(X),1) AS min_x, | 
|         ROUND(MAX(X),1) AS max_x, | 
|         ROUND(MIN(Y),1) AS min_y, | 
|         ROUND(MAX(Y),1) AS max_y | 
|         FROM man_code where deleted = 0 | 
|     </select> | 
|   | 
|     <select id="selectDistinctCountFromX" resultType="java.lang.Integer"> | 
|         SELECT | 
|         COUNT(DISTINCT X) | 
|         FROM man_code | 
|         WHERE 1=1 | 
|         AND status = 1 | 
|         AND deleted = 0 | 
|     </select> | 
|   | 
|     <select id="selectDistinctCountFromY" resultType="java.lang.Integer"> | 
|         SELECT | 
|         COUNT(DISTINCT Y) | 
|         FROM man_code | 
|         WHERE 1=1 | 
|         AND status = 1 | 
|         AND deleted = 0 | 
|     </select> | 
|   | 
|     <select id="selectAllLocCode" resultType="java.lang.Long"> | 
|         select distinct code from man_loc where 1=1 and code is not null | 
|     </select> | 
|   | 
| </mapper> |