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
<?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.yiboshi.science.dao.ComTalentMembersDAO">
<!-- 通用查询映射结果 -->
<resultMap id="BaseResultMap" type="com.yiboshi.science.entity.ComTalentMembers">
<id column="id" property="id"/>
<result column="talent_id" property="talentId"/>
<result column="name" property="name"/>
<result column="sex" property="sex"/>
<result column="birthday" property="birthday"/>
<result column="spec" property="spec"/>
<result column="duty" property="duty"/>
<result column="work_unit" property="workUnit"/>
<result column="proj_work" property="projWork"/>
<result column="remark" property="remark"/>
<result column="create_time" property="createTime"/>
<result column="update_time" property="updateTime"/>
<result column="create_user" property="createUser"/>
<result column="update_user" property="updateUser"/>
<result column="del_flag" property="delFlag"/>
</resultMap>
<!-- 通用查询结果列 -->
<sql id="Base_Column_List">
id, talent_id, name, sex, birthday, spec, duty, work_unit, proj_work, remark,
create_time, update_time, create_user, update_user, del_flag
</sql>
<!-- 分页查询 -->
<select id="selectPage" resultMap="BaseResultMap">
SELECT
<include refid="Base_Column_List"/>
FROM com_talent_members
WHERE del_flag = 0
<if test="query.talentId != null and query.talentId != ''">
AND talent_id = #{query.talentId}
</if>
<if test="query.name != null and query.name != ''">
AND name LIKE CONCAT('%', #{query.name}, '%')
</if>
<if test="query.workUnit != null and query.workUnit != ''">
AND work_unit LIKE CONCAT('%', #{query.workUnit}, '%')
</if>
ORDER BY create_time DESC
</select>
<select id="getListByTalentId" parameterType="java.lang.String" resultType="com.yiboshi.science.param.dto.ComTalentMembersDTO">
SELECT a.*,d.name duty_name,f.name spec_name
FROM com_talent_members a
left join system_parameter d on a.duty = d.id and d.type_id = 62
left join system_parameter f on a.spec = f.id and f.type_id = 68
where talent_id=#{talentId}
order by a.show_index asc
</select>
</mapper>