MYgxxMapper.xml
5.4 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
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
152
153
154
155
156
157
158
159
<?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.hotent.lpg.manage.dao.MYgxxDao">
<!-- 通用查询映射结果 -->
<resultMap id="BaseResultMap" type="com.hotent.lpg.common.model.WYgxx">
<id column="ID_" property="id" />
<result column="REF_ID_" property="refId" />
<result column="F_ssqyID" property="fSsqyid" />
<result column="F_ssczID" property="fSsczid" />
<result column="F_xm" property="fXm" />
<result column="F_sjh" property="fSjh" />
<result column="F_rzsj" property="fRzsj" />
<result column="F_sfzh" property="fSfzh" />
<result column="F_sslx" property="fSslx" />
<result column="F_mm" property="fMm" />
<result column="F_xb" property="fXb" />
<result column="F_zt" property="fZt" />
<result column="F_cjr" property="fCjr" />
<result column="F_cjsj" property="fCjsj" />
<result column="F_gxr" property="fGxr" />
<result column="F_gxsj" property="fGxsj" />
<result column="F_ssqymc" property="fSsqymc" />
<result column="F_ssczmc" property="fSsczmc" />
<result column="F_form_data_rev_" property="fFormDataRev" />
<result column="F_jsmc" property="fJsmc" />
<result column="F_jscode" property="fJscode" />
<result column="F_htzzcode" property="fHtzzcode" />
<result column="F_userID" property="fUserid" />
<result column="F_zxzsbh" property="fZxzsbh" />
<result column="F_zxzsyxqx" property="fZxzsyxqx" />
<result column="F_zxzstp" property="fZxzstp" />
<result column="F_sfztp" property="fSfztp" />
<result column="F_bz" property="fBz" />
<result column="F_ewm" property="fEwm" />
<result column="F_ygbh" property="fYgbh" />
</resultMap>
<!-- 通用查询结果列 -->
<sql id="Base_Column_List">
ID_,
REF_ID_,
F_ssqyID,
F_ssczID,
F_xm,
F_sjh,
F_rzsj,
F_sfzh,
F_sslx,
F_mm,
F_xb,
F_zt,
F_cjr,
F_cjsj,
F_gxr,
F_gxsj,
F_ssqymc,
F_ssczmc,
F_form_data_rev_,
F_jsmc,
F_jscode,
F_htzzcode,
F_userID,
F_zxzsbh,
F_zxzsyxqx,
F_zxzstp,
F_sfztp,
F_bz,
F_ewm,
F_ygbh
</sql>
<select id="selectPage" resultMap="BaseResultMap">
select
<include refid="Base_Column_List"/>
from
w_ygxx
${ew.customSqlSegment}
</select>
<select id="selectList" resultMap="BaseResultMap">
select
<include refid="Base_Column_List"/>
from
w_ygxx
${ew.customSqlSegment}
</select>
<select id="selectById" resultMap="BaseResultMap">
select
<include refid="Base_Column_List"/>
from
w_ygxx
where
ID_ = #{id}
</select>
<select id="pageList" resultMap="BaseResultMap">
select
w_ygxx.*
from w_ygxx
<where>
<if test="query.name != null and query.name != ''">
and w_ygxx.f_xm like concat('%',#{query.name},'%')
</if>
<if test="query.phone != null and query.phone != ''">
and w_ygxx.F_sjh like concat('%',#{query.phone},'%')
</if>
<if test="query.state != null and query.state != ''">
and w_ygxx.F_zt = #{query.state}
</if>
<if test="list != null and list.size() > 0">
and ( w_ygxx.F_ssqyID in
<foreach collection="list" open="(" close=")" item="orgId" separator=",">
#{orgId}
</foreach>
or w_ygxx.F_ssczID in
<foreach collection="list" open="(" close=")" item="orgId" separator=",">
#{orgId}
</foreach>
)
</if>
<if test="query.lx != null and query.lx != ''">
<if test="query.lx == '1'.toString()">
and w_ygxx.F_ssqyID = #{query.orgId}
<if test="query.flag != null and query.flag">
and w_ygxx.f_sslx = '企业员工'
</if>
</if>
<if test="query.lx == '2'.toString()">
and w_ygxx.F_ssczID = #{query.orgId}
</if>
</if>
</where>
order by w_ygxx.F_ssqyID,w_ygxx.F_ssczID,w_ygxx.F_userID desc
</select>
<select id="listByOrgIdAndUserId" resultMap="BaseResultMap">
select * from w_ygxx
where f_userID = #{userId} and ((F_ssqyID = #{orgId} and F_sslx = '企业员工') OR (F_ssczID = #{orgId}))
</select>
<select id="countByCzId" resultType="java.lang.Integer">
select
count(*)
<if test="type == null or type == ''">
from w_ygxx where F_ssczID = #{czId}
</if>
<if test="type != null and type != ''">
<if test="type == '1'.toString()">
from ( select count(*) as sl from w_ygxx where F_ssczID = #{czId} group by F_userID ) temp1
</if>
</if>
</select>
<select id="userIdByCzId" resultType="java.lang.String">
select distinct f_userID from w_ygxx where F_ssczID = #{czId}
</select>
</mapper>