|
@@ -69,6 +69,27 @@ |
|
@@ -69,6 +69,27 @@ |
|
69
|
<if test="vo.available != null">
|
69
|
<if test="vo.available != null">
|
|
70
|
AND c.available = #{vo.available}
|
70
|
AND c.available = #{vo.available}
|
|
71
|
</if>
|
71
|
</if>
|
|
|
|
72
|
+ <choose>
|
|
|
|
73
|
+ <when test="vo.source == 'CUSTOMER_CREDIT'">
|
|
|
|
74
|
+ AND NOT EXISTS (
|
|
|
|
75
|
+ SELECT 1
|
|
|
|
76
|
+ FROM customer_credit cc
|
|
|
|
77
|
+ WHERE cc.company_id = c.id
|
|
|
|
78
|
+ AND cc.status != 'CANCEL'
|
|
|
|
79
|
+ )
|
|
|
|
80
|
+ </when>
|
|
|
|
81
|
+ <when test="vo.source == 'CUSTOMER_DEVELOP'">
|
|
|
|
82
|
+ AND NOT EXISTS (
|
|
|
|
83
|
+ SELECT 1
|
|
|
|
84
|
+ FROM customer_develop_plan cdp
|
|
|
|
85
|
+ WHERE cdp.customer_id = c.id
|
|
|
|
86
|
+ AND cdp.status != 'CANCEL'
|
|
|
|
87
|
+ )
|
|
|
|
88
|
+ </when>
|
|
|
|
89
|
+ <otherwise>
|
|
|
|
90
|
+ AND 1 = 1 <!-- 确保查询到任何数据 -->
|
|
|
|
91
|
+ </otherwise>
|
|
|
|
92
|
+ </choose>
|
|
72
|
</if>
|
93
|
</if>
|
|
73
|
</where>
|
94
|
</where>
|
|
74
|
ORDER BY c.code
|
95
|
ORDER BY c.code
|
|
@@ -99,14 +120,27 @@ |
|
@@ -99,14 +120,27 @@ |
|
99
|
<if test="vo.available != null">
|
120
|
<if test="vo.available != null">
|
|
100
|
AND c.available = #{vo.available}
|
121
|
AND c.available = #{vo.available}
|
|
101
|
</if>
|
122
|
</if>
|
|
102
|
- <if test="vo.source == 'CUSTOMER_CREDIT'">
|
|
|
|
103
|
- AND NOT EXISTS (
|
|
|
|
104
|
- SELECT 1
|
|
|
|
105
|
- FROM customer_credit cc
|
|
|
|
106
|
- WHERE cc.company_id = c.id
|
|
|
|
107
|
- AND cc.status != 'CANCEL'
|
|
|
|
108
|
- )
|
|
|
|
109
|
- </if>
|
123
|
+ <choose>
|
|
|
|
124
|
+ <when test="vo.source == 'CUSTOMER_CREDIT'">
|
|
|
|
125
|
+ AND NOT EXISTS (
|
|
|
|
126
|
+ SELECT 1
|
|
|
|
127
|
+ FROM customer_credit cc
|
|
|
|
128
|
+ WHERE cc.company_id = c.id
|
|
|
|
129
|
+ AND cc.status != 'CANCEL'
|
|
|
|
130
|
+ )
|
|
|
|
131
|
+ </when>
|
|
|
|
132
|
+ <when test="vo.source == 'CUSTOMER_DEVELOP'">
|
|
|
|
133
|
+ AND NOT EXISTS (
|
|
|
|
134
|
+ SELECT 1
|
|
|
|
135
|
+ FROM customer_develop_plan cdp
|
|
|
|
136
|
+ WHERE cdp.customer_id = c.id
|
|
|
|
137
|
+ AND cdp.status != 'CANCEL'
|
|
|
|
138
|
+ )
|
|
|
|
139
|
+ </when>
|
|
|
|
140
|
+ <otherwise>
|
|
|
|
141
|
+ AND 1 = 1 <!-- 确保查询到任何数据 -->
|
|
|
|
142
|
+ </otherwise>
|
|
|
|
143
|
+ </choose>
|
|
110
|
</if>
|
144
|
</if>
|
|
111
|
</where>
|
145
|
</where>
|
|
112
|
ORDER BY c.code
|
146
|
ORDER BY c.code
|