ソースを参照

户主查房间信息接口

wang_xy 1 年間 前
コミット
f84bff78d7

+ 2 - 3
ruoyi-admin/src/main/java/com/ruoyi/web/controller/zdsz/ZHouseController.java

@@ -63,11 +63,10 @@ public class ZHouseController extends BaseController {
     }
     /**
      * 户主查房间信息(小程序端)
-     *
      */
     @GetMapping("/getHousesByIdCard")
-    public R getHousesByIdCard(String idcard) {
-        return R.ok(iZHouseService.getHouses(idcard));
+    public R getHousesByIdCard(String idCard) {
+        return R.ok(iZHouseService.getHousesByIdCard(idCard));
     }
     /**
      * 导出房间管理列表

+ 2 - 2
ruoyi-zdsz/src/main/java/com/ruoyi/zdsz/domain/ZHouse.java

@@ -55,8 +55,8 @@ public class ZHouse extends BaseEntity {
     /**
      *
      */
-    private String photo;
-    private String newPhoto;
+    private String phone;
+    private String newPhone;
     /**
      * 备注
      */

+ 2 - 2
ruoyi-zdsz/src/main/java/com/ruoyi/zdsz/domain/bo/ZHouseBo.java

@@ -62,8 +62,8 @@ public class ZHouseBo extends BaseEntity {
     private String remark;
     private String houseUserName;//户主姓名
     private String idCard;//身份证
-    private String photo;//手机号
-    private String newPhoto;//现主人电话
+    private String phone;//手机号
+    private String newPhone;//现主人电话
 
 
 }

+ 1 - 1
ruoyi-zdsz/src/main/java/com/ruoyi/zdsz/domain/vo/GImportVo.java

@@ -35,7 +35,7 @@ public class GImportVo implements Serializable {
     @ExcelProperty(value = "身份证号")
     private String idCard;
     @ExcelProperty(value = "手机号")
-    private String photo;
+    private String phone;
     @ExcelProperty(value = "管理所")
     private String administrative;
     @ExcelProperty(value = "来源(请填写“现场规模”或“一体化平台”)")

+ 8 - 2
ruoyi-zdsz/src/main/java/com/ruoyi/zdsz/domain/vo/ZHouseVo.java

@@ -68,7 +68,13 @@ public class ZHouseVo implements Serializable {
     @ExcelProperty(value = "身份证")
     private String idCard;//身份证
     @ExcelProperty(value = "手机号")
-    private String photo;//手机号
+    private String phone;//手机号
     @ExcelProperty(value = "现主人电话")
-    private String newPhoto;//现主人电话
+    private String newPhone;//现主人电话
+
+
+
+
+    private String district;//行政区
+    private String districtName;//行政区名称
 }

+ 1 - 1
ruoyi-zdsz/src/main/java/com/ruoyi/zdsz/service/IZHouseService.java

@@ -50,5 +50,5 @@ public interface IZHouseService {
     int getHouseByUnitId(Collection<String> list);
 
     List<ZHouseVo> getHouses(String unitId);
-    ZHouseVo getHousesByIdCard(String idcard);
+    ZHouseVo getHousesByIdCard(String idCard);
 }

+ 5 - 5
ruoyi-zdsz/src/main/java/com/ruoyi/zdsz/service/impl/ZAreaServiceImpl.java

@@ -139,7 +139,7 @@ public class ZAreaServiceImpl implements IZAreaService {
                                     house.setSource(sourceValue);
                                     house.setHouseUserName(vo.getHouseUserName());
                                     house.setIdCard(vo.getIdCard());
-                                    house.setPhoto(vo.getPhoto());
+                                    house.setPhone(vo.getPhone());
                                     zHouseMapper.insert(house);
                                     successNum++;
                                 } else {
@@ -183,7 +183,7 @@ public class ZAreaServiceImpl implements IZAreaService {
                                         house.setSource(sourceValue);
                                         house.setHouseUserName(vo.getHouseUserName());
                                         house.setIdCard(vo.getIdCard());
-                                        house.setPhoto(vo.getPhoto());
+                                        house.setPhone(vo.getPhone());
                                         zHouseMapper.insert(house);
                                         successNum++;
                                     } else {
@@ -216,7 +216,7 @@ public class ZAreaServiceImpl implements IZAreaService {
                                             house.setSource(sourceValue);
                                             house.setHouseUserName(vo.getHouseUserName());
                                             house.setIdCard(vo.getIdCard());
-                                            house.setPhoto(vo.getPhoto());
+                                            house.setPhone(vo.getPhone());
                                             zHouseMapper.insert(house);
                                             successNum++;
                                         } else {
@@ -237,7 +237,7 @@ public class ZAreaServiceImpl implements IZAreaService {
                                                 house.setSource(sourceValue);
                                                 house.setHouseUserName(vo.getHouseUserName());
                                                 house.setIdCard(vo.getIdCard());
-                                                house.setPhoto(vo.getPhoto());
+                                                house.setPhone(vo.getPhone());
                                                 zHouseMapper.insert(house);
                                                 successNum++;
                                             }
@@ -312,7 +312,7 @@ public class ZAreaServiceImpl implements IZAreaService {
     private LambdaQueryWrapper<ZArea> buildQueryWrapper(ZAreaBo bo) {
         Map<String, Object> params = bo.getParams();
         LambdaQueryWrapper<ZArea> lqw = Wrappers.lambdaQuery();
-        lqw.orderByDesc(ZArea::getCreateTime);
+        lqw.orderByAsc(ZArea::getName);
         lqw.like(StringUtils.isNotBlank(bo.getName()), ZArea::getName, bo.getName());
         lqw.eq(StringUtils.isNotBlank(bo.getScale()), ZArea::getScale, bo.getScale());
         lqw.eq(bo.getReleaseIs() != null, ZArea::getReleaseIs, bo.getReleaseIs());

+ 2 - 2
ruoyi-zdsz/src/main/java/com/ruoyi/zdsz/service/impl/ZHouseServiceImpl.java

@@ -137,7 +137,7 @@ public class ZHouseServiceImpl implements IZHouseService {
     }
 
     @Override
-    public ZHouseVo getHousesByIdCard(String idcard) {
-        return baseMapper.getHousesByIdCard(idcard);
+    public ZHouseVo getHousesByIdCard(String idCard) {
+        return baseMapper.getHousesByIdCard(idCard);
     }
 }

+ 4 - 4
ruoyi-zdsz/src/main/resources/mapper/zdsz/ZAreaMapper.xml

@@ -30,15 +30,15 @@
     </select>
 
     <select id="getArea" resultType="com.ruoyi.zdsz.domain.vo.ZAreaVo">
-        select a.id as id,
-        CONCAT(a.name,'-',b.dict_label) as name
+        select
+        a.id,
+        a.name
         from z_area a
-        LEFT JOIN sys_dict_data b on b.dict_type = 'community_source' and b.dict_value = a.source
         where a.del_flag = '0'
         <if test="district != null and district != ''">
             and a.district = #{district}
         </if>
-        order by a.create_time desc
+        order by a.name asc
     </select>
     <select id="selectGExportsList" resultType="com.ruoyi.zdsz.domain.vo.GImportVo">
         SELECT za.name AS areaName,

+ 3 - 4
ruoyi-zdsz/src/main/resources/mapper/zdsz/ZBuildingMapper.xml

@@ -26,14 +26,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     </select>
     <select id="getBuildingList" resultType="com.ruoyi.zdsz.domain.vo.ZBuildingVo">
         select a.id as id,
-        CONCAT(a.name,'-',b.dict_label) as name
+        a.name as name
         from z_building a
-        LEFT JOIN sys_dict_data b on b.dict_type = 'community_source' and b.dict_value = a.source
         where a.del_flag = '0'
         <if test="areaId != null and areaId != ''">
             and a.area_id = #{areaId}
         </if>
-        order by a.create_time desc
+        order by a.name desc
     </select>
 
     <select id="getPageList" resultType="com.ruoyi.zdsz.domain.vo.ZBuildingVo">
@@ -52,7 +51,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
                 and a.area_id = #{p.areaId}
             </if>
         </where>
-        order by a.create_time desc
+        order by a.name asc
     </select>
 
 </mapper>

+ 27 - 5
ruoyi-zdsz/src/main/resources/mapper/zdsz/ZHouseMapper.xml

@@ -67,21 +67,20 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
                 and a.new_photo LIKE CONCAT('%',#{p.newPhoto},'%')
             </if>
         </where>
-        order by a.create_time desc
+        order by a.name asc
     </select>
 
 
     <select id="selectListByunitId" resultType="com.ruoyi.zdsz.domain.vo.ZHouseVo">
         select
         a.id as id,
-        CONCAT(a.name,'-',b.dict_label) as name
+        a.name as name
         from z_house as a
-        LEFT JOIN sys_dict_data b on b.dict_type = 'community_source' and b.dict_value = a.source
         where a.del_flag = '0'
         <if test="unitId != null  and unitId != ''">
             and a.unit_id = #{unitId}
         </if>
-        order by a.create_time desc
+        order by a.name desc
     </select>
     <select id="selectHouseId" resultType="com.ruoyi.zdsz.domain.ZHouse">
         select
@@ -115,6 +114,29 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     </select>
 
     <select id="getHousesByIdCard" resultType="com.ruoyi.zdsz.domain.vo.ZHouseVo">
-        select * from z_house where id_card = #{idCard} LIMIT 1
+        SELECT
+            dd.dict_value as district,
+            dd.dict_label as districtName,
+            h.id,
+            h.name,
+            h.area_id as areaId,
+            a.name as areaName,
+            h.building_id as buildingId,
+            b.name as buildingName,
+            h.unit_id as unitId,
+            u.name as unitName,
+            h.phone,
+            h.id_card as idCard,
+            h.house_user_name as houseUserName,
+            h.new_phone as newPhone
+        FROM
+            z_house h
+                left join z_unit u on u.id=h.unit_id
+                left join z_building b on b.id = h.building_id
+                left join z_area a on a.id = h.area_id
+                LEFT JOIN sys_dict_data dd on dd.dict_type = 'district' and a.district = dd.dict_value
+        WHERE
+            id_card = #{idCard}
+            LIMIT 1
     </select>
 </mapper>

+ 3 - 4
ruoyi-zdsz/src/main/resources/mapper/zdsz/ZUnitMapper.xml

@@ -27,14 +27,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 
     <select id="getUnitList" resultType="com.ruoyi.zdsz.domain.vo.ZUnitVo">
         select a.id as id,
-        CONCAT(a.name,'-',b.dict_label) as name
+        a.name as name
         from z_unit a
-        LEFT JOIN sys_dict_data b on b.dict_type = 'community_source' and b.dict_value = a.source
         where a.del_flag = '0'
         <if test="buildingId != null and buildingId != ''">
             and a.building_id = #{buildingId}
         </if>
-        order by a.create_time desc
+        order by a.name desc
     </select>
 
     <select id="getPageList" resultType="com.ruoyi.zdsz.domain.vo.ZUnitVo">
@@ -57,7 +56,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
                 and a.building_id = #{p.buildingId}
             </if>
         </where>
-        order by a.create_time desc
+        order by a.name asc
     </select>
 
 </mapper>