Browse Source

修改交换分页不同查询条件

lfy 2 weeks ago
parent
commit
41ad414ade

+ 43 - 10
delivery-module-core/delivery-module-core-biz/src/main/resources/mapper/dwxx/DwxxMapper.xml

@@ -65,17 +65,28 @@
65
         <where>
65
         <where>
66
             cd.bz is null
66
             cd.bz is null
67
             and cd.qyxz!='10'
67
             and cd.qyxz!='10'
68
-            and cd.DELETED=0   and (t1.cfnum!=0   or  t2.yxcfnum!=0)
68
+            and cd.DELETED=0
69
+            <choose>
70
+                <when test=" (pageReqVO.cflx!=null and pageReqVO.cflx!='')
71
+                         or (pageReqVO.cfzt!=null and pageReqVO.cfzt!='')
72
+                         or (pageReqVO.cfStart!=null and pageReqVO.cfStart !='')
73
+                         or (pageReqVO.cfEnd!=null and pageReqVO.cfEnd !='') ">
74
+                    and t1.cfnum !=0
75
+                </when>
76
+                <otherwise>
77
+                   and  (t1.cfnum !=0  or t2.yxcfnum !=0)
78
+                </otherwise>
79
+            </choose>
69
             <if test="pageReqVO.areaCode!=null and pageReqVO.areaCode!=''">
80
             <if test="pageReqVO.areaCode!=null and pageReqVO.areaCode!=''">
70
                 and ck.xzqhdm like #{pageReqVO.areaCode}
81
                 and ck.xzqhdm like #{pageReqVO.areaCode}
71
             </if>
82
             </if>
72
-            <if test="pageReqVO.kqStart!=null and pageReqVO.kqStart!='' and pageReqVO.kqEnd!=null and pageReqVO.kqEnd!=''">
83
+            <if test="pageReqVO.kqStart!=null and pageReqVO.kqEnd!=null ">
73
                 and t1.sjcrNum between #{pageReqVO.kqStart} and #{pageReqVO.kqEnd}
84
                 and t1.sjcrNum between #{pageReqVO.kqStart} and #{pageReqVO.kqEnd}
74
             </if>
85
             </if>
75
-            <if test="pageReqVO.kqStart!=null and pageReqVO.kqStart!='' and (pageReqVO.kqEnd==null or pageReqVO.kqEnd=='')">
86
+            <if test="pageReqVO.kqStart!=null  and pageReqVO.kqEnd==null ">
76
                 and t1.sjcrNum <![CDATA[>=]]>  #{pageReqVO.kqStart}
87
                 and t1.sjcrNum <![CDATA[>=]]>  #{pageReqVO.kqStart}
77
             </if>
88
             </if>
78
-            <if test="(pageReqVO.kqStart==null or pageReqVO.kqStart=='') and pageReqVO.kqEnd!=null and pageReqVO.kqEnd!=''">
89
+            <if test="pageReqVO.kqStart==null  and pageReqVO.kqEnd!=null ">
79
                 and t1.sjcrNum <![CDATA[<=]]>  #{pageReqVO.kqEnd}
90
                 and t1.sjcrNum <![CDATA[<=]]>  #{pageReqVO.kqEnd}
80
             </if>           
91
             </if>           
81
             <if test="pageReqVO.dwmc!=null and pageReqVO.dwmc!=''">
92
             <if test="pageReqVO.dwmc!=null and pageReqVO.dwmc!=''">
@@ -139,13 +150,24 @@
139
         <where>
150
         <where>
140
             cd.qyxz!='10'
151
             cd.qyxz!='10'
141
             and cd.DELETED=0
152
             and cd.DELETED=0
142
-            <if test="pageReqVO.kqStart!=null and pageReqVO.kqStart!='' and pageReqVO.kqEnd!=null and pageReqVO.kqEnd!=''">
153
+            <choose>
154
+                <when test=" (pageReqVO.cflx!=null and pageReqVO.cflx!='')
155
+                         or (pageReqVO.cfzt!=null and pageReqVO.cfzt!='')
156
+                         or (pageReqVO.cfStart!=null and pageReqVO.cfStart !='')
157
+                         or (pageReqVO.cfEnd!=null and pageReqVO.cfEnd !='') ">
158
+                    and t1.cfnum !=0
159
+                </when>
160
+                <otherwise>
161
+                   and  (t1.cfnum !=0  or t2.yxcfnum !=0)
162
+                </otherwise>
163
+            </choose>
164
+            <if test="pageReqVO.kqStart!=null  and pageReqVO.kqEnd!=null">
143
                 and t1.sjcrNum between #{pageReqVO.kqStart} and #{pageReqVO.kqEnd}
165
                 and t1.sjcrNum between #{pageReqVO.kqStart} and #{pageReqVO.kqEnd}
144
             </if>
166
             </if>
145
-            <if test="pageReqVO.kqStart!=null and pageReqVO.kqStart!='' and (pageReqVO.kqEnd==null or pageReqVO.kqEnd=='')">
167
+            <if test="pageReqVO.kqStart!=null  and pageReqVO.kqEnd==null">
146
                 and t1.sjcrNum <![CDATA[>=]]>  #{pageReqVO.kqStart}
168
                 and t1.sjcrNum <![CDATA[>=]]>  #{pageReqVO.kqStart}
147
             </if>
169
             </if>
148
-            <if test="(pageReqVO.kqStart==null or pageReqVO.kqStart=='') and pageReqVO.kqEnd!=null and pageReqVO.kqEnd!=''">
170
+            <if test="pageReqVO.kqStart==null  and pageReqVO.kqEnd!=null">
149
                 and t1.sjcrNum <![CDATA[<=]]>  #{pageReqVO.kqEnd}
171
                 and t1.sjcrNum <![CDATA[<=]]>  #{pageReqVO.kqEnd}
150
             </if>
172
             </if>
151
             <if test="pageReqVO.dwmc!=null and pageReqVO.dwmc!=''">
173
             <if test="pageReqVO.dwmc!=null and pageReqVO.dwmc!=''">
@@ -246,13 +268,24 @@
246
         ) t3 on t3.KQ_ID=ck.id
268
         ) t3 on t3.KQ_ID=ck.id
247
         <where>
269
         <where>
248
             cd.qyxz!='10' and cd.DELETED=0
270
             cd.qyxz!='10' and cd.DELETED=0
249
-            <if test="pageReqVO.kqStart!=null and pageReqVO.kqStart!='' and pageReqVO.kqEnd!=null and pageReqVO.kqEnd!=''">
271
+            <choose>
272
+                <when test=" (pageReqVO.cflx!=null and pageReqVO.cflx!='')
273
+                         or (pageReqVO.cfzt!=null and pageReqVO.cfzt!='')
274
+                         or (pageReqVO.cfStart!=null and pageReqVO.cfStart !='')
275
+                         or (pageReqVO.cfEnd!=null and pageReqVO.cfEnd !='') ">
276
+                    and t1.cfnum !=0
277
+                </when>
278
+                <otherwise>
279
+                   and  (t1.cfnum !=0  or t2.yxcfnum !=0)
280
+                </otherwise>
281
+            </choose>
282
+            <if test="pageReqVO.kqStart!=null and pageReqVO.kqEnd!=null">
250
                 and t1.sjcrNum between #{pageReqVO.kqStart} and #{pageReqVO.kqEnd}
283
                 and t1.sjcrNum between #{pageReqVO.kqStart} and #{pageReqVO.kqEnd}
251
             </if>
284
             </if>
252
-            <if test="pageReqVO.kqStart!=null and pageReqVO.kqStart!='' and (pageReqVO.kqEnd==null or pageReqVO.kqEnd=='')">
285
+            <if test="pageReqVO.kqStart!=null and pageReqVO.kqEnd==null ">
253
                 and t1.sjcrNum <![CDATA[>=]]>  #{pageReqVO.kqStart}
286
                 and t1.sjcrNum <![CDATA[>=]]>  #{pageReqVO.kqStart}
254
             </if>
287
             </if>
255
-            <if test="(pageReqVO.kqStart==null or pageReqVO.kqStart=='') and pageReqVO.kqEnd!=null and pageReqVO.kqEnd!=''">
288
+            <if test="pageReqVO.kqStart==null  and pageReqVO.kqEnd!=null">
256
                 and t1.sjcrNum <![CDATA[<=]]>  #{pageReqVO.kqEnd}
289
                 and t1.sjcrNum <![CDATA[<=]]>  #{pageReqVO.kqEnd}
257
             </if>
290
             </if>
258
             <if test="pageReqVO.dwmc!=null and pageReqVO.dwmc!=''">
291
             <if test="pageReqVO.dwmc!=null and pageReqVO.dwmc!=''">