<?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.nantian.cloud.ggjg.mapper.DoubleControlMapper">

    <!-- 通用查询映射结果 -->
    <resultMap id="BaseResultMap" type="com.nantian.cloud.ggjg.entity.DoubleControl">
        <id column="id" property="id" />
        <result column="area_code" property="areaCode" />
        <result column="objectives" property="objectives" />
        <result column="update_time" property="updateTime" />
    </resultMap>

    <select id="queryList" parameterType="java.util.HashMap" resultType="java.util.LinkedHashMap">
         <![CDATA[
select s.*,d.meaning	from  t_double_control s
	left join dict_region d on rpad(s.area_code,6,'0') =d.id
         ]]>
    </select>

    <select id="queryDecompose" parameterType="java.util.HashMap" resultType="java.util.LinkedHashMap">
         <![CDATA[
select * from (
select v.team_title,v.area_code,v.code,d.meaning,v.Business_Time,IFNULL(round((v.f120*0.0001229+v.f150*0.001074122+v.f160*0.001253106+v.f130*0.7143+v.f140*0.00133+v.f170*0.03412+v.f180)*1000/v.f102,4),0) c1,
	IFNULL(round(v.f120*0.0001229+v.f130*0.7143+v.f140*0.00133+v.f170*0.03412+v.f180,4),0) c2,
	IFNULL(round((v.f120*0.0001229+v.f130*0.7143+v.f140*0.00133+v.f170*0.03412+v.f180)*1000/v.f101,4),0) c3,
	IFNULL(round(v.f120/v.f102,4),0) c4,
	IFNULL(round(v.f110/v.f102,4),0) c5,
	IFNULL(round((v.f120*0.0001229+v.f150*0.001074122+v.f160*0.001253106+v.f130*0.7143+v.f140*0.00133+v.f170*0.03412+v.f180)/10000,4),0) c6
	,IFNULL(s.objectives,0)	objectives from t_z1view_data v
	left join t_double_control s on v.area_code =s.area_code
	left join dict_region d on rpad(v.area_code,6,'0') =d.id
	where   v.Business_Time=2019 and v.level=0 order by v.Business_Time) t where t.c1 is not null
         ]]>
    </select>



</mapper>
