<?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.tofly.gpsboot.mapper.comm.StatementAssessMapper">

    <resultMap id="statementAssessMap" type="com.tofly.pojo.statement.StatementAssess">
        <id property="id" column="ID"/>
        <result property="type" column="TYPE"/>
        <result property="year" column="YEAR"/>
        <result property="quarter" column="QUARTER"/>
        <result property="month" column="MONTH"/>
        <result property="week" column="WEEK"/>
        <result property="day" column="DAY"/>
        <result property="statisticalUserId" column="STATISTICAL_USER_ID"/>
        <result property="assessUserId" column="ASSESS_USER_ID"/>
        <result property="assessTime" column="ASSESS_TIME"/>
        <result property="assessNote" column="ASSESS_NOTE"/>
        <result property="assessScore" column="ASSESS_SCORE"/>
        <result property="typeId" column="TYPE_ID"/>
        <result property="vaildSpeed" column="VAILD_SPEED"/>
        <result property="findTroubleNum" column="FIND_TROUBLE_NUM"/>
        <result property="buildingsitefinded" column="BUILDINGSITEFINDED"/>
        <result property="planNum" column="PLAN_NUM"/>
        <result property="totalCount" column="TOTAL_COUNT"/>
        <result property="totalLenth" column="TOTAL_LENTH"/>
        <result property="totalOverCount" column="TOTAL_OVER_COUNT"/>
        <result property="totalOverLenth" column="TOTAL_OVER_LENTH"/>
        <result property="totalOverEtCount" column="TOTAL_OVER_ET_COUNT"/>
        <result property="totalOverCountRate" column="TOTAL_OVER_COUNT_RATE"/>
        <result property="totalOverLenthRate" column="TOTAL_OVER_LENTH_RATE"/>
        <result property="totalLossRate" column="TOTAL_LOSS_RATE"/>
        <result property="totalEtLossRate" column="TOTAL_ET_LOSS_RATE"/>
        <result property="totalOverEtCountRate" column="TOTAL_OVER_ET_COUNT_RATE"/>
        <result property="userOverCount" column="USER_OVER_COUNT"/>
        <result property="userOverLenth" column="USER_OVER_LENTH"/>
        <result property="userOverEtCount" column="USER_OVER_ET_COUNT"/>
        <result property="userOverCountRate" column="USER_OVER_COUNT_RATE"/>
        <result property="userOverLenthRate" column="USER_OVER_LENTH_RATE"/>
        <result property="userOverEtCountRate" column="USER_OVER_ET_COUNT_RATE"/>
        <association property="typeName" column="TYPE" select="gettypeName"/>
        <association property="typeIdName" column="TYPE_ID"
                     select="com.tofly.gpsboot.mapper.plan.PlantypeMapper.getTypeName"/>
        <association property="statisticalUserIdName" column="STATISTICAL_USER_ID"
                     select="com.tofly.gpsboot.mapper.plan.HydrantrecordMapper.getRealName"/>
        <association property="assessUserIdName" column="ASSESS_USER_ID"
                     select="com.tofly.gpsboot.mapper.plan.HydrantrecordMapper.getRealName"/>

    </resultMap>

    <select id="gettypeName" resultType="string">
        SELECT CNAME
        FROM
            TF_YWPN_SYSCHILDCODE_D
        WHERE
            PCID =52400
          AND
            CCODE = #{type}
    </select>

</mapper>
