feiyu02
2025-09-30 6904763f0e74d9a9fa4dbc39f635d2aee39416c6
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
<?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="cn.flightfeather.supervision.domain.mapper.EvaluationMapper" >
  <resultMap id="BaseResultMap" type="cn.flightfeather.supervision.domain.entity.Evaluation" >
    <!--
      WARNING - @mbg.generated
    -->
    <id column="E_GUID" property="eGuid" jdbcType="VARCHAR" />
    <result column="I_GUID" property="iGuid" jdbcType="VARCHAR" />
    <result column="ST_GUID" property="stGuid" jdbcType="VARCHAR" />
    <result column="S_GUID" property="sGuid" jdbcType="VARCHAR" />
    <result column="E_ScenseTypeID" property="eScensetypeid" jdbcType="TINYINT" />
    <result column="E_ScenseType" property="eScensetype" jdbcType="VARCHAR" />
    <result column="E_SubScenseTypeID" property="eSubscensetypeid" jdbcType="TINYINT" />
    <result column="E_SubScenseType" property="eSubscensetype" jdbcType="VARCHAR" />
    <result column="E_ERType" property="eErtype" jdbcType="TINYINT" />
    <result column="E_ProvinceCode" property="eProvincecode" jdbcType="VARCHAR" />
    <result column="E_ProvinceName" property="eProvincename" jdbcType="VARCHAR" />
    <result column="E_CityCode" property="eCitycode" jdbcType="VARCHAR" />
    <result column="E_CityName" property="eCityname" jdbcType="VARCHAR" />
    <result column="E_DistrictCode" property="eDistrictcode" jdbcType="VARCHAR" />
    <result column="E_DistrictName" property="eDistrictname" jdbcType="VARCHAR" />
    <result column="E_TownCode" property="eTowncode" jdbcType="VARCHAR" />
    <result column="E_TownName" property="eTownname" jdbcType="VARCHAR" />
    <result column="E_ScenseName" property="eScensename" jdbcType="VARCHAR" />
    <result column="E_ScenseAddress" property="eScenseaddress" jdbcType="VARCHAR" />
    <result column="E_EvaluateTime" property="eEvaluatetime" jdbcType="TIMESTAMP" />
    <result column="E_EvaluatorGUID" property="eEvaluatorguid" jdbcType="VARCHAR" />
    <result column="E_EvaluatoruserName" property="eEvaluatorusername" jdbcType="VARCHAR" />
    <result column="E_EvaluatorRealName" property="eEvaluatorrealname" jdbcType="VARCHAR" />
    <result column="E_ResultStandardBef" property="eResultstandardbef" jdbcType="VARCHAR" />
    <result column="E_ResultScoreBef" property="eResultscorebef" jdbcType="VARCHAR" />
    <result column="E_PromissedNum" property="ePromissednum" jdbcType="INTEGER" />
    <result column="E_ChangedNum" property="eChangednum" jdbcType="INTEGER" />
    <result column="ResultStandardAft" property="resultstandardaft" jdbcType="VARCHAR" />
    <result column="E_ResultScoreAft" property="eResultscoreaft" jdbcType="VARCHAR" />
    <result column="E_CreateDate" property="eCreatedate" jdbcType="TIMESTAMP" />
    <result column="E_UpdateDate" property="eUpdatedate" jdbcType="TIMESTAMP" />
    <result column="E_Extension1" property="eExtension1" jdbcType="VARCHAR" />
    <result column="E_Extension2" property="eExtension2" jdbcType="VARCHAR" />
    <result column="E_Extension3" property="eExtension3" jdbcType="VARCHAR" />
    <result column="E_Remark" property="eRemark" jdbcType="VARCHAR" />
  </resultMap>
  <sql id="Base_Column_List" >
    <!--
      WARNING - @mbg.generated
    -->
    E_GUID, I_GUID, ST_GUID, S_GUID, E_ScenseTypeID, E_ScenseType, E_SubScenseTypeID, 
    E_SubScenseType, E_ERType, E_ProvinceCode, E_ProvinceName, E_CityCode, E_CityName, 
    E_DistrictCode, E_DistrictName, E_TownCode, E_TownName, E_ScenseName, E_ScenseAddress, 
    E_EvaluateTime, E_EvaluatorGUID, E_EvaluatoruserName, E_EvaluatorRealName, E_ResultStandardBef, 
    E_ResultScoreBef, E_PromissedNum, E_ChangedNum, ResultStandardAft, E_ResultScoreAft, 
    E_CreateDate, E_UpdateDate, E_Extension1, E_Extension2, E_Extension3, E_Remark
  </sql>
 
  <resultMap id="CreditInfoVo" type="cn.flightfeather.supervision.lightshare.vo.CreditInfoVo">
 
  </resultMap>
  <select id="getAssessments" resultType="map">
    select
      b.UI_GUID as userId,
      b.UI_RealName as userRealName,
      b.UI_Extension2 as sceneType,
      a.E_GUID as  tPGuid,
      a.ST_GUID as tPRuleGuid,
      a.E_ResultScoreBef as totalPoint,
      a.E_PromissedNum as rank,
      a.E_UpdateDate as updateDate
    from ea_t_evaluation as  a right join sm_t_userinfo as  b on a.I_GUID = b.UI_GUID where a.E_ERType = 0 and
      b.UI_Extension1 = #{param1} and (isnull(a.E_EvaluatorRealName) or a.E_EvaluatorRealName = 0)
      <if test="param2 != '' ">
          and b.UI_RealName like '%${param2}%'
      </if>
      <if test="sceneTypes.size() != 0">
          and b.UI_Extension2 in
          <foreach collection="sceneTypes" item="item" index="" separator="," open="(" close=")">
              #{item}
          </foreach>
      </if>
    order by a.E_UpdateDate desc
  </select>
 
  <select id="searchGradeList" resultMap="CreditInfoVo">
    SELECT
      b.UI_GUID AS userId,
      b.UI_RealName AS name,
      b.UI_Extension2 AS sceneType,
      d.CI_Name AS departmentName,
      d.BI_Management_Company AS managementCompany,
      a.E_CreateDate AS updateTime,
      a.E_ResultScoreBef AS score,
      b.UI_Extension1 AS district,
      d.BI_Town_Name AS town,
      b.UI_IsEnable AS status
    FROM
      sm_t_userinfo AS b
      LEFT JOIN ea_t_baseinfo AS d ON b.UI_GUID = d.BI_GUID
      LEFT JOIN (
        SELECT <include refid="Base_Column_List" /> FROM ea_t_evaluation AS t_e
        LEFT JOIN sm_t_evaluationrule AS t_r ON t_e.ST_GUID = t_r.ER_GUID
        WHERE t_e.E_ScenseName = '${period}' AND t_r.ER_RuleType = 0
      ) AS a ON a.I_GUID = b.UI_GUID
    <where>
      b.UI_IsEnable = 1
      AND (b.UI_WorkNo != 'test' OR b.UI_WorkNo IS NULL)
      <if test="provinceCode != null">
        AND d.BI_Province_Code = #{provinceCode}
      </if>
      <if test="provinceName != null">
        AND d.BI_Province_Name = #{provinceName}
      </if>
      <if test="cityCode != null">
        AND d.BI_City_Code = #{cityCode}
      </if>
      <if test="cityName != null">
        AND d.BI_City_Name = #{cityName}
      </if>
      <if test="districtCode != null">
        AND d.BI_District_Code = #{districtCode}
      </if>
      <if test="districtName != null">
        AND d.BI_District_Name = #{districtName}
      </if>
      <if test="townCode != null">
        AND d.BI_Town_Code = #{townCode}
      </if>
      <if test="townName != null">
        AND d.BI_Town_Name = #{townName}
      </if>
      <if test="areaCode != null">
        AND d.BI_Area_Code = #{areaCode}
      </if>
      <if test="area != null">
        AND d.BI_Area = #{area}
      </if>
      <if test="mcId != null">
        AND d.BI_Management_Company_Id = #{mcId}
      </if>
      <if test="mcName != null">
        AND d.BI_Management_Company = #{mcName}
      </if>
      <if test="sceneTypes.size() != 0">
        AND b.UI_Extension2 in
        <foreach collection="sceneTypes" item="type" open="(" separator="," close=")">
          #{type, jdbcType=VARCHAR}
        </foreach>
      </if>
    </where>
    ORDER BY CONVERT (a.E_ResultScoreBef, signed) ${sorts}
  </select>
</mapper>