Forráskód Böngészése

Merge remote-tracking branch 'origin/master'

# Conflicts:
#	boman-web-core/src/main/java/com/boman/web/core/mapper/CzrkMapper.java
#	boman-web-core/src/main/resources/mapper/CzrkMapper.xml
tjf 3 éve
szülő
commit
2bec956175

+ 1 - 1
boman-web-core/src/main/java/com/boman/web/core/controller/RyrlController.java

@@ -68,7 +68,7 @@ public class RyrlController extends BaseController {
     }
 
     /**
-     * 功能描述: 小程序   人员认领接口 统计
+     * 功能描述: 小程序   人员新页面,统计全部、已认领、未认领各多少人
      *
      * @return com.boman.domain.dto.AjaxResult
      */

+ 1 - 0
boman-web-core/src/main/java/com/boman/web/core/mapper/CzrkMapper.java

@@ -94,4 +94,5 @@ public interface CzrkMapper {
      * @return
      */
    Czrk findHjInfo(Czrk czrk);
+    List<Czrk> stsByAppletCz(@Param("type") int type, @Param("areaId") Long areaId, @Param("userName") String userName);
 }

+ 2 - 7
boman-web-core/src/main/java/com/boman/web/core/service/czrk/CzrkServiceImpl.java

@@ -429,13 +429,8 @@ public class CzrkServiceImpl implements ICzrkService {
             wrl = czrkMapper.stsByWrl(type, areaId, userName);
         } else {
             // 常住
-            // 所有的czrkId
-            List<Long> jzdzs = czrkJzdzService.listCzrkIdByTypeAreaIdUserName(type, areaId, userName);
-            // id 和 isRl
-            List<Czrk> rls = czrkMapper.listIsRl(type, areaId, userName);
-            // 满足搜索条件的czrk
-            List<Czrk> filter = filter(rls, czrk -> jzdzs.contains(czrk.getId()));
-            for (Czrk czrk : filter) {
+            List<Czrk> rls = czrkMapper.stsByAppletCz(type, areaId, userName);
+            for (Czrk czrk : rls) {
                 if ("是".equals(czrk.getIsRl())) {
                     yrl++;
                 } else if ("否".equals(czrk.getIsRl())) {

+ 36 - 0
boman-web-core/src/main/resources/mapper/CzrkMapper.xml

@@ -570,4 +570,40 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="idCard != null and idCard != '' "> and c.id_card = #{idCard}</if>
         </where>
     </select>
+
+    <select id="stsByAppletCz" resultMap="CzrkResult">
+        SELECT
+            czrk.id,
+            czrk.is_rl
+        from czrk
+        left join czrk_jzdz jzdz on czrk.id = jzdz.czrk_id
+        <where>
+            czrk.is_del = 'N'
+            <if test="userName != null  and userName != ''">
+                and (czrk.user_name like concat('%', #{userName}, '%') or czrk.id_card like concat('%', #{userName}, '%'))
+            </if>
+
+            <choose>
+                <when test="type == 1">and jzdz.province_id = #{areaId}</when>
+                <when test="type == 2">and jzdz.city_id = #{areaId}</when>
+                <when test="type == 3">and jzdz.region_id = #{areaId}</when>
+                <when test="type == 4">and jzdz.village_towns_id = #{areaId}</when>
+                <when test="type == 5">and jzdz.village_id = #{areaId}</when>
+            </choose>
+
+           <!-- <if test="provinceIdXjd != null  and provinceIdXjd != ''"> and jzdz.province_id = #{areaId}</if>
+            <if test="cityIdXjd != null  and cityIdXjd != ''"> and jzdz.city_id = #{areaId}</if>
+            <if test="regionIdXjd != null  and regionIdXjd != ''"> and jzdz.region_id = #{areaId}</if>
+            <if test="villageTownsIdXjd != null  and villageTownsIdXjd != ''"> and jzdz.town_id = #{areaId}</if>
+            <if test="villageIdXjd != null  and villageIdXjd != ''"> and jzdz.village_id = #{areaId}</if>-->
+
+           <!-- <if test="provinceId != null  and provinceId != ''"> and czrk.province_id = #{areaId}</if>
+            <if test="cityId != null  and cityId != ''"> and czrk.city_id = #{areaId}</if>
+            <if test="regionId != null  and regionId != ''"> and czrk.region_id = #{areaId}</if>
+            <if test="villageTownsId != null  and villageTownsId != ''"> and czrk.village_towns_id = #{areaId}</if>
+            <if test="villageId != null  and villageId != ''"> and czrk.village_id = #{areaId}</if>
+            <if test="villagerGroupId != null  and villagerGroupId != ''"> and czrk.villager_group_id = #{villagerGroupId}</if>-->
+        </where>
+        GROUP BY czrk.id
+    </select>
 </mapper>