Commit e9123a3a authored by 张俊's avatar 张俊

房屋查询bug处理

parent b5abc4cf
...@@ -37,7 +37,7 @@ public class FwxxController { ...@@ -37,7 +37,7 @@ public class FwxxController {
@GetMapping("queryFwjh") @GetMapping("queryFwjh")
@ApiOperation(value = "列表", notes = "房屋列表", response = FwxxEntity.class) @ApiOperation(value = "列表", notes = "房屋列表", response = FwxxEntity.class)
public R queryFwjh(FwxxEntity fwxxEntity) { public R queryFwjh(FwxxEntity fwxxEntity) {
return R.ok().put("data", fwxxService.queryFwjh(fwxxEntity)); return R.ok().put("data", fwxxService.queryFwjh1(fwxxEntity));
} }
// 根据单元查询出房屋列表 // 根据单元查询出房屋列表
......
package io.renren.modules.app.dao; package io.renren.modules.app.dao;
import com.baomidou.mybatisplus.mapper.BaseMapper;
import io.renren.modules.app.entity.FwxxEntity; import io.renren.modules.app.entity.FwxxEntity;
import io.renren.modules.app.entity.XlkEntity;
import io.renren.modules.app.entity.YwpzEntity; import io.renren.modules.app.entity.YwpzEntity;
import io.renren.modules.app.entity.YwpzmxEntity; import io.renren.modules.app.entity.YwpzmxEntity;
import io.renren.modules.app.entity.ZhxxEntity; import io.renren.modules.app.entity.ZhxxEntity;
import com.baomidou.mybatisplus.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
import java.util.Collection;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
...@@ -25,7 +24,7 @@ public interface FwxxDao extends BaseMapper<FwxxEntity> { ...@@ -25,7 +24,7 @@ public interface FwxxDao extends BaseMapper<FwxxEntity> {
/** /**
* 分页模糊查询 * 分页模糊查询
* *
* @param fwxxEntity * @param fwxxEntity
* @return * @return
*/ */
...@@ -64,6 +63,8 @@ public interface FwxxDao extends BaseMapper<FwxxEntity> { ...@@ -64,6 +63,8 @@ public interface FwxxDao extends BaseMapper<FwxxEntity> {
// 查询单元信息 // 查询单元信息
List<FwxxEntity> queryFwjhDy(FwxxEntity fwxxEntity); List<FwxxEntity> queryFwjhDy(FwxxEntity fwxxEntity);
List<FwxxEntity> queryByMhList(@Param("mhList") Collection<String> mhList);
// 查询房屋信息 // 查询房屋信息
List<FwxxEntity> queryFwjhFw(Map<String, Object> pd); List<FwxxEntity> queryFwjhFw(Map<String, Object> pd);
...@@ -83,6 +84,8 @@ public interface FwxxDao extends BaseMapper<FwxxEntity> { ...@@ -83,6 +84,8 @@ public interface FwxxDao extends BaseMapper<FwxxEntity> {
YwpzEntity selectshzt(String id); YwpzEntity selectshzt(String id);
List<YwpzEntity> selectshztByFwbmList(@Param("fwbmList") List<String> fwbmList);
void PLINSERTFwxx(FwxxEntity fwxxEntity); void PLINSERTFwxx(FwxxEntity fwxxEntity);
void updatezhxxhs(ZhxxEntity zhxxEntity); void updatezhxxhs(ZhxxEntity zhxxEntity);
...@@ -92,6 +95,6 @@ public interface FwxxDao extends BaseMapper<FwxxEntity> { ...@@ -92,6 +95,6 @@ public interface FwxxDao extends BaseMapper<FwxxEntity> {
FwxxEntity selectfwxx(String id); FwxxEntity selectfwxx(String id);
List<YwpzEntity> selectfwdjxx(String id); List<YwpzEntity> selectfwdjxx(String id);
YwpzmxEntity selectfwsfjq(String id); YwpzmxEntity selectfwsfjq(String id);
} }
...@@ -22,6 +22,7 @@ public interface FwxxService extends IService<FwxxEntity> { ...@@ -22,6 +22,7 @@ public interface FwxxService extends IService<FwxxEntity> {
// 查询房屋图 // 查询房屋图
List<Map<String, Object>> queryFwjh(FwxxEntity fwxxEntity); List<Map<String, Object>> queryFwjh(FwxxEntity fwxxEntity);
List<Map<String, Object>> queryFwjh1(FwxxEntity fwxxEntity);
// 根据单元查询出房屋列表 // 根据单元查询出房屋列表
PageInfo<FwxxEntity> queryByPage(FwxxEntity fwxxEntity); PageInfo<FwxxEntity> queryByPage(FwxxEntity fwxxEntity);
...@@ -49,7 +50,7 @@ public interface FwxxService extends IService<FwxxEntity> { ...@@ -49,7 +50,7 @@ public interface FwxxService extends IService<FwxxEntity> {
/** /**
* 查询是否有项目 * 查询是否有项目
* *
* @param dwbm * @param dwbm
* @return * @return
*/ */
...@@ -57,12 +58,12 @@ public interface FwxxService extends IService<FwxxEntity> { ...@@ -57,12 +58,12 @@ public interface FwxxService extends IService<FwxxEntity> {
// 删除单位 // 删除单位
int deleteFromSfdw(@Param("dwbm") String dwbm); int deleteFromSfdw(@Param("dwbm") String dwbm);
void PLINSERTFwxx(FwxxEntity fwxxEntity); void PLINSERTFwxx(FwxxEntity fwxxEntity);
void updatezhxxhs(ZhxxEntity zhxxEntity); void updatezhxxhs(ZhxxEntity zhxxEntity);
ZhxxEntity selectzhxxhs(String id); ZhxxEntity selectzhxxhs(String id);
List<YwpzEntity> selectdjxxbyfw(String id); List<YwpzEntity> selectdjxxbyfw(String id);
} }
package io.renren.modules.app.service.impl; package io.renren.modules.app.service.impl;
import com.baomidou.mybatisplus.service.impl.ServiceImpl; import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo; import com.github.pagehelper.PageInfo;
import io.renren.modules.app.dao.FwxxDao; import io.renren.modules.app.dao.FwxxDao;
import io.renren.modules.app.entity.FwxxEntity; import io.renren.modules.app.entity.FwxxEntity;
import io.renren.modules.app.entity.XlkEntity;
import io.renren.modules.app.entity.YwpzEntity; import io.renren.modules.app.entity.YwpzEntity;
import io.renren.modules.app.entity.YwpzmxEntity; import io.renren.modules.app.entity.YwpzmxEntity;
import io.renren.modules.app.entity.ZhxxEntity; import io.renren.modules.app.entity.ZhxxEntity;
import io.renren.modules.app.service.FwxxService; import io.renren.modules.app.service.FwxxService;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang.ObjectUtils; import org.apache.commons.lang.ObjectUtils;
import org.apache.commons.lang.StringUtils; import org.apache.commons.lang.StringUtils;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import java.util.ArrayList;
import java.util.Arrays; import java.util.*;
import java.util.HashMap; import java.util.stream.Collectors;
import java.util.List;
import java.util.Map;
@Service("fwxxService") @Service("fwxxService")
public class FwxxServiceImpl extends ServiceImpl<FwxxDao, FwxxEntity> implements FwxxService { public class FwxxServiceImpl extends ServiceImpl<FwxxDao, FwxxEntity> implements FwxxService {
...@@ -154,17 +149,17 @@ public class FwxxServiceImpl extends ServiceImpl<FwxxDao, FwxxEntity> implements ...@@ -154,17 +149,17 @@ public class FwxxServiceImpl extends ServiceImpl<FwxxDao, FwxxEntity> implements
for(FwxxEntity f: fwlist){ for(FwxxEntity f: fwlist){
if("1".equals(f.getSfyj())){ if("1".equals(f.getSfyj())){
List<YwpzEntity> ys=baseMapper.selectfwdjbh(f.getFwbm()); List<YwpzEntity> ys=baseMapper.selectfwdjbh(f.getFwbm());
YwpzEntity y1=baseMapper.selectshzt(ys.get(0).getDjbh()); YwpzEntity y1=baseMapper.selectshzt(ys.get(0).getDjbh());
if(isObjectNotEmpty(y1)==false||isObjectNotEmpty(ys.get(0))==false){ if(isObjectNotEmpty(y1)==false||isObjectNotEmpty(ys.get(0))==false){
}else{
if("1".equals(y1.getShzt())){
f.setSfyfh("1");
}else{ }else{
if("1".equals(y1.getShzt())){ f.setSfyfh("0");
f.setSfyfh("1");
}else{
f.setSfyfh("0");
}
} }
}
} }
} }
// 单元房屋 // 单元房屋
...@@ -176,7 +171,78 @@ public class FwxxServiceImpl extends ServiceImpl<FwxxDao, FwxxEntity> implements ...@@ -176,7 +171,78 @@ public class FwxxServiceImpl extends ServiceImpl<FwxxDao, FwxxEntity> implements
} }
return returnlist; return returnlist;
} }
public List<Map<String, Object>> queryFwjh1(FwxxEntity fwxxEntity) {
// 返回list集合
List<Map<String, Object>> returnlist = new ArrayList<Map<String, Object>>();
// 根据栋号获取单元,查询本栋楼的所有单元
List<FwxxEntity> dhlist = baseMapper.queryFwjhDy(fwxxEntity);
// 单元编码
Set<String> fwdybmList = dhlist.stream().map(FwxxEntity::getFwdybm).collect(Collectors.toSet());
// 查询单元的所有楼层信息。mh:门号,单元编码
List<FwxxEntity> fwxxEntityList = baseMapper.queryByMhList(fwdybmList);
// 按门号分组
Map<String, List<FwxxEntity>> fwxxMap = fwxxEntityList.stream().collect(Collectors.groupingBy(FwxxEntity::getMh));
// 获取每个单元的楼层,每个单元的楼层可能会不一样
// 按楼层分组
/*Map<Integer, List<FwxxEntity>> lcMap = fwxxEntityList.stream().collect(Collectors.groupingBy(FwxxEntity::getLc));
Set<Integer> lcSet = lcMap.keySet();*/
// 筛选出已缴的数据
List<FwxxEntity> yjFwxxList = fwxxEntityList.stream().filter(f -> "1".equals(f.getSfyj())).collect(Collectors.toList());
Map<String, YwpzEntity> ywpzEntityMap = new HashMap<>();
if (CollectionUtils.isNotEmpty(yjFwxxList))
{
List<YwpzEntity> ywpzEntityList = baseMapper.selectshztByFwbmList(yjFwxxList.stream().map(FwxxEntity::getFwbm).collect(Collectors.toList()));
ywpzEntityMap = ywpzEntityList.stream().collect(Collectors.toMap(YwpzEntity::getFwbm, y -> y, (y1, y2) -> y1));
}
for (FwxxEntity fwxx : dhlist)
{
// 返回Map集合
Map<String, Object> map = new HashMap<>();
// 获取单元名称
map.put("dymc", fwxx.getDymc());
// 接受楼层
List<Object> list = new ArrayList<Object>();
// 获取本单元的房屋
List<FwxxEntity> currentMhList = fwxxMap.get(fwxx.getFwdybm());
if (CollectionUtils.isNotEmpty(currentMhList)){
// 获取每个单元的楼层,每个单元的楼层可能会不一样
Set<Integer> lcSet = currentMhList.stream().map(FwxxEntity::getLc).collect(Collectors.toSet());
// 每个楼层的信息
for (Integer lc : lcSet)
{
Map<String, Object> fwmap = new HashMap<>();
fwmap.put("lc", lc);
// 本楼层的房屋数据
List<FwxxEntity> fwlist = currentMhList.stream().filter(c -> c.getLc().equals(lc)).collect(Collectors.toList());
for (FwxxEntity f : fwlist)
{
YwpzEntity ywpzEntity = ywpzEntityMap.get(f.getFwbm());
if (ywpzEntity != null)
{
if ("1".equals(ywpzEntity.getShzt()))
{
f.setSfyfh("1");
}
else
{
f.setSfyfh("0");
}
}
}
// 单元房屋
fwmap.put("fwxx", fwlist);
list.add(fwmap);
}
}
map.put("lcxx", list);
returnlist.add(map);
}
return returnlist;
}
public static Boolean isObjectNotEmpty(Object obj) { public static Boolean isObjectNotEmpty(Object obj) {
String str = ObjectUtils.toString(obj, ""); String str = ObjectUtils.toString(obj, "");
return StringUtils.isNotBlank(str); return StringUtils.isNotBlank(str);
...@@ -187,7 +253,7 @@ public class FwxxServiceImpl extends ServiceImpl<FwxxDao, FwxxEntity> implements ...@@ -187,7 +253,7 @@ public class FwxxServiceImpl extends ServiceImpl<FwxxDao, FwxxEntity> implements
public FwxxEntity queryDhsj(FwxxEntity fwxxEntity) { public FwxxEntity queryDhsj(FwxxEntity fwxxEntity) {
return baseMapper.queryDhsj(fwxxEntity); return baseMapper.queryDhsj(fwxxEntity);
} }
/** /**
* 查询是否存在项目 * 查询是否存在项目
*/ */
...@@ -208,19 +274,19 @@ public class FwxxServiceImpl extends ServiceImpl<FwxxDao, FwxxEntity> implements ...@@ -208,19 +274,19 @@ public class FwxxServiceImpl extends ServiceImpl<FwxxDao, FwxxEntity> implements
@Override @Override
public void PLINSERTFwxx(FwxxEntity fwxxEntity) { public void PLINSERTFwxx(FwxxEntity fwxxEntity) {
baseMapper.PLINSERTFwxx(fwxxEntity); baseMapper.PLINSERTFwxx(fwxxEntity);
} }
@Override @Override
public void updatezhxxhs(ZhxxEntity zhxxEntity) { public void updatezhxxhs(ZhxxEntity zhxxEntity) {
baseMapper.updatezhxxhs(zhxxEntity); baseMapper.updatezhxxhs(zhxxEntity);
} }
@Override @Override
public ZhxxEntity selectzhxxhs(String id) { public ZhxxEntity selectzhxxhs(String id) {
return baseMapper.selectzhxxhs(id); return baseMapper.selectzhxxhs(id);
} }
...@@ -229,7 +295,7 @@ public class FwxxServiceImpl extends ServiceImpl<FwxxDao, FwxxEntity> implements ...@@ -229,7 +295,7 @@ public class FwxxServiceImpl extends ServiceImpl<FwxxDao, FwxxEntity> implements
FwxxEntity f=baseMapper.selectfwxx(id); FwxxEntity f=baseMapper.selectfwxx(id);
List<YwpzEntity> ys=new ArrayList<YwpzEntity>(); List<YwpzEntity> ys=new ArrayList<YwpzEntity>();
if("1".equals(f.getSfyj())){ if("1".equals(f.getSfyj())){
ys=baseMapper.selectfwdjxx(id); ys=baseMapper.selectfwdjxx(id);
} }
return ys; return ys;
} }
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
<select id="queryByPage" parameterType="io.renren.modules.app.entity.FwxxEntity" <select id="queryByPage" parameterType="io.renren.modules.app.entity.FwxxEntity"
resultType="io.renren.modules.app.entity.FwxxEntity"> resultType="io.renren.modules.app.entity.FwxxEntity">
select * from fwxx where 1=1 select * from fwxx where 1=1
...@@ -157,25 +157,25 @@ ...@@ -157,25 +157,25 @@
<insert id="PLINSERTFwxx" parameterType="io.renren.modules.app.entity.FwxxEntity"> <insert id="PLINSERTFwxx" parameterType="io.renren.modules.app.entity.FwxxEntity">
INSERT INTO INSERT INTO
fwxx(dhbm,cczh,fwbm,mphm,lc,hx,fwxz,ssdj,mj,fwje,gfrq,lfmj,lfdj,lfje,zjk,hxt,xm,sfzh,lxdh,jjze,grje,dwje,dqye,sfsc,mh,grjjl,jsbz,gzdbm,ggsy,zqje,ljlx,ncye,xhje,xhjx,htbh,fpbh,zjlb,dz,bz,jcbzbm,fwyt,spzt,yzkm) fwxx(dhbm,cczh,fwbm,mphm,lc,hx,fwxz,ssdj,mj,fwje,gfrq,lfmj,lfdj,lfje,zjk,hxt,xm,sfzh,lxdh,jjze,grje,dwje,dqye,sfsc,mh,grjjl,jsbz,gzdbm,ggsy,zqje,ljlx,ncye,xhje,xhjx,htbh,fpbh,zjlb,dz,bz,jcbzbm,fwyt,spzt,yzkm)
VALUES VALUES
(#{dhbm},#{cczh},#{fwbm},#{mphm},#{lcs},#{hx},#{fwxz},#{ssdj},#{mj},#{fwje},#{gfrq},#{lfmj},#{lfdj},#{lfje},#{zjk},#{hxt},#{xm},#{sfzh},#{lxdh},#{jjze},#{grje},#{dwje},#{dqye},#{sfsc},#{fwdybm},#{grjjl},#{jsbz},#{gzdbm},#{ggsy},#{zqje},#{ljlx},#{ncye},#{xhje},#{xhjx},#{htbh},#{fpbh},#{zjlb},#{dz},#{bz},#{jcbzbm},#{fwyt},#{spzt},#{yzkm}) (#{dhbm},#{cczh},#{fwbm},#{mphm},#{lcs},#{hx},#{fwxz},#{ssdj},#{mj},#{fwje},#{gfrq},#{lfmj},#{lfdj},#{lfje},#{zjk},#{hxt},#{xm},#{sfzh},#{lxdh},#{jjze},#{grje},#{dwje},#{dqye},#{sfsc},#{fwdybm},#{grjjl},#{jsbz},#{gzdbm},#{ggsy},#{zqje},#{ljlx},#{ncye},#{xhje},#{xhjx},#{htbh},#{fpbh},#{zjlb},#{dz},#{bz},#{jcbzbm},#{fwyt},#{spzt},#{yzkm})
</insert> </insert>
<!-- 修改 --> <!-- 修改 -->
<update id="updateFwxx" parameterType="io.renren.modules.app.entity.FwxxEntity"> <update id="updateFwxx" parameterType="io.renren.modules.app.entity.FwxxEntity">
update fwxx set update fwxx set
dhbm=#{dhbm},cczh=#{cczh},fwbm=#{fwbm},mphm=#{mphm},lc=#{lc},hx=#{hx},fwxz=#{fwxz},ssdj=#{ssdj}, dhbm=#{dhbm},cczh=#{cczh},fwbm=#{fwbm},mphm=#{mphm},lc=#{lc},hx=#{hx},fwxz=#{fwxz},ssdj=#{ssdj},
mj=#{mj},fwje=#{fwje},gfrq=#{gfrq},xm=#{xm}, mj=#{mj},fwje=#{fwje},gfrq=#{gfrq},xm=#{xm},
sfzh=#{sfzh},lxdh=#{lxdh},grjjl=#{grjjl}, sfzh=#{sfzh},lxdh=#{lxdh},grjjl=#{grjjl},
jsbz=#{jsbz},gzdbm='0001', jsbz=#{jsbz},gzdbm='0001',
htbh=#{htbh},fpbh=#{fpbh},zjlb=#{zjlb},dz=#{dz},bz=#{bz},fwyt=#{fwyt},dwjjl=#{dwjjl} htbh=#{htbh},fpbh=#{fpbh},zjlb=#{zjlb},dz=#{dz},bz=#{bz},fwyt=#{fwyt},dwjjl=#{dwjjl}
where fwbm=#{fwbm} where fwbm=#{fwbm}
</update> </update>
<!-- 单个查询 --> <!-- 单个查询 -->
<select id="selectByXxId" parameterType="io.renren.modules.app.entity.FwxxEntity" <select id="selectByXxId" parameterType="io.renren.modules.app.entity.FwxxEntity"
resultType="io.renren.modules.app.entity.FwxxEntity"> resultType="io.renren.modules.app.entity.FwxxEntity">
SELECT SELECT
distinct distinct
f.dhbm,f.xm,z.dhmc,x.xmmc,s.dwmc,s.dwbm,f.cczh,f.fwbm,f.mphm,f.lc,f.hx,f.fwxz,d.value,f.ssdj,f.mj,f.fwje,f.gfrq,f.sfyj,f.lfmj,f.lfdj,f.lfje,f.zjk,f.hxt,f.xm,f.sfzh,f.lxdh,f.jjze,f.grje,f.dwje,f.dqye,f.sfsc,f.mh,f.grjjl,f.jsbz,f.gzdbm,f.ggsy,f.zqje,f.ljlx,f.ncye,f.xhje,f.xhjx,f.htbh,f.fpbh,f.zjlb,f.dz,f.bz,f.jcbzbm,f.fwyt,f.spzt,f.yzkm f.dhbm,f.xm,z.dhmc,x.xmmc,s.dwmc,s.dwbm,f.cczh,f.fwbm,f.mphm,f.lc,f.hx,f.fwxz,d.value,f.ssdj,f.mj,f.fwje,f.gfrq,f.sfyj,f.lfmj,f.lfdj,f.lfje,f.zjk,f.hxt,f.xm,f.sfzh,f.lxdh,f.jjze,f.grje,f.dwje,f.dqye,f.sfsc,f.mh,f.grjjl,f.jsbz,f.gzdbm,f.ggsy,f.zqje,f.ljlx,f.ncye,f.xhje,f.xhjx,f.htbh,f.fpbh,f.zjlb,f.dz,f.bz,f.jcbzbm,f.fwyt,f.spzt,f.yzkm
...@@ -190,12 +190,12 @@ ...@@ -190,12 +190,12 @@
<!-- 获取最新的房屋编码 --> <!-- 获取最新的房屋编码 -->
<select id="querydhbm" resultType="string"> <select id="querydhbm" resultType="string">
SELECT fwbm FROM fwxx ORDER BY SELECT fwbm FROM fwxx ORDER BY
fwbm DESC LIMIT 1 fwbm DESC LIMIT 1
</select> </select>
<!-- 查询户数和楼层数 --> <!-- 查询户数和楼层数 -->
<select id="queryDyxx" parameterType="io.renren.modules.app.entity.FwxxEntity" <select id="queryDyxx" parameterType="io.renren.modules.app.entity.FwxxEntity"
resultType="io.renren.modules.app.entity.FwxxEntity"> resultType="io.renren.modules.app.entity.FwxxEntity">
SELECT a.DHBM,b.DHMC,a.FWDYBM,a.DYMC,a.HS,a.LCS SELECT a.DHBM,b.DHMC,a.FWDYBM,a.DYMC,a.HS,a.LCS
FROM DYXX a left join FROM DYXX a left join
ZHXX b on a.dhbm = b.dhbm WHERE 1=1 ZHXX b on a.dhbm = b.dhbm WHERE 1=1
...@@ -206,17 +206,17 @@ ...@@ -206,17 +206,17 @@
<!-- 新增小区集合 --> <!-- 新增小区集合 -->
<select id="selectxq" parameterType="java.util.Map" <select id="selectxq" parameterType="java.util.Map"
resultType="io.renren.modules.app.entity.FwxxEntity"> resultType="io.renren.modules.app.entity.FwxxEntity">
select XQBM,XQMC from XQXX where XQBM in (select XQBM from select XQBM,XQMC from XQXX where XQBM in (select XQBM from
XM where XMBM in XM where XMBM in
(select XMBM from ZHXX where DHBM in (select DHBM from (select XMBM from ZHXX where DHBM in (select DHBM from
DYXX where DYXX where
FWDYBM not in (select MH from FWXX)))) FWDYBM not in (select MH from FWXX))))
</select> </select>
<!-- 新增项目集合 --> <!-- 新增项目集合 -->
<select id="selectxm" parameterType="java.util.Map" <select id="selectxm" parameterType="java.util.Map"
resultType="io.renren.modules.app.entity.FwxxEntity"> resultType="io.renren.modules.app.entity.FwxxEntity">
select XMBM,XMMC from XM where 1=1 select XMBM,XMMC from XM where 1=1
<if test=" xqbm != null and xqbm != '' "> <if test=" xqbm != null and xqbm != '' ">
and XQBM = #{xqbm} and XQBM = #{xqbm}
...@@ -227,7 +227,7 @@ ...@@ -227,7 +227,7 @@
<!-- 新增栋号集合 --> <!-- 新增栋号集合 -->
<select id="selectlz" parameterType="java.util.Map" <select id="selectlz" parameterType="java.util.Map"
resultType="io.renren.modules.app.entity.FwxxEntity"> resultType="io.renren.modules.app.entity.FwxxEntity">
select DHBM,DHMC from ZHXX where 1=1 select DHBM,DHMC from ZHXX where 1=1
<if test=" xmbm != null and xmbm != '' "> <if test=" xmbm != null and xmbm != '' ">
and XMBM = #{xmbm} and XMBM = #{xmbm}
...@@ -238,7 +238,7 @@ ...@@ -238,7 +238,7 @@
<!-- 新增单元集合 --> <!-- 新增单元集合 -->
<select id="selectdy" parameterType="java.util.Map" <select id="selectdy" parameterType="java.util.Map"
resultType="io.renren.modules.app.entity.FwxxEntity"> resultType="io.renren.modules.app.entity.FwxxEntity">
select fwdybm,DYMC,HS from DYXX where 1=1 select fwdybm,DYMC,HS from DYXX where 1=1
<if test=" dhbm != null and dhbm != '' "> <if test=" dhbm != null and dhbm != '' ">
and DHBM = #{dhbm} and DHBM = #{dhbm}
...@@ -248,59 +248,100 @@ ...@@ -248,59 +248,100 @@
<!--户型 --> <!--户型 -->
<select id="hx" parameterType="java.util.Map" <select id="hx" parameterType="java.util.Map"
resultType="io.renren.modules.app.entity.FwxxEntity"> resultType="io.renren.modules.app.entity.FwxxEntity">
SELECT id AS hx,VALUE AS hxmc FROM sys_dict WHERE TYPE SELECT id AS hx,VALUE AS hxmc FROM sys_dict WHERE TYPE
='04' ='04'
</select> </select>
<!-- 房屋性质 --> <!-- 房屋性质 -->
<select id="fmxz" parameterType="java.util.Map" <select id="fmxz" parameterType="java.util.Map"
resultType="io.renren.modules.app.entity.FwxxEntity"> resultType="io.renren.modules.app.entity.FwxxEntity">
SELECT id AS fwxz,VALUE AS fwxzmc FROM sys_dict WHERE TYPE SELECT id AS fwxz,VALUE AS fwxzmc FROM sys_dict WHERE TYPE
='01' ='01'
</select> </select>
<!-- 查询单元信息 --> <!-- 查询单元信息 -->
<select id="queryFwjhDy" parameterType="io.renren.modules.app.entity.FwxxEntity" <select id="queryFwjhDy" parameterType="io.renren.modules.app.entity.FwxxEntity"
resultType="io.renren.modules.app.entity.FwxxEntity"> resultType="io.renren.modules.app.entity.FwxxEntity">
SELECT dymc,fwdybm FROM DYXX WHERE dhbm = #{dhbm} SELECT dymc,fwdybm FROM DYXX WHERE dhbm = #{dhbm}
</select> </select>
<select id="queryByMhList" parameterType="string"
resultType="io.renren.modules.app.entity.FwxxEntity">
SELECT * FROM fwxx WHERE 1 = 1
<choose>
<when test="mhList != null and mhList.size() > 0">
and mh in
<foreach collection="mhList" item="mh" open="(" separator="," close=")">
#{mh}
</foreach>
</when>
<otherwise>
and 1 = 2
</otherwise>
</choose>
</select>
<!-- 查询房屋信息 --> <!-- 查询房屋信息 -->
<select id="queryFwjhFw" parameterType="java.util.Map" <select id="queryFwjhFw" parameterType="java.util.Map"
resultType="io.renren.modules.app.entity.FwxxEntity"> resultType="io.renren.modules.app.entity.FwxxEntity">
SELECT mphm,fwbm,lc,sfyj,sfsc FROM fwxx WHERE mh = SELECT mphm,fwbm,lc,sfyj,sfsc FROM fwxx WHERE mh =
#{fwdybm} AND lc = #{fwdybm} AND lc =
#{lc} #{lc}
</select> </select>
<!-- 根据单元编码查询房屋楼层数集合 --> <!-- 根据单元编码查询房屋楼层数集合 -->
<select id="queryDylcs" parameterType="java.util.Map" <select id="queryDylcs" parameterType="java.util.Map"
resultType="java.lang.Integer"> resultType="java.lang.Integer">
SELECT lc FROM fwxx WHERE mh = #{fwdybm} GROUP BY lc order SELECT lc FROM fwxx WHERE mh = #{fwdybm} GROUP BY lc order
by lc desc by lc desc
</select> </select>
<!-- 根据栋号获取信息 --> <!-- 根据栋号获取信息 -->
<select id="queryDhsj" parameterType="io.renren.modules.app.entity.FwxxEntity" <select id="queryDhsj" parameterType="io.renren.modules.app.entity.FwxxEntity"
resultType="io.renren.modules.app.entity.FwxxEntity"> resultType="io.renren.modules.app.entity.FwxxEntity">
select YZKM from ZHXX where dhbm=#{dhbm} select YZKM from ZHXX where dhbm=#{dhbm}
</select> </select>
<select id="selectfwdjbh" parameterType="java.lang.String" <select id="selectfwdjbh" parameterType="java.lang.String"
resultType="io.renren.modules.app.entity.YwpzEntity"> resultType="io.renren.modules.app.entity.YwpzEntity">
select djbh from ywpzmx where fwbm=#{id} and case select djbh from ywpzmx where fwbm=#{id} and case
LENGTH(djbh) when 20 then SUBSTR(djbh FROM 1 FOR 2)='03' when 17 then LENGTH(djbh) when 20 then SUBSTR(djbh FROM 1 FOR 2)='03' when 17 then
SUBSTR(djbh FROM 5 FOR 2)='03' else '' end SUBSTR(djbh FROM 5 FOR 2)='03' else '' end
</select> </select>
<select id="selectshzt" parameterType="java.lang.String" <select id="selectshzt" parameterType="java.lang.String"
resultType="io.renren.modules.app.entity.YwpzEntity"> resultType="io.renren.modules.app.entity.YwpzEntity">
select * from ywpz where djbh=#{id} select * from ywpz where djbh=#{id}
</select> </select>
<select id="selectshztByFwbmList" parameterType="java.lang.String"
resultType="io.renren.modules.app.entity.YwpzEntity">
SELECT
ywpz.*, ywpzmx.fwbm
FROM
ywpzmx ywpzmx
JOIN ywpz ywpz ON ywpz.djbh = ywpzmx.djbh
WHERE 1 = 1
<if test="fwbmList != null and fwbmList.size() > 0">
and ywpzmx.fwbm in
<foreach collection="fwbmList" item="fwbm" open="(" separator="," close=")">
#{fwbm}
</foreach>
</if>
AND CASE LENGTH(ywpzmx.djbh)
WHEN 20 THEN
SUBSTR(ywpzmx.djbh FROM 1 FOR 2) = '03'
WHEN 17 THEN
SUBSTR(ywpzmx.djbh FROM 5 FOR 2) = '03'
ELSE
''
END
GROUP BY ywpz.djbh
</select>
<select id="selectmhxq" parameterType="java.lang.String" <select id="selectmhxq" parameterType="java.lang.String"
resultType="io.renren.modules.app.entity.FwxxEntity"> resultType="io.renren.modules.app.entity.FwxxEntity">
select xqbm,xqmc from xqxx where 1=1 select xqbm,xqmc from xqxx where 1=1
<if test=" _pt!=null and _pt!=''"> <if test=" _pt!=null and _pt!=''">
and xqmc like '%${_pt}%' or xqbm like '%${_pt}%' and xqmc like '%${_pt}%' or xqbm like '%${_pt}%'
...@@ -313,24 +354,24 @@ ...@@ -313,24 +354,24 @@
</update> </update>
<select id="selectzhxxhs" parameterType="java.lang.String" <select id="selectzhxxhs" parameterType="java.lang.String"
resultType="io.renren.modules.app.entity.ZhxxEntity"> resultType="io.renren.modules.app.entity.ZhxxEntity">
select hs from zhxx where dhbm=#{id} select hs from zhxx where dhbm=#{id}
</select> </select>
<select id="selectfwxx" parameterType="java.lang.String" <select id="selectfwxx" parameterType="java.lang.String"
resultType="io.renren.modules.app.entity.FwxxEntity"> resultType="io.renren.modules.app.entity.FwxxEntity">
select sfyj from fwxx where fwbm=#{id} select sfyj from fwxx where fwbm=#{id}
</select> </select>
<select id="selectfwdjxx" parameterType="java.lang.String" <select id="selectfwdjxx" parameterType="java.lang.String"
resultType="io.renren.modules.app.entity.YwpzEntity"> resultType="io.renren.modules.app.entity.YwpzEntity">
select y.djbh,y.djrq,h.yhmc,j.billname,j.billcode,y.je,y.zph,y.bz from select y.djbh,y.djrq,h.yhmc,j.billname,j.billcode,y.je,y.zph,y.bz from
ywpz y,h_jsfs j,yhxx h where y.bank_code=h.yhbm and j.billcode=y.jsfs ywpz y,h_jsfs j,yhxx h where y.bank_code=h.yhbm and j.billcode=y.jsfs
and y.djbh in(select djbh from ywpzmx where (SUBSTR(djbh FROM 1 FOR and y.djbh in(select djbh from ywpzmx where (SUBSTR(djbh FROM 1 FOR
2)='03' or SUBSTR(djbh FROM 5 FOR 2)='03') and fwbm=#{id}) order by y.djrq desc 2)='03' or SUBSTR(djbh FROM 5 FOR 2)='03') and fwbm=#{id}) order by y.djrq desc
</select> </select>
<select id="selectfwsfjq" parameterType="java.lang.String" resultType="io.renren.modules.app.entity.YwpzmxEntity"> <select id="selectfwsfjq" parameterType="java.lang.String" resultType="io.renren.modules.app.entity.YwpzmxEntity">
select sum(je) je from ywpzmx where (SUBSTR(djbh FROM 5 FOR 2)='03' || SUBSTR(djbh FROM 1 FOR 2)='03') and fwbm=#{id} select sum(je) je from ywpzmx where (SUBSTR(djbh FROM 5 FOR 2)='03' || SUBSTR(djbh FROM 1 FOR 2)='03') and fwbm=#{id}
</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