Skip to content

Commit 0d95dfc

Browse files
committed
fix: user select sql
1 parent bb8b973 commit 0d95dfc

File tree

2 files changed

+45
-13
lines changed

2 files changed

+45
-13
lines changed

backend/crm/src/main/java/cn/cordys/crm/system/mapper/ExtOrganizationUserMapper.xml

Lines changed: 44 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -146,19 +146,51 @@
146146
</include>
147147
</when>
148148
<when test="condition.name == 'status'">
149-
<if test="condition.value == true">
150-
sou.enable is true
149+
<if test="condition.operator == 'IN'">
150+
<if test="condition.value == true">
151+
sou.enable is true
152+
</if>
153+
<if test="condition.value == false">
154+
sou.enable is false
155+
</if>
151156
</if>
152-
<if test="condition.value == false">
153-
sou.enable is false
157+
<if test="condition.operator == 'NOT_IN'">
158+
<if test="condition.value == true">
159+
sou.enable is false
160+
</if>
161+
<if test="condition.value == false">
162+
sou.enable is true
163+
</if>
164+
</if>
165+
<if test="condition.operator == 'EMPTY'">
166+
sou.enable IS NULL
167+
</if>
168+
<if test="condition.operator == 'NOT_EMPTY'">
169+
sou.enable IS NOT NULL
154170
</if>
155171
</when>
156172
<when test="condition.name == 'gender'">
157-
<if test="condition.value == 'female'">
158-
su.gender is true
173+
<if test="condition.operator == 'IN'">
174+
<if test="condition.value == 'female'">
175+
su.gender is true
176+
</if>
177+
<if test="condition.value == 'male'">
178+
su.gender is false
179+
</if>
180+
</if>
181+
<if test="condition.operator == 'NOT_IN'">
182+
<if test="condition.value == 'female'">
183+
su.gender is false
184+
</if>
185+
<if test="condition.value == 'male'">
186+
su.gender is true
187+
</if>
188+
</if>
189+
<if test="condition.operator == 'EMPTY'">
190+
su.gender IS NULL
159191
</if>
160-
<if test="condition.value == 'male'">
161-
su.gender is false
192+
<if test="condition.operator == 'NOT_EMPTY'">
193+
su.gender IS NOT NULL
162194
</if>
163195
</when>
164196
<when test="condition.name == 'email'">
@@ -200,13 +232,13 @@
200232
<when test="condition.name == 'updateUser'">
201233
<include refid="cn.cordys.common.mapper.CommonMapper.condition">
202234
<property name="condition" value="condition"/>
203-
<property name="column" value="su.update_user"/>
235+
<property name="column" value="sou.update_user"/>
204236
</include>
205237
</when>
206238
<when test="condition.name == 'createUser'">
207239
<include refid="cn.cordys.common.mapper.CommonMapper.condition">
208240
<property name="condition" value="condition"/>
209-
<property name="column" value="su.create_user"/>
241+
<property name="column" value="sou.create_user"/>
210242
</include>
211243
</when>
212244
<when test="condition.name == 'onboardingDate'">
@@ -218,13 +250,13 @@
218250
<when test="condition.name == 'createTime'">
219251
<include refid="cn.cordys.common.mapper.CommonMapper.condition">
220252
<property name="condition" value="condition"/>
221-
<property name="column" value="su.create_time"/>
253+
<property name="column" value="sou.create_time"/>
222254
</include>
223255
</when>
224256
<when test="condition.name == 'updateTime'">
225257
<include refid="cn.cordys.common.mapper.CommonMapper.condition">
226258
<property name="condition" value="condition"/>
227-
<property name="column" value="su.update_time"/>
259+
<property name="column" value="sou.update_time"/>
228260
</include>
229261
</when>
230262
<when test="condition.name == 'workCity'">

backend/crm/src/test/java/cn/cordys/crm/system/controller/OrganizationUserControllerTests.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -396,7 +396,7 @@ public void testUserListForCombineSearch() throws Exception {
396396
// 是否启用 enable
397397
filterConditionList.clear();
398398
booleanCondition = new FilterCondition();
399-
booleanCondition.setOperator(FilterCondition.CombineConditionOperator.EQUALS.name());
399+
booleanCondition.setOperator(FilterCondition.CombineConditionOperator.IN.name());
400400
booleanCondition.setName("status");
401401
booleanCondition.setValue(false);
402402
filterConditionList.add(booleanCondition);

0 commit comments

Comments
 (0)