<?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.hxhq.business.mapper.GspRkjlMapper">
    <select id="getRklUnit" resultType="java.util.Map">
        SELECT rkdw , COUNT(*) AS cnt
        FROM t_gsp_rkjl
        <if test="ew.sqlSegment != '' and ew.sqlSegment != null">
            <where>
                ${ew.sqlSegment}
            </where>
        </if>
        GROUP BY rkdw
        ORDER BY cnt DESC
        LIMIT 1;
    </select>
    <select id="sumRkl" resultType="java.math.BigDecimal">
        SELECT SUM(basic_rkl + 0) AS total
        FROM t_gsp_rkjl
        <if test="ew.sqlSegment != '' and ew.sqlSegment != null">
            <where>
                ${ew.sqlSegment}
            </where>
        </if>
    </select>
</mapper>