Commit 537f0292 by wang_jiaxing

修复单位数量超过1000的问题

parent 2c0f847b
...@@ -14,5 +14,4 @@ public class ZcyEntity extends BaseModel { ...@@ -14,5 +14,4 @@ public class ZcyEntity extends BaseModel {
private String jh; private String jh;
private String dwdm; private String dwdm;
private String dwmc; private String dwmc;
private List<String> dwList;
} }
...@@ -233,9 +233,12 @@ ...@@ -233,9 +233,12 @@
AND sfzh = #{sfzh , jdbcType=VARCHAR } AND sfzh = #{sfzh , jdbcType=VARCHAR }
</if> </if>
<if test="dwList != null and dwList.size() > 0"> <if test="dwList != null and dwList.size() > 0">
and dzbl.XXDJDW_GAJGJGDM in and
<foreach collection="dwList" item="dw" open="(" close=")" separator=","> <foreach collection="dwList" item="dws" open="(" close=")" separator=" or ">
#{dw,jdbcType=VARCHAR} dzbl.XXDJDW_GAJGJGDM in
<foreach collection="dws" item="dw" separator="," open="(" close=")">
#{dw,jdbcType=VARCHAR}
</foreach>
</foreach> </foreach>
</if> </if>
</sql> </sql>
......
...@@ -6,6 +6,7 @@ import lombok.Data; ...@@ -6,6 +6,7 @@ import lombok.Data;
import lombok.EqualsAndHashCode; import lombok.EqualsAndHashCode;
import org.springframework.format.annotation.DateTimeFormat; import org.springframework.format.annotation.DateTimeFormat;
import java.util.ArrayList;
import java.util.Date; import java.util.Date;
import java.util.List; import java.util.List;
...@@ -30,5 +31,22 @@ public class BaseModel extends PageModel{ ...@@ -30,5 +31,22 @@ public class BaseModel extends PageModel{
protected String xxlyms; protected String xxlyms;
@TableField(exist = false) @TableField(exist = false)
protected List<String> dwList; protected List<List<String>> dwList;
public void setDwList(List<String> dwList) {
this.dwList = new ArrayList<>();
List<String> dws = new ArrayList<>();
if (dwList.size() < 1000){
this.dwList.add(dwList);
return;
}
for (String dw : dwList) {
if (dws.size() >= 1000) {
this.dwList.add(new ArrayList<>(dws));
dws.clear();
}
dws.add(dw);
}
this.dwList.add(dws);
}
} }
...@@ -102,9 +102,12 @@ ...@@ -102,9 +102,12 @@
and glxx_xxzjbh = #{tbStAppXcxx.glxxXxzjbh , jdbcType=VARCHAR} and glxx_xxzjbh = #{tbStAppXcxx.glxxXxzjbh , jdbcType=VARCHAR}
</if> </if>
<if test="tbStAppXcxx.dwList != null and tbStAppXcxx.dwList.size() > 0"> <if test="tbStAppXcxx.dwList != null and tbStAppXcxx.dwList.size() > 0">
and XXDJDW_GAJGJGDM in and
<foreach collection="tbStAppXcxx.dwList" item="dw" open="(" close=")" separator=","> <foreach collection="tbStAppXcxx.dwList" item="dws" open="(" close=")" separator=" or ">
#{dw,jdbcType=VARCHAR} XXDJDW_GAJGJGDM in
<foreach collection="dws" item="dw" separator="," open="(" close=")">
#{dw,jdbcType=VARCHAR}
</foreach>
</foreach> </foreach>
</if> </if>
order by djsj desc order by djsj desc
...@@ -152,9 +155,12 @@ ...@@ -152,9 +155,12 @@
and glxx_xxzjbh = #{tbStAppXcxx.glxxXxzjbh , jdbcType=VARCHAR} and glxx_xxzjbh = #{tbStAppXcxx.glxxXxzjbh , jdbcType=VARCHAR}
</if> </if>
<if test="tbStAppXcxx.dwList != null and tbStAppXcxx.dwList.size() > 0"> <if test="tbStAppXcxx.dwList != null and tbStAppXcxx.dwList.size() > 0">
and XXDJDW_GAJGJGDM in and
<foreach collection="tbStAppXcxx.dwList" item="dw" open="(" close=")" separator=","> <foreach collection="tbStAppXcxx.dwList" item="dws" open="(" close=")" separator=" or ">
#{dw,jdbcType=VARCHAR} XXDJDW_GAJGJGDM in
<foreach collection="dws" item="dw" separator="," open="(" close=")">
#{dw,jdbcType=VARCHAR}
</foreach>
</foreach> </foreach>
</if> </if>
</select> </select>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment