|
@@ -23,10 +23,40 @@
|
|
|
<result column="xing_zhi" property="xingZhi" />
|
|
|
<result column="key_code" property="keyCode" />
|
|
|
</resultMap>
|
|
|
+ <resultMap id="BaseResultMapVO" type="com.hssx.pcbms.entity.vo.UserVO">
|
|
|
+ <id column="id" property="id" />
|
|
|
+ <result column="name" property="name" />
|
|
|
+ <result column="phone" property="phone" />
|
|
|
+ <result column="dept_id" property="deptId" />
|
|
|
+ <result column="role_name" property="roleName" />
|
|
|
+ <association property="score" resultMap="BaseResultMapScore">
|
|
|
+ </association>
|
|
|
+ </resultMap>
|
|
|
+
|
|
|
+ <resultMap id="BaseResultMapScore" type="com.hssx.pcbms.entity.Score">
|
|
|
+ <id column="score_id" property="scoreId" />
|
|
|
+ <result column="personal_score" property="personalScore" />
|
|
|
+ <result column="idea_score" property="ideaScore" />
|
|
|
+ <result column="total" property="total" />
|
|
|
+ <result column="reason" property="reason" />
|
|
|
+ <result column="rater_id" property="raterId" />
|
|
|
+ <result column="rater" property="rater" />
|
|
|
+ <result column="uid" property="uid" />
|
|
|
+ <result column="scoring_year_month" property="scoringYearMonth" />
|
|
|
+ </resultMap>
|
|
|
|
|
|
<!-- 通用查询结果列 -->
|
|
|
<sql id="Base_Column_List">
|
|
|
id, head_url, name, phone, dept_id, is_pass, indate, password, role_name, email, sex, birthday, office_phone, job_title, login_name, login_password, xing_zhi, key_code
|
|
|
</sql>
|
|
|
-
|
|
|
+ <select id="selectListByCondition" resultMap="BaseResultMapVO">
|
|
|
+ SELECT
|
|
|
+ u.id, u.name, u.phone, u.dept_id,sr.rolename role_name,(SELECT total FROM score WHERE uid = u.id AND scoring_year_month = DATE_FORMAT(NOW(),'%Y-%m')) total
|
|
|
+ FROM
|
|
|
+ USER u
|
|
|
+ LEFT JOIN user_role ur
|
|
|
+ ON u.id = ur.user_id
|
|
|
+ LEFT JOIN sys_role sr
|
|
|
+ ON sr.id = ur.role_id
|
|
|
+ </select>
|
|
|
</mapper>
|