NoticePersonMapper.xml
3.96 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
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
<?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.xiniunet.service.railway.dal.NoticePersonMapper">
<resultMap id="NoticePersionPo" type="com.xiniunet.service.railway.po.NoticePersonPO">
<id column="id" property="id" />
<id column="tenant_id" property="tenantId" />
<id column="type" property="type" />
<id column="object1_type" property="object1Type" />
<id column="object1_id" property="object1Id" />
<id column="object1_name" property="object1Name" />
<id column="object2_type" property="object2Type" />
<id column="object2_id" property="object2Id" />
<id column="object2_name" property="object2Name" />
<id column="object3_type" property="object3Type" />
<id column="object3_id" property="object3Id" />
<id column="object3_name" property="object3Name" />
<id column="user_id" property="userId" />
<id column="user_name" property="userName" />
<id column="user_email" property="userEmail" />
<id column="user_mobile" property="userMobile" />
<id column="is_active" property="isActive" />
<id column="remark" property="remark" />
<id column="role_code" property="roleCode" />
<id column="row_version" property="rowVersion" />
<id column="is_deleted" property="isDeleted" />
<id column="created_by" property="createdBy" />
<id column="creation_time" property="creationTime" />
<id column="last_updated_by" property="lastUpdatedBy" />
<id column="last_update_time" property="lastUpdateTime" />
</resultMap>
<sql id="entityColumnList">
`id`, `tenant_id`, `type`,
`object1_type`, `object1_id`, `object1_name`,
`object2_type`, `object2_id`, `object2_name`,
`object3_type`, `object3_id`, `object3_name`,
`user_id`, `user_name`, `user_email`, `user_mobile`, `is_active`, `remark`, role_code,
`row_version`,
`is_deleted`,
`created_by`,
`creation_time`,
`last_updated_by`,
`last_update_time`
</sql>
<select id="queryPersonByLine" resultType="com.xiniunet.service.railway.po.NoticePersonPO">
SELECT
<include refid="entityColumnList"/>
FROM
MD_NOTICE_PERSON
WHERE
`type` = "event_by_line"
AND object2_type IS NULL
AND is_active = true
AND is_deleted = 0
<if test="objType1 != null and objType1 != ''">
AND object1_type = #{objType1}
</if>
<if test="objId1 != null and objId1 != ''">
AND object1_id = #{objId1}
</if>
</select>
<select id="queryPersonByStation" resultType="com.xiniunet.service.railway.po.NoticePersonPO">
SELECT
<include refid="entityColumnList"/>
FROM
MD_NOTICE_PERSON
WHERE
`type` = "event_by_station"
AND is_active = true
AND is_deleted = 0
<if test="objType1 != null and objType1 != ''">
AND object1_type = #{objType1}
</if>
<if test="objId1 != null and objId1 != ''">
AND object1_id = #{objId1}
</if>
<if test="objType2 != null and objType2 != ''">
AND object2_type = #{objType2}
</if>
<if test="objId2 != null and objId2 != ''">
AND object2_id = #{objId2}
</if>
</select>
<select id="queryPersonByHotline" resultType="com.xiniunet.service.railway.po.NoticePersonPO">
SELECT
<include refid="entityColumnList"/>
FROM
MD_NOTICE_PERSON
WHERE
`type` = "hotline"
AND (object1_type IS NULL or object1_type = '')
AND (object2_type IS NULL or object2_type = '')
AND is_active = true
AND is_deleted = 0
</select>
</mapper>