CorePersonnelMapper.xml
2.24 KB
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
<?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.lframework.xingyun.sc.mappers.CorePersonnelMapper">
<resultMap id="CorePersonnel" type="com.lframework.xingyun.sc.entity.CorePersonnel">
<id column="id" property="id"/>
<result column="credit_id" property="creditId"/>
<result column="name" property="name"/>
<result column="sex" property="sex"/>
<result column="native_place" property="nativePlace"/>
<result column="age" property="age"/>
<result column="position" property="position"/>
<result column="mobile" property="mobile"/>
<result column="phone" property="phone"/>
<result column="email" property="email"/>
<result column="address" property="address"/>
<result column="create_by_id" property="createById"/>
<result column="create_by" property="createBy"/>
<result column="update_by_id" property="updateById"/>
<result column="update_by" property="updateBy"/>
<result column="create_time" property="createTime"/>
<result column="update_time" property="updateTime"/>
</resultMap>
<sql id="CorePersonnel_sql">
SELECT
tb.id,
tb.credit_id,
tb.name,
tb.sex,
tb.native_place,
tb.age,
tb.position,
tb.mobile,
tb.phone,
tb.email,
tb.address,
tb.create_by_id,
tb.create_by,
tb.update_by_id,
tb.update_by,
tb.create_time,
tb.update_time
FROM core_personnel AS tb
</sql>
<select id="query" resultMap="CorePersonnel">
<include refid="CorePersonnel_sql"/>
<where>
<if test="vo.creditId != null and vo.creditId != ''">
AND tb.credit_id = #{vo.creditId}
</if>
<if test="vo.name != null and vo.name != ''">
AND tb.name LIKE CONCAT('%', #{vo.name})
</if>
<if test="vo.sex != null and vo.sex != ''">
AND tb.sex = #{vo.sex}
</if>
</where>
</select>
</mapper>