Browse Source

互助组和边民增加互市区关联

qzyReal 1 year ago
parent
commit
f8f1361206

+ 11 - 0
sp-service/level-one-server/src/main/java/com/pj/tb_group/TbGroup.java

@@ -51,6 +51,17 @@ public class TbGroup extends Model<TbGroup> implements Serializable {
 	@JsonSerialize(using = ToStringSerializer.class)
 	private Long id;
 
+
+	/**
+	 * 互市区id
+	 */
+	private Long tradeAreaId;
+	/**
+	 * 互市区名称
+	 */
+	private String tradeAreaName;
+
+
 	/**
 	 *  
 	 */

+ 1 - 0
sp-service/level-one-server/src/main/java/com/pj/tb_group/TbGroupMapper.xml

@@ -26,6 +26,7 @@
 			<if test=' this.has("addressIds") '> and address_ids = #{addressIds} </if>
 			<if test=' this.has("address") '> and address = #{address} </if>
 			<if test=' this.has("detailAddress") '> and detail_address = #{detailAddress} </if>
+			<if test=' this.has("tradeAreaId") '> and trade_area_id = #{tradeAreaId} </if>
 			<if test=' this.has("name") '> and name = #{name} </if>
 			<if test=' this.has("leaderId") '> and leader_id = #{leaderId} </if>
 			<if test=' this.has("leaderName") '> and leader_name = #{leaderName} </if>

+ 9 - 1
sp-service/level-one-server/src/main/java/com/pj/tb_people/TbPeople.java

@@ -52,6 +52,14 @@ public class TbPeople extends Model<TbPeople> implements Serializable {
 	private Long id;
 
 	/**
+	 * 互市区id
+	 */
+	private Long tradeAreaId;
+	/**
+	 * 互市区名称
+	 */
+	private String tradeAreaName;
+	/**
 	 * 姓名 
 	 */
 	private String name;	
@@ -119,7 +127,7 @@ public class TbPeople extends Model<TbPeople> implements Serializable {
 	/**
 	 * 角色(1=普通边民,2=兼组长) 
 	 */
-	private Integer role;
+	private Integer role=1;
 
 	/**
 	 * 经度 

+ 224 - 186
sp-service/level-one-server/src/main/java/com/pj/tb_people/TbPeopleController.java

@@ -19,198 +19,236 @@ import org.springframework.web.multipart.MultipartFile;
 
 /**
  * Controller: tb_people -- 边民
- * @author qzy 
+ *
+ * @author qzy
  */
 @RestController
 @RequestMapping("/TbPeople/")
 public class TbPeopleController {
 
-	/** 底层 Service 对象 */
-	@Autowired
-	TbPeopleService tbPeopleService;
-
-	/** 增 */  
-	@RequestMapping("add")
-	@SaCheckPermission(TbPeople.PERMISSION_CODE_ADD)
-	public AjaxJson add(TbPeople t){
-		tbPeopleService.add(t);
-		t = tbPeopleService.getById(SP.publicMapper.getPrimarykey());
-		return AjaxJson.getSuccessData(t);
-	}
-
-	/** 删 */  
-	@RequestMapping("delete")
-	@SaCheckPermission(TbPeople.PERMISSION_CODE_DEL)
-	public AjaxJson delete(Long id){
-		 tbPeopleService.delete(id);
-		return AjaxJson.getSuccess();
-	}
-	
-	/** 删 - 根据id列表 */  
-	@RequestMapping("deleteByIds")
-	@SaCheckPermission(TbPeople.PERMISSION_CODE_DEL)
-	public AjaxJson deleteByIds(){
-		List<Long> ids = SoMap.getRequestSoMap().getListByComma("ids", long.class); 
-		int line = SP.publicMapper.deleteByIds(TbPeople.TABLE_NAME, ids);
-		return AjaxJson.getByLine(line);
-	}
-	
-	/** 改 */  
-	@RequestMapping("update")
-	@SaCheckPermission(TbPeople.PERMISSION_CODE_EDIT)
-	public AjaxJson update(TbPeople t){
-		tbPeopleService.update(t);
-		return AjaxJson.getSuccess();
-	}
-
-	/** 查 - 根据id */  
-	@RequestMapping("getById")
+    /**
+     * 底层 Service 对象
+     */
+    @Autowired
+    TbPeopleService tbPeopleService;
+
+    /**
+     * 增
+     */
+    @RequestMapping("add")
+    @SaCheckPermission(TbPeople.PERMISSION_CODE_ADD)
+    public AjaxJson add(TbPeople t) {
+        tbPeopleService.add(t);
+        t = tbPeopleService.getById(SP.publicMapper.getPrimarykey());
+        return AjaxJson.getSuccessData(t);
+    }
+
+    /**
+     * 删
+     */
+    @RequestMapping("delete")
+    @SaCheckPermission(TbPeople.PERMISSION_CODE_DEL)
+    public AjaxJson delete(Long id) {
+        tbPeopleService.delete(id);
+        return AjaxJson.getSuccess();
+    }
+
+    /**
+     * 删 - 根据id列表
+     */
+    @RequestMapping("deleteByIds")
+    @SaCheckPermission(TbPeople.PERMISSION_CODE_DEL)
+    public AjaxJson deleteByIds() {
+        List<Long> ids = SoMap.getRequestSoMap().getListByComma("ids", long.class);
+        int line = SP.publicMapper.deleteByIds(TbPeople.TABLE_NAME, ids);
+        return AjaxJson.getByLine(line);
+    }
+
+    /**
+     * 改
+     */
+    @RequestMapping("update")
+    @SaCheckPermission(TbPeople.PERMISSION_CODE_EDIT)
+    public AjaxJson update(TbPeople t) {
+        tbPeopleService.update(t);
+        return AjaxJson.getSuccess();
+    }
+
+    /**
+     * 查 - 根据id
+     */
+    @RequestMapping("getById")
 //	@SaCheckPermission(TbPeople.PERMISSION_CODE)
-	public AjaxJson getById(String id){
-		TbPeople t = tbPeopleService.getById(id);
-		return AjaxJson.getSuccessData(t);
-	}
-
-	/** 查集合 - 根据条件(参数为空时代表忽略指定条件) */  
-	@RequestMapping("getList")
-		@SaCheckPermission(TbPeople.PERMISSION_CODE)
-	public AjaxJson getList() { 
-		SoMap so = SoMap.getRequestSoMap();
-		List<TbPeople> list = tbPeopleService.getList(so.startPage());
-		return AjaxJson.getPageData(so.getDataCount(), list);
-	}
-	
-	
-	
-	/** 改 - 删除状态(0=禁用,1=启用) */  
-	@RequestMapping("updateDeleteStatus")
-	@SaCheckPermission(TbPeople.PERMISSION_CODE_EDIT)
-	public AjaxJson updateDeleteStatus(String id, Integer value){
-		int line = SP.publicMapper.updateColumnById(TbPeople.TABLE_NAME, "delete_status", value, id);
-		return AjaxJson.getByLine(line);
-	}
-
-	/** 审核 */
-	@PostMapping("judge")
-	public AjaxJson judge(@RequestBody TbPeople tbPeople){
-		boolean judge = tbPeopleService.judge(tbPeople);
-		if(judge){
-			return AjaxJson.getSuccess("审核成功!");
-		}
-		return AjaxJson.getError("审核失败!");
-	}
-
-	/** 启/停 */
-	@PostMapping("isLock")
-	public AjaxJson isLock(@Validated @RequestBody StartStopDto startStopDto){
-		boolean lock = tbPeopleService.isLock(startStopDto);
-		return AjaxJson.getSuccess(lock + "");
-	}
-
-	/** 身份识别 */
-	@PostMapping("identification")
-	//TODO: 身份识别
-	public AjaxJson identification(){
-		tbPeopleService.identification();
-		return AjaxJson.getSuccess();
-	}
-
-	/**
-	*边民申请加入互助组
-	*
-	* @author loovi
-	* @date
-	*/
-	@RequestMapping("applyAddGroup")
-	public AjaxJson addAppleGroup(@RequestParam("peopleId") Long peopleId, @RequestParam("groupId") Long groupId){
-		int i = tbPeopleService.applyAddGroup(peopleId, groupId);
-		return AjaxJson.getSuccess("申请成功等待组长批准",i);
-	}
-   /**
-   *获取申请互助组的申请人列表
-   *
-   * @author loovi
-   * @date
-   */
-   @RequestMapping("getApplyList")
-	public AjaxJson getApplyList(@RequestParam("leaderId") Long leaderId){
-	   SoMap so = SoMap.getRequestSoMap();
-	   so.set("leader_id",leaderId);
-		AjaxJson ajaxJson = tbPeopleService.getApplyList(so);
-		return ajaxJson;
-	}
-	/**
-	*组长是否同意申请
-	*
-	* @author loovi
-	* @date
-	*/
-	@RequestMapping("passApply")
-	public AjaxJson passApply(@RequestParam("leaderId") Long leaderId,@RequestParam("peopleId") Long peopleId,@RequestParam("approve")int approve){
-		int line = tbPeopleService.passApply(leaderId, peopleId, approve);
-		return AjaxJson.getByLine(line);
-
-	}
-
-
-
-	/**
-	 * 数据导入接口
-	 * @param file
-	 * @return
-	 */
-	@RequestMapping("peopleImport")
-	@ResponseBody
-	public AjaxJson dataImport(@RequestParam("file") MultipartFile file){
-		try {
-			String importData = tbPeopleService.importData(file);
-			AjaxJson.getSuccess(importData);
-		} catch (IOException e) {
-			throw new RuntimeException(e);
-		}
-		return AjaxJson.getError();
-	}
-
-	/**
-	 * 导出
-	 * @param keyword
-	 * @return
-	 */
-	@RequestMapping("peopleOutport")
-	@ResponseBody
-	public AjaxJson dataOutport(@RequestParam(value = "keyword",required = false) String keyword,@RequestParam(value = "filepath",required = false)String filepath){
-		try {
-			String importData = tbPeopleService.outportExcel(keyword,filepath);
-			AjaxJson.getSuccess(importData);
-		} catch (IOException e) {
-			throw new RuntimeException(e);
-		}
-		return AjaxJson.getError();
-	}
-
-
-	/*------            正常业务👆👆    rpc远程调用👇👇                         -----------*/
-
-	/** 注册身份时对应的表添加数据 */
-	@RequestMapping("rpc/peopleDto")
-	public boolean peopleDto(@RequestBody PeopleDto peopleDto){
-		boolean dto = tbPeopleService.peopleDto(peopleDto);
-		return dto;
-	}
-	/** 根据ID获取边民信息 */
-	@RequestMapping("rpc/getRpcById")
-	public PeopleDto getRpcById(@RequestParam("id")Long peopleId){
-		PeopleDto rpcById = tbPeopleService.getRpcById(peopleId);
-		return rpcById;
-	}
-
-	/** 查集合 - 根据条件(参数为空时代表忽略指定条件) */
-	@RequestMapping("rpc/getPeopleList")
-	public List<PeopleDto> getPeopleList(@RequestParam("groupId")Long groupId) {
-		SoMap so = SoMap.getRequestSoMap();
-		List<PeopleDto> list = tbPeopleService.getPeopleList(so.startPage(),groupId);
-		return list;
-	}
+    public AjaxJson getById(String id) {
+        TbPeople t = tbPeopleService.getById(id);
+        return AjaxJson.getSuccessData(t);
+    }
+
+    /**
+     * 查集合 - 根据条件(参数为空时代表忽略指定条件)
+     */
+    @RequestMapping("getList")
+    @SaCheckPermission(TbPeople.PERMISSION_CODE)
+    public AjaxJson getList() {
+        SoMap so = SoMap.getRequestSoMap();
+        List<TbPeople> list = tbPeopleService.getList(so.startPage());
+        return AjaxJson.getPageData(so.getDataCount(), list);
+    }
+
+
+    /**
+     * 改 - 删除状态(0=禁用,1=启用)
+     */
+    @RequestMapping("updateDeleteStatus")
+    @SaCheckPermission(TbPeople.PERMISSION_CODE_EDIT)
+    public AjaxJson updateDeleteStatus(String id, Integer value) {
+        int line = SP.publicMapper.updateColumnById(TbPeople.TABLE_NAME, "delete_status", value, id);
+        return AjaxJson.getByLine(line);
+    }
+
+    /**
+     * 审核
+     */
+    @PostMapping("judge")
+    public AjaxJson judge(@RequestBody TbPeople tbPeople) {
+        boolean judge = tbPeopleService.judge(tbPeople);
+        if (judge) {
+            return AjaxJson.getSuccess("审核成功!");
+        }
+        return AjaxJson.getError("审核失败!");
+    }
+
+    /**
+     * 启/停
+     */
+    @PostMapping("isLock")
+    public AjaxJson isLock(@Validated @RequestBody StartStopDto startStopDto) {
+        boolean lock = tbPeopleService.isLock(startStopDto);
+        return AjaxJson.getSuccess(lock + "");
+    }
+
+    /**
+     * 身份识别
+     */
+    @PostMapping("identification")
+    //TODO: 身份识别
+    public AjaxJson identification() {
+        tbPeopleService.identification();
+        return AjaxJson.getSuccess();
+    }
+
+    /**
+     * 边民申请加入互助组
+     *
+     * @author loovi
+     * @date
+     */
+    @RequestMapping("applyAddGroup")
+    public AjaxJson addAppleGroup(@RequestParam("peopleId") Long peopleId, @RequestParam("groupId") Long groupId) {
+        int i = tbPeopleService.applyAddGroup(peopleId, groupId);
+        return AjaxJson.getSuccess("申请成功等待组长批准", i);
+    }
+
+    /**
+     * 获取申请互助组的申请人列表
+     *
+     * @author loovi
+     * @date
+     */
+    @RequestMapping("getApplyList")
+    public AjaxJson getApplyList(@RequestParam("leaderId") Long leaderId) {
+        SoMap so = SoMap.getRequestSoMap();
+        so.set("leader_id", leaderId);
+        AjaxJson ajaxJson = tbPeopleService.getApplyList(so);
+        return ajaxJson;
+    }
+
+    /**
+     * 组长是否同意申请
+     *
+     * @author loovi
+     * @date
+     */
+    @RequestMapping("passApply")
+    public AjaxJson passApply(@RequestParam("leaderId") Long leaderId, @RequestParam("peopleId") Long peopleId, @RequestParam("approve") int approve) {
+        int line = tbPeopleService.passApply(leaderId, peopleId, approve);
+        return AjaxJson.getByLine(line);
+
+    }
+
+
+    /**
+     * 数据导入接口
+     *
+     * @param file
+     * @return
+     */
+    @RequestMapping("peopleImport")
+    @ResponseBody
+    public AjaxJson dataImport(@RequestParam("file") MultipartFile file) {
+        try {
+            String importData = tbPeopleService.importData(file);
+            AjaxJson.getSuccess(importData);
+        } catch (IOException e) {
+            throw new RuntimeException(e);
+        }
+        return AjaxJson.getError();
+    }
+
+    /**
+     * 导出
+     *
+     * @param keyword
+     * @return
+     */
+    @RequestMapping("peopleOutport")
+    @ResponseBody
+    public AjaxJson dataOutport(@RequestParam(value = "keyword", required = false) String keyword, @RequestParam(value = "filepath", required = false) String filepath) {
+        try {
+            String importData = tbPeopleService.outportExcel(keyword, filepath);
+            AjaxJson.getSuccess(importData);
+        } catch (IOException e) {
+            throw new RuntimeException(e);
+        }
+        return AjaxJson.getError();
+    }
+
+    @RequestMapping("getPeopleForGroup")
+    @SaCheckPermission(TbPeople.TABLE_NAME)
+    public AjaxJson getPeopleForGroup(@RequestParam Long tradeAreaId) {
+        return AjaxJson.getSuccessData(tbPeopleService.getPeopleForGroup(tradeAreaId,1));
+    }
+
+
+    /*------            正常业务👆👆    rpc远程调用👇👇                         -----------*/
+
+    /**
+     * 注册身份时对应的表添加数据
+     */
+    @RequestMapping("rpc/peopleDto")
+    public boolean peopleDto(@RequestBody PeopleDto peopleDto) {
+        boolean dto = tbPeopleService.peopleDto(peopleDto);
+        return dto;
+    }
+
+    /**
+     * 根据ID获取边民信息
+     */
+    @RequestMapping("rpc/getRpcById")
+    public PeopleDto getRpcById(@RequestParam("id") Long peopleId) {
+        PeopleDto rpcById = tbPeopleService.getRpcById(peopleId);
+        return rpcById;
+    }
+
+    /**
+     * 查集合 - 根据条件(参数为空时代表忽略指定条件)
+     */
+    @RequestMapping("rpc/getPeopleList")
+    public List<PeopleDto> getPeopleList(@RequestParam("groupId") Long groupId) {
+        SoMap so = SoMap.getRequestSoMap();
+        List<PeopleDto> list = tbPeopleService.getPeopleList(so.startPage(), groupId);
+        return list;
+    }
 
 
 }

+ 74 - 74
sp-service/level-one-server/src/main/java/com/pj/tb_people/TbPeopleMapper.xml

@@ -79,80 +79,80 @@
 	<!-- 查集合 - 根据条件(参数为空时代表忽略指定条件) [G] -->
 	<select id="getList" resultMap="model">
 		<include refid="select_sql"></include>
-<!--		<where>-->
-<!--			<if test=' this.has("id") '> and id = #{id} </if>-->
-<!--			<if test=' this.has("name") '> and name = #{name} </if>-->
-<!--			<if test=' this.has("code") '> and code = #{code} </if>-->
-<!--			<if test=' this.has("sex") '> and sex = #{sex} </if>-->
-<!--			<if test=' this.has("age") '> and age = #{age} </if>-->
-<!--			<if test=' this.has("idCard") '> and id_card = #{idCard} </if>-->
-<!--			<if test=' this.has("phone") '> and phone = #{phone} </if>-->
-<!--			<if test=' this.has("bankNo") '> and bank_no = #{bankNo} </if>-->
-<!--			<if test=' this.has("bankCode") '> and bank_code = #{bankCode} </if>-->
-<!--			<if test=' this.has("bankName") '> and bank_name = #{bankName} </if>-->
-<!--			<if test=' this.has("groupId") '> and group_id = #{groupId} </if>-->
-<!--			<if test=' this.has("groupName") '> and group_name = #{groupName} </if>-->
-<!--			<if test=' this.has("status") '> and status = #{status} </if>-->
-<!--			<if test=' this.has("role") '> and role = #{role} </if>-->
-<!--			<if test=' this.has("lng") '> and lng = #{lng} </if>-->
-<!--			<if test=' this.has("lat") '> and lat = #{lat} </if>-->
-<!--			<if test=' this.has("lastLocation") '> and last_location = #{lastLocation} </if>-->
-<!--			<if test=' this.has("address") '> and address = #{address} </if>-->
-<!--			<if test=' this.has("addressIds") '> and address_ids = #{addressIds} </if>-->
-<!--			<if test=' this.has("detailAddress") '> and detail_address = #{detailAddress} </if>-->
-<!--			<if test=' this.has("isLock") '> and is_lock = #{isLock} </if>-->
-<!--			<if test=' this.has("leftPrice") '> and left_price = #{leftPrice} </if>-->
-<!--			<if test=' this.has("judgeStatus") '> and judge_status = #{judgeStatus} </if>-->
-<!--			<if test=' this.has("judgeContent") '> and judge_content = #{judgeContent} </if>-->
-<!--			<if test=' this.has("registerTime") '> and register_time = #{registerTime} </if>-->
-<!--			<if test=' this.has("judgeTime") '> and judge_time = #{judgeTime} </if>-->
-<!--			<if test=' this.has("personId") '> and person_id = #{personId} </if>-->
-<!--			<if test=' this.has("createTime") '> and create_time = #{createTime} </if>-->
-<!--			<if test=' this.has("createBy") '> and create_by = #{createBy} </if>-->
-<!--			<if test=' this.has("createName") '> and create_name = #{createName} </if>-->
-<!--			<if test=' this.has("updateTime") '> and update_time = #{updateTime} </if>-->
-<!--			<if test=' this.has("updateBy") '> and update_by = #{updateBy} </if>-->
-<!--			<if test=' this.has("updateName") '> and update_name = #{updateName} </if>-->
-<!--			<if test=' this.has("deleteStatus") '> and delete_status = #{deleteStatus} </if>-->
-<!--		</where>-->
-<!--		order by-->
-<!--		<choose>-->
-<!--			<when test='sortType == 1'> id desc </when>-->
-<!--			<when test='sortType == 2'> name desc </when>-->
-<!--			<when test='sortType == 3'> code desc </when>-->
-<!--			<when test='sortType == 4'> sex desc </when>-->
-<!--			<when test='sortType == 5'> age desc </when>-->
-<!--			<when test='sortType == 6'> id_card desc </when>-->
-<!--			<when test='sortType == 7'> phone desc </when>-->
-<!--			<when test='sortType == 8'> bank_no desc </when>-->
-<!--			<when test='sortType == 9'> bank_code desc </when>-->
-<!--			<when test='sortType == 10'> bank_name desc </when>-->
-<!--			<when test='sortType == 11'> group_id desc </when>-->
-<!--			<when test='sortType == 12'> group_name desc </when>-->
-<!--			<when test='sortType == 13'> status desc </when>-->
-<!--			<when test='sortType == 14'> role desc </when>-->
-<!--			<when test='sortType == 15'> lng desc </when>-->
-<!--			<when test='sortType == 16'> lat desc </when>-->
-<!--			<when test='sortType == 17'> last_location desc </when>-->
-<!--			<when test='sortType == 18'> address desc </when>-->
-<!--			<when test='sortType == 19'> address_ids desc </when>-->
-<!--			<when test='sortType == 20'> detail_address desc </when>-->
-<!--			<when test='sortType == 21'> is_lock desc </when>-->
-<!--			<when test='sortType == 22'> left_price desc </when>-->
-<!--			<when test='sortType == 23'> judge_status desc </when>-->
-<!--			<when test='sortType == 24'> judge_content desc </when>-->
-<!--			<when test='sortType == 25'> register_time desc </when>-->
-<!--			<when test='sortType == 26'> judge_time desc </when>-->
-<!--			<when test='sortType == 27'> person_id desc </when>-->
-<!--			<when test='sortType == 28'> create_time desc </when>-->
-<!--			<when test='sortType == 29'> create_by desc </when>-->
-<!--			<when test='sortType == 30'> create_name desc </when>-->
-<!--			<when test='sortType == 31'> update_time desc </when>-->
-<!--			<when test='sortType == 32'> update_by desc </when>-->
-<!--			<when test='sortType == 33'> update_name desc </when>-->
-<!--			<when test='sortType == 34'> delete_status desc </when>-->
-<!--			<otherwise> id desc </otherwise>-->
-<!--		</choose>-->
+		<where>
+			<if test=' this.has("id") '> and id = #{id} </if>
+			<if test=' this.has("name") '> and name = #{name} </if>
+			<if test=' this.has("code") '> and code = #{code} </if>
+			<if test=' this.has("sex") '> and sex = #{sex} </if>
+			<if test=' this.has("age") '> and age = #{age} </if>
+			<if test=' this.has("idCard") '> and id_card = #{idCard} </if>
+			<if test=' this.has("phone") '> and phone = #{phone} </if>
+			<if test=' this.has("bankNo") '> and bank_no = #{bankNo} </if>
+			<if test=' this.has("bankCode") '> and bank_code = #{bankCode} </if>
+			<if test=' this.has("bankName") '> and bank_name = #{bankName} </if>
+			<if test=' this.has("groupId") '> and group_id = #{groupId} </if>
+			<if test=' this.has("groupName") '> and group_name = #{groupName} </if>
+			<if test=' this.has("status") '> and status = #{status} </if>
+			<if test=' this.has("role") '> and role = #{role} </if>
+			<if test=' this.has("lng") '> and lng = #{lng} </if>
+			<if test=' this.has("lat") '> and lat = #{lat} </if>
+			<if test=' this.has("lastLocation") '> and last_location = #{lastLocation} </if>
+			<if test=' this.has("address") '> and address = #{address} </if>
+			<if test=' this.has("addressIds") '> and address_ids = #{addressIds} </if>
+			<if test=' this.has("detailAddress") '> and detail_address = #{detailAddress} </if>
+			<if test=' this.has("isLock") '> and is_lock = #{isLock} </if>
+			<if test=' this.has("leftPrice") '> and left_price = #{leftPrice} </if>
+			<if test=' this.has("judgeStatus") '> and judge_status = #{judgeStatus} </if>
+			<if test=' this.has("judgeContent") '> and judge_content = #{judgeContent} </if>
+			<if test=' this.has("registerTime") '> and register_time = #{registerTime} </if>
+			<if test=' this.has("judgeTime") '> and judge_time = #{judgeTime} </if>
+			<if test=' this.has("personId") '> and person_id = #{personId} </if>
+			<if test=' this.has("createTime") '> and create_time = #{createTime} </if>
+			<if test=' this.has("createBy") '> and create_by = #{createBy} </if>
+			<if test=' this.has("createName") '> and create_name = #{createName} </if>
+			<if test=' this.has("updateTime") '> and update_time = #{updateTime} </if>
+			<if test=' this.has("updateBy") '> and update_by = #{updateBy} </if>
+			<if test=' this.has("updateName") '> and update_name = #{updateName} </if>
+			<if test=' this.has("deleteStatus") '> and delete_status = #{deleteStatus} </if>
+		</where>
+		order by
+		<choose>
+			<when test='sortType == 1'> id desc </when>
+			<when test='sortType == 2'> name desc </when>
+			<when test='sortType == 3'> code desc </when>
+			<when test='sortType == 4'> sex desc </when>
+			<when test='sortType == 5'> age desc </when>
+			<when test='sortType == 6'> id_card desc </when>
+			<when test='sortType == 7'> phone desc </when>
+			<when test='sortType == 8'> bank_no desc </when>
+			<when test='sortType == 9'> bank_code desc </when>
+			<when test='sortType == 10'> bank_name desc </when>
+			<when test='sortType == 11'> group_id desc </when>
+			<when test='sortType == 12'> group_name desc </when>
+			<when test='sortType == 13'> status desc </when>
+			<when test='sortType == 14'> role desc </when>
+			<when test='sortType == 15'> lng desc </when>
+			<when test='sortType == 16'> lat desc </when>
+			<when test='sortType == 17'> last_location desc </when>
+			<when test='sortType == 18'> address desc </when>
+			<when test='sortType == 19'> address_ids desc </when>
+			<when test='sortType == 20'> detail_address desc </when>
+			<when test='sortType == 21'> is_lock desc </when>
+			<when test='sortType == 22'> left_price desc </when>
+			<when test='sortType == 23'> judge_status desc </when>
+			<when test='sortType == 24'> judge_content desc </when>
+			<when test='sortType == 25'> register_time desc </when>
+			<when test='sortType == 26'> judge_time desc </when>
+			<when test='sortType == 27'> person_id desc </when>
+			<when test='sortType == 28'> create_time desc </when>
+			<when test='sortType == 29'> create_by desc </when>
+			<when test='sortType == 30'> create_name desc </when>
+			<when test='sortType == 31'> update_time desc </when>
+			<when test='sortType == 32'> update_by desc </when>
+			<when test='sortType == 33'> update_name desc </when>
+			<when test='sortType == 34'> delete_status desc </when>
+			<otherwise> id desc </otherwise>
+		</choose>
 	</select>
 
 

+ 12 - 0
sp-service/level-one-server/src/main/java/com/pj/tb_people/TbPeopleService.java

@@ -502,4 +502,16 @@ public class TbPeopleService extends ServiceImpl<TbPeopleMapper, TbPeople> imple
 		return resultDto;
 	}
 
+	/**
+	 * 根据角色获取边民列表
+	 * @param tradeAreaId
+	 * @param role 1边民,2组长,null ||0 全部
+	 * @return
+	 */
+	public List<TbPeople> getPeopleForGroup(Long tradeAreaId,Integer role) {
+		QueryWrapper<TbPeople>ew=new QueryWrapper<>();
+		ew.lambda().eq(TbPeople::getTradeAreaId,tradeAreaId)
+				.eq(role!=null&&role>0,TbPeople::getRole,role);
+		return list(ew);
+	}
 }