47 lines
2.0 KiB
XML
47 lines
2.0 KiB
XML
<?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.example.demo.mapper.XiaofeiliangNewMapper">
|
|
|
|
<resultMap id="BaseResultMap" type="com.example.demo.domain.XiaofeiliangNew">
|
|
<result property="id" column="id" jdbcType="OTHER"/>
|
|
<result property="area" column="area" jdbcType="OTHER"/>
|
|
<result property="age" column="age" jdbcType="INTEGER"/>
|
|
<result property="gender" column="gender" jdbcType="OTHER"/>
|
|
<result property="bodyweight" column="bodyWeight" jdbcType="OTHER"/>
|
|
<result property="sppz" column="sppz" jdbcType="OTHER"/>
|
|
<result property="spxl" column="spxl" jdbcType="OTHER"/>
|
|
<result property="xiaofeiSum" column="equivalent" jdbcType="DECIMAL"/>
|
|
</resultMap>
|
|
|
|
<sql id="Base_Column_List">
|
|
id,area,age,
|
|
gender,bodyWeight,sppz,
|
|
spxl,equivalent
|
|
</sql>
|
|
|
|
<select id="getYpxxXiaofeiliang" resultType="com.example.demo.entity.vo.PingGuYpxxJczVo">
|
|
SELECT spxl,
|
|
COUNT(*) as xiaofeiSum,
|
|
AVG(xiaofei_sum) AS xiaofeiliangAvg,
|
|
MAX(xiaofei_sum) AS xiaofeiliangMax,
|
|
varSamp(xiaofei_sum) AS xiaofeiliangP95,
|
|
AVG(bodyWeight) AS bodyWeightAvg
|
|
FROM XIAOFEILIANG_NEW xn
|
|
${ew.customSqlSegment}
|
|
GROUP BY spxl
|
|
</select>
|
|
|
|
<select id="getYpxxXiaofeiliangByspjb" resultType="com.example.demo.entity.vo.PingGuYpxxJczVo">
|
|
SELECT ${spjb} as vegetableName,
|
|
COUNT(*) as xiaofeiSum,
|
|
AVG(xiaofei_sum) AS xiaofeiliangAvg,
|
|
MAX(xiaofei_sum) AS xiaofeiliangMax,
|
|
quantile(0.5)(xiaofei_sum) AS xiaofeiliangP50, quantile(0.95)(xiaofei_sum) AS xiaofeiliangP95, AVG(bodyWeight) AS bodyWeightAvg
|
|
FROM XIAOFEILIANG_NEW xn
|
|
${ew.customSqlSegment}
|
|
GROUP BY ${spjb}
|
|
</select>
|
|
</mapper>
|