Commit 537f0292 by wang_jiaxing

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

parent 2c0f847b
......@@ -14,5 +14,4 @@ public class ZcyEntity extends BaseModel {
private String jh;
private String dwdm;
private String dwmc;
private List<String> dwList;
}
......@@ -233,9 +233,12 @@
AND sfzh = #{sfzh , jdbcType=VARCHAR }
</if>
<if test="dwList != null and dwList.size() > 0">
and dzbl.XXDJDW_GAJGJGDM in
<foreach collection="dwList" item="dw" open="(" close=")" separator=",">
#{dw,jdbcType=VARCHAR}
and
<foreach collection="dwList" item="dws" open="(" close=")" separator=" or ">
dzbl.XXDJDW_GAJGJGDM in
<foreach collection="dws" item="dw" separator="," open="(" close=")">
#{dw,jdbcType=VARCHAR}
</foreach>
</foreach>
</if>
</sql>
......
......@@ -6,6 +6,7 @@ import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springframework.format.annotation.DateTimeFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
......@@ -30,5 +31,22 @@ public class BaseModel extends PageModel{
protected String xxlyms;
@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 @@
and glxx_xxzjbh = #{tbStAppXcxx.glxxXxzjbh , jdbcType=VARCHAR}
</if>
<if test="tbStAppXcxx.dwList != null and tbStAppXcxx.dwList.size() > 0">
and XXDJDW_GAJGJGDM in
<foreach collection="tbStAppXcxx.dwList" item="dw" open="(" close=")" separator=",">
#{dw,jdbcType=VARCHAR}
and
<foreach collection="tbStAppXcxx.dwList" item="dws" open="(" close=")" separator=" or ">
XXDJDW_GAJGJGDM in
<foreach collection="dws" item="dw" separator="," open="(" close=")">
#{dw,jdbcType=VARCHAR}
</foreach>
</foreach>
</if>
order by djsj desc
......@@ -152,9 +155,12 @@
and glxx_xxzjbh = #{tbStAppXcxx.glxxXxzjbh , jdbcType=VARCHAR}
</if>
<if test="tbStAppXcxx.dwList != null and tbStAppXcxx.dwList.size() > 0">
and XXDJDW_GAJGJGDM in
<foreach collection="tbStAppXcxx.dwList" item="dw" open="(" close=")" separator=",">
#{dw,jdbcType=VARCHAR}
and
<foreach collection="tbStAppXcxx.dwList" item="dws" open="(" close=")" separator=" or ">
XXDJDW_GAJGJGDM in
<foreach collection="dws" item="dw" separator="," open="(" close=")">
#{dw,jdbcType=VARCHAR}
</foreach>
</foreach>
</if>
</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