1. 新增监管系统中用户模糊搜索功能
2. 新增监测设备和用户的匹配关系搜索功能
已修改16个文件
已添加1个文件
281 ■■■■■ 文件已修改
src/main/kotlin/cn/flightfeather/supervision/common/utils/Constant.kt 13 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/kotlin/cn/flightfeather/supervision/domain/ds1/mapper/ScenseMapper.kt 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/kotlin/cn/flightfeather/supervision/domain/ds1/mapper/UserinfoMapper.kt 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/kotlin/cn/flightfeather/supervision/domain/ds1/repository/SceneRep.kt 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/kotlin/cn/flightfeather/supervision/domain/ds1/repository/UserInfoSVRep.kt 34 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/kotlin/cn/flightfeather/supervision/lightshare/service/DeviceService.kt 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/kotlin/cn/flightfeather/supervision/lightshare/service/UserMapService.kt 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/kotlin/cn/flightfeather/supervision/lightshare/service/UserinfoService.kt 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/kotlin/cn/flightfeather/supervision/lightshare/service/impl/DeviceServiceImpl.kt 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/kotlin/cn/flightfeather/supervision/lightshare/service/impl/UserMapServiceImpl.kt 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/kotlin/cn/flightfeather/supervision/lightshare/service/impl/UserinfoServiceImpl.kt 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/kotlin/cn/flightfeather/supervision/lightshare/vo/AreaVo.kt 45 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/kotlin/cn/flightfeather/supervision/lightshare/web/DeviceController.kt 14 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/kotlin/cn/flightfeather/supervision/lightshare/web/UserMapController.kt 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/kotlin/cn/flightfeather/supervision/lightshare/web/UserinfoController.kt 19 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/application-test.yml 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/mapper/ds1/UserinfoMapper.xml 87 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/kotlin/cn/flightfeather/supervision/common/utils/Constant.kt
@@ -7,7 +7,18 @@
        ADMIN(0, "管理员"),
        INSIDER(1, "内部人员"),
        GOV(2, "政府部门"),
        ENTERPRISE(3, "企业")
        ENTERPRISE(3, "企业");
        companion object {
            fun fromValue(value: Int?) = when (value) {
                -1 -> ALL_USER
                0 -> ADMIN
                1 -> INSIDER
                2 -> GOV
                3 -> ENTERPRISE
                else -> ALL_USER
            }
        }
    }
    //规范类别
    enum class RuleType(val value: Byte, val text: String){
src/main/kotlin/cn/flightfeather/supervision/domain/ds1/mapper/ScenseMapper.kt
@@ -6,7 +6,7 @@
import org.apache.ibatis.annotations.Select
@Mapper
interface ScenseMapper:MyMapper<Scense>, MutableList<Scense> {
interface ScenseMapper : MyMapper<Scense> {
    /**
     * èŽ·å–æœªåˆ›å»ºç”¨æˆ·çš„åœºæ™¯
src/main/kotlin/cn/flightfeather/supervision/domain/ds1/mapper/UserinfoMapper.kt
@@ -2,9 +2,14 @@
import cn.flightfeather.supervision.domain.ds1.entity.Userinfo
import cn.flightfeather.supervision.domain.util.MyMapper
import cn.flightfeather.supervision.lightshare.vo.AreaVo
import org.apache.ibatis.annotations.Mapper
@Mapper
interface UserinfoMapper:MyMapper<Userinfo> {
    /**
     * ç”¨æˆ·æ¨¡ç³Šæœç´¢
     */
    fun searchUser(areaVo: AreaVo, keyword: String, userTypeId: Int): List<Userinfo?>
}
src/main/kotlin/cn/flightfeather/supervision/domain/ds1/repository/SceneRep.kt
@@ -38,6 +38,10 @@
        })
    }
    fun findSceneList(scene: Scense): List<Scense?> {
        return scenseMapper.select(scene)
    }
    fun findSceneList(nameList: List<String?>): List<Scense?> {
        return scenseMapper.selectByExample(Example(Scense::class.java).apply {
            createCriteria().andIn("name", nameList)
src/main/kotlin/cn/flightfeather/supervision/domain/ds1/repository/UserInfoSVRep.kt
@@ -1,8 +1,10 @@
package cn.flightfeather.supervision.domain.ds1.repository
import cn.flightfeather.supervision.common.utils.Constant
import cn.flightfeather.supervision.domain.ds1.entity.Scense
import cn.flightfeather.supervision.domain.ds1.entity.Userinfo
import cn.flightfeather.supervision.domain.ds1.mapper.UserinfoMapper
import cn.flightfeather.supervision.lightshare.vo.AreaVo
import org.springframework.stereotype.Repository
import tk.mybatis.mapper.entity.Example
@@ -12,6 +14,7 @@
@Repository
class UserInfoSVRep(
    private val userinfoMapper: UserinfoMapper,
    private val sceneRep: SceneRep,
) {
    /**
@@ -31,4 +34,35 @@
            null
        }
    }
    /**
     * æ¨¡ç³Šæœç´¢ç”¨æˆ·
     * @param areaVo æŸ¥è¯¢åŒºåŸŸèŒƒå›´
     * @param keyword æœç´¢å…³é”®å­—,匹配账户[Userinfo.acountname]和昵称[Userinfo.realname]
     * @param userType ç”¨æˆ·ç±»åž‹ï¼Œé»˜è®¤ä¼ä¸š[Constant.UserType.ENTERPRISE]
     */
    fun searchUser(
        areaVo: AreaVo, keyword: String,
        userType: Constant.UserType = Constant.UserType.ENTERPRISE,
    ): List<Userinfo?> {
        return userinfoMapper.searchUser(areaVo, keyword, userType.value)
//        val userList = userinfoMapper.selectByExample(Example(Userinfo::class.java).apply {
//            createCriteria().orLike("realname", "%${keyword}%")
//                .orLike("acountname", "%${keyword}%")
//        })
//        val sceneList = sceneRep.findSceneList(Scense().apply {
//            provincecode = areaVo.provincecode
//            citycode = areaVo.citycode
//            districtcode = areaVo.districtcode
//            towncode = areaVo.towncode
//            typeid = areaVo.scensetypeid?.toByteOrNull()
//            extension1 = if (areaVo.online == true) "1" else "0"
//        })
//        return userList.filter { u ->
//            val scene = sceneList.find { s ->
//                return@find s?.guid == u.dGuid
//            }
//            return@filter scene != null
//        }
    }
}
src/main/kotlin/cn/flightfeather/supervision/lightshare/service/DeviceService.kt
@@ -3,6 +3,11 @@
import cn.flightfeather.supervision.common.utils.Constant
import cn.flightfeather.supervision.domain.ds1.entity.BaseDevice
import cn.flightfeather.supervision.domain.ds1.entity.DeviceStatus
import cn.flightfeather.supervision.lightshare.vo.AreaVo
import cn.flightfeather.supervision.lightshare.vo.DataHead
import cn.flightfeather.supervision.lightshare.vo.MonitorDeviceInfoVo
import io.swagger.annotations.ApiParam
import org.springframework.web.bind.annotation.RequestParam
import org.springframework.web.multipart.MultipartFile
interface DeviceService {
@@ -39,4 +44,8 @@
     *更新设备及图片
     */
    fun updateDeviceLocation(deviceLocation: String, deleteImg: List<String>, files: Array<MultipartFile>): Int
    fun searchExternalDevice(
        areaVo: AreaVo, keyword: String, page: Int?, perPage: Int?,
    ): Pair<DataHead, MonitorDeviceInfoVo>
}
src/main/kotlin/cn/flightfeather/supervision/lightshare/service/UserMapService.kt
@@ -20,5 +20,5 @@
    fun autoCreateMap(userList: List<Userinfo?>)
    fun fetchDeviceMap(areaVo: AreaVo): List<DeviceMapVo?>
    fun fetchDeviceMap(page: Int?, perPage: Int?, areaVo: AreaVo): List<DeviceMapVo?>
}
src/main/kotlin/cn/flightfeather/supervision/lightshare/service/UserinfoService.kt
@@ -3,6 +3,9 @@
import cn.flightfeather.supervision.domain.ds1.entity.Scense
import cn.flightfeather.supervision.domain.ds1.entity.Userinfo
import cn.flightfeather.supervision.domain.ds2.entity.UserinfoTZ
import cn.flightfeather.supervision.lightshare.vo.AreaVo
import cn.flightfeather.supervision.lightshare.vo.DataHead
import org.springframework.web.bind.annotation.RequestBody
interface UserinfoService {
    fun findOne(id: String): Userinfo?
@@ -17,12 +20,21 @@
    fun delete(id: String): Int
    /**
     * æ ¹æ®è´¦æˆ·åç§°æ¨¡ç³Šæœç´¢
     */
    fun search(areaVo: AreaVo, keyword: String, userType: Int?, page: Int?, perPage: Int?)
            : Pair<DataHead, List<Userinfo?>>
    fun findOneByName(userinfo: Userinfo): Userinfo?
    fun createAccount(sceneId: String): Userinfo
    fun findByScene(sceneId: String): Userinfo?
    /**
     * æ ¹æ®åœºæ™¯åç§°ï¼ŒèŽ·å–åˆé€‚çš„è´¦æˆ·å
     */
    fun getUName(sceneName: String): String
    fun autoCreateAccount()
src/main/kotlin/cn/flightfeather/supervision/lightshare/service/impl/DeviceServiceImpl.kt
@@ -8,6 +8,9 @@
import cn.flightfeather.supervision.domain.ds1.entity.*
import cn.flightfeather.supervision.domain.ds1.repository.DeviceRep
import cn.flightfeather.supervision.lightshare.service.DeviceService
import cn.flightfeather.supervision.lightshare.vo.AreaVo
import cn.flightfeather.supervision.lightshare.vo.DataHead
import cn.flightfeather.supervision.lightshare.vo.MonitorDeviceInfoVo
import com.google.gson.Gson
import org.springframework.beans.factory.annotation.Value
import org.springframework.stereotype.Service
@@ -112,4 +115,10 @@
        obj.dlPicUrl = oldImg.joinToString(";")
        return deviceRep.updateStatus(obj)
    }
    override fun searchExternalDevice(
        areaVo: AreaVo, keyword: String, page: Int?, perPage: Int?,
    ): Pair<DataHead, MonitorDeviceInfoVo> {
        TODO("Not yet implemented")
    }
}
src/main/kotlin/cn/flightfeather/supervision/lightshare/service/impl/UserMapServiceImpl.kt
@@ -96,7 +96,7 @@
        }
    }
    override fun fetchDeviceMap(areaVo: AreaVo): List<DeviceMapVo?> {
    override fun fetchDeviceMap(page: Int?, perPage: Int?, areaVo: AreaVo): List<DeviceMapVo?> {
        // 1.通过区域条件获取主体用户
        val userIdList = when (areaVo.sourceType) {
            //以飞羽环境系统中的用户为主体
src/main/kotlin/cn/flightfeather/supervision/lightshare/service/impl/UserinfoServiceImpl.kt
@@ -14,6 +14,8 @@
import cn.flightfeather.supervision.domain.ds2.repository.UserInfoTZRep
import cn.flightfeather.supervision.lightshare.service.UserinfoService
import cn.flightfeather.supervision.lightshare.vo.AreaVo
import cn.flightfeather.supervision.lightshare.vo.DataHead
import com.github.pagehelper.PageHelper
import org.springframework.beans.BeanUtils
import org.springframework.stereotype.Service
import tk.mybatis.mapper.entity.Example
@@ -69,6 +71,14 @@
    override fun delete(id: String): Int = userinfoMapper.deleteByPrimaryKey(id)
    override fun search(areaVo: AreaVo, keyword: String, userType: Int?, page: Int?, perPage: Int?)
            : Pair<DataHead, List<Userinfo?>> {
        val p = PageHelper.startPage<Userinfo>(page ?: 1, perPage ?: 30)
        val result = userInfoSVRep.searchUser(areaVo, keyword.trim(), Constant.UserType.fromValue(userType))
        result.forEach { it?.password = null }
        return DataHead(p.pageNum, p.pages, p.total) to result
    }
    override fun createAccount(sceneId: String): Userinfo {
        findByScene(sceneId)?.let { return it }
src/main/kotlin/cn/flightfeather/supervision/lightshare/vo/AreaVo.kt
@@ -2,43 +2,66 @@
import com.fasterxml.jackson.annotation.JsonFormat
import com.fasterxml.jackson.annotation.JsonInclude
import io.swagger.annotations.ApiModel
import io.swagger.annotations.ApiModelProperty
import java.time.LocalDateTime
/**
 * åŒºåŸŸæ¡ä»¶
 */
@JsonInclude(JsonInclude.Include.NON_NULL)
open class AreaVo{
    // è¡Œæ”¿åŒºåˆ’
@ApiModel("区域条件")
open class AreaVo {
    @ApiModelProperty("省份编码")
    var provincecode: String? = null
    @ApiModelProperty("省份名称")
    var provincename: String? = null
    @ApiModelProperty("城市编码")
    var citycode: String? = null
    @ApiModelProperty("城市名称")
    var cityname: String? = null
    @ApiModelProperty("区县编码")
    var districtcode: String? = null
    @ApiModelProperty("区县名称")
    var districtname: String? = null
    @ApiModelProperty("街镇编码")
    var towncode: String? = null
    @ApiModelProperty("街镇名称")
    var townname: String? = null
    // æ—¶é—´èŒƒå›´,格式yyyy-MM-dd HH:mm:ss
    @ApiModelProperty("起始时间,格式 yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    var starttime: LocalDateTime? = null
    @ApiModelProperty("结束时间,格式 yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    var endtime: LocalDateTime? = null
    // åœºæ™¯id
    @ApiModelProperty("场景主键id")
    var sceneId: String? = null
    // åœºæ™¯åç§°
    @ApiModelProperty("场景名称")
    var sceneName: String? = null
    // åœºæ™¯ç±»åž‹
    @ApiModelProperty("场景类型id")
    var scensetypeid: String? = null
    // æ˜¯å¦ä¸Šçº¿
    @ApiModelProperty("是否上线")
    var online: Boolean? = null
    // ä¸»æ•°æ®æºï¼Œ1:以飞羽环境系统中的用户为主体;2:以飞羽监管系统中的用户为主体
    var sourceType:Int = 1
    @ApiModelProperty("主数据源", allowableValues = "1:以飞羽环境系统中的用户为主体;2:以飞羽监管系统中的用户为主体")
    var sourceType: Int = 1
    // æŸ¥è¯¢æŽ’序
    var sort:String? = "asc"
    @ApiModelProperty("查询排序", allowableValues = "asc:正序, desc:倒序")
    var sort: String? = "asc"
    @ApiModelProperty("排序字段", allowableValues = "pro: æŒ‰ç…§é—®é¢˜æ•°æŽ’序,changePer:按照整改率排序")
    var sortBy: String? = null
}
src/main/kotlin/cn/flightfeather/supervision/lightshare/web/DeviceController.kt
@@ -3,6 +3,7 @@
import cn.flightfeather.supervision.common.utils.Constant
import cn.flightfeather.supervision.domain.ds1.entity.MonitorDeviceInfo
import cn.flightfeather.supervision.lightshare.service.DeviceService
import cn.flightfeather.supervision.lightshare.vo.AreaVo
import io.swagger.annotations.Api
import io.swagger.annotations.ApiOperation
import io.swagger.annotations.ApiParam
@@ -57,4 +58,17 @@
        @ApiParam("删除的设备图片路径") @RequestParam("deleteImg") deleteImg: List<String>,
        @ApiParam("设备图片") @RequestPart("images") images: Array<MultipartFile>,
    ) = resPack { deviceService.updateDeviceLocation(status, deleteImg, images) }
    @ApiOperation("查询从外部获取的设备信息")
    @PostMapping("/external/search")
    fun searchExternalDevice(
        @ApiParam("区域条件信息") @RequestBody
        areaVo: AreaVo,
        @ApiParam("搜索关键字,匹配设备编号和点位名称") @RequestParam
        keyword: String,
        @ApiParam("查询页码", defaultValue = "1", required = false) @RequestParam("page", required = false)
        page: Int?,
        @ApiParam("单页数据量", defaultValue = "30", required = false) @RequestParam("per_page", required = false)
        perPage: Int?,
    ) = resPack { deviceService.searchExternalDevice(areaVo, keyword, page, perPage) }
}
src/main/kotlin/cn/flightfeather/supervision/lightshare/web/UserMapController.kt
@@ -4,6 +4,7 @@
import cn.flightfeather.supervision.lightshare.vo.AreaVo
import io.swagger.annotations.Api
import io.swagger.annotations.ApiOperation
import io.swagger.annotations.ApiParam
import org.springframework.web.bind.annotation.*
@Api(tags = ["UserMapController"], description = "用户id对应API接口")
@@ -21,5 +22,12 @@
    @ApiOperation(value = "获取区域用户的监测设备和飞羽监管系统、飞羽环境系统的匹配记录")
    @PostMapping("/device")
    fun fetchDeviceMap(@RequestBody areaVo: AreaVo) = resPack { userMapService.fetchDeviceMap(areaVo) }
    fun fetchDeviceMap(
        @ApiParam("查询页码", defaultValue = "1", required = false) @RequestParam("page", required = false)
        page: Int?,
        @ApiParam("单页数据量", defaultValue = "30", required = false) @RequestParam("per_page", required = false)
        perPage: Int?,
        @ApiParam("区域条件信息") @RequestBody
        areaVo: AreaVo
    ) = resPack { userMapService.fetchDeviceMap(page, perPage, areaVo) }
}
src/main/kotlin/cn/flightfeather/supervision/lightshare/web/UserinfoController.kt
@@ -2,7 +2,10 @@
import cn.flightfeather.supervision.domain.ds1.entity.Userinfo
import cn.flightfeather.supervision.lightshare.service.UserinfoService
import cn.flightfeather.supervision.lightshare.vo.AreaVo
import io.swagger.annotations.Api
import io.swagger.annotations.ApiOperation
import io.swagger.annotations.ApiParam
import org.springframework.web.bind.annotation.*
@Api(tags = ["UserinfoController"], description = "用户信息API接口")
@@ -28,6 +31,22 @@
    @DeleteMapping("/{id}")
    fun delete(@PathVariable id: String) = userinfoService.delete(id)
    @ApiOperation(value = "模糊搜索用户信息")
    @PostMapping("/search")
    fun search(
        @ApiParam("区域条件信息") @RequestBody
        areaVo: AreaVo,
        @ApiParam("搜索关键字,匹配用户账户名和昵称") @RequestParam
        keyword: String,
        @ApiParam("用户类型", example = "0:管理员;1:内部人员;2:政府部门;3:企业", defaultValue = "3", required = false)
        @RequestParam(required = false)
        userType: Int?,
        @ApiParam("查询页码", defaultValue = "1", required = false) @RequestParam("page", required = false)
        page: Int?,
        @ApiParam("单页数据量", defaultValue = "30", required = false) @RequestParam("per_page", required = false)
        perPage: Int?,
    ) = resPack { userinfoService.search(areaVo, keyword, userType, page, perPage) }
    @PostMapping("/login")
    fun getByName(@RequestBody userinfo: Userinfo) = userinfoService.findOneByName(userinfo)
src/main/resources/application-test.yml
@@ -11,12 +11,12 @@
      #      username: root
      #      password: cn.FLIGHTFEATHER
      #-远程测试服务器-
      #-远程正式服务器(暂做测试)-
      url: jdbc:mysql://47.100.191.150:3306/supervision?serverTimezone=Asia/Shanghai&prepStmtCacheSize=517&cachePrepStmts=true&autoReconnect=true&characterEncoding=utf-8&allowMultiQueries=true&useSSL=false
      username: remoteU1
      password: eSoF8DnzfGTlhAjE
    ds2:
      #-远程测试服务器-
      #-远程正式服务器(暂做测试)-
      url: jdbc:mysql://47.100.191.150:3306/ledger?serverTimezone=Asia/Shanghai&prepStmtCacheSize=517&cachePrepStmts=true&autoReconnect=true&characterEncoding=utf-8&allowMultiQueries=true&useSSL=false
      username: remoteU1
      password: eSoF8DnzfGTlhAjE
src/main/resources/mapper/ds1/UserinfoMapper.xml
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,87 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="cn.flightfeather.supervision.domain.ds1.mapper.UserinfoMapper">
  <resultMap id="BaseResultMap" type="cn.flightfeather.supervision.domain.ds1.entity.Userinfo">
    <!--
      WARNING - @mbg.generated
    -->
    <id column="UI_GUID" jdbcType="VARCHAR" property="guid" />
    <result column="UI_AcountName" jdbcType="VARCHAR" property="acountname" />
    <result column="UI_RealName" jdbcType="VARCHAR" property="realname" />
    <result column="UI_Password" jdbcType="VARCHAR" property="password" />
    <result column="UI_UserTypeID" jdbcType="TINYINT" property="usertypeid" />
    <result column="UI_UserType" jdbcType="VARCHAR" property="usertype" />
    <result column="D_GUID" jdbcType="VARCHAR" property="dGuid" />
    <result column="UI_DepartmentName" jdbcType="VARCHAR" property="departmentname" />
    <result column="UI_IsEnable" jdbcType="BIT" property="isenable" />
    <result column="UI_WorkNo" jdbcType="VARCHAR" property="workno" />
    <result column="UI_Telephone" jdbcType="VARCHAR" property="telephone" />
    <result column="UI_WechatID" jdbcType="VARCHAR" property="wechatid" />
    <result column="UI_Extension1" jdbcType="VARCHAR" property="extension1" />
    <result column="UI_Extension2" jdbcType="VARCHAR" property="extension2" />
    <result column="UI_Extension3" jdbcType="VARCHAR" property="extension3" />
    <result column="UI_Remark" jdbcType="VARCHAR" property="remark" />
  </resultMap>
  <sql id="Base_Column_List">
    <!--
      WARNING - @mbg.generated
    -->
    UI_GUID, UI_AcountName, UI_RealName, UI_Password, UI_UserTypeID,
    UI_UserType, D_GUID, UI_DepartmentName, UI_IsEnable,
    UI_WorkNo, UI_Telephone, UI_WechatID, UI_Extension1,
    UI_Extension2, UI_Extension3, UI_Remark
  </sql>
  <select id="searchUser" resultMap="BaseResultMap">
    SELECT
    a.*
    FROM
    sm_t_userinfo AS a
    LEFT JOIN sm_t_scense AS b ON a.D_GUID = b.S_GUID
    WHERE
    (a.UI_WorkNo IS NULL OR a.UI_WorkNo != 'test')
    <if test="areaVo.provincecode != null">
      AND b.S_ProvinceCode = #{areaVo.provincecode}
    </if>
    <if test="areaVo.provincename != null">
      AND b.S_ProvinceName = #{areaVo.provincename}
    </if>
    <if test="areaVo.citycode != null">
      AND b.S_CityCode = #{areaVo.citycode}
    </if>
    <if test="areaVo.cityname != null">
      AND b.S_CityName = #{areaVo.cityname}
    </if>
    <if test="areaVo.districtcode != null">
      AND b.S_DistrictCode = #{areaVo.districtcode}
    </if>
    <if test="areaVo.districtname != null">
      AND b.S_DistrictName = #{areaVo.districtname}
    </if>
    <if test="areaVo.towncode != null">
      AND b.S_TownCode = #{areaVo.towncode}
    </if>
    <if test="areaVo.townname != null">
      AND b.S_TownName = #{areaVo.townname}
    </if>
    <if test="areaVo.scensetypeid != null">
      AND b.S_TypeID = #{areaVo.scensetypeid}
    </if>
    <if test="areaVo.online == true">
      AND b.S_Extension1 = '1'
    </if>
    <if test="areaVo.online == false">
      AND b.S_Extension1 = '0'
    </if>
    <if test="userTypeId != null">
      AND a.UI_UserTypeID = #{userTypeId}
    </if>
    <if test="keyword != null and keyword != ''">
      AND (
        a.UI_AcountName LIKE CONCAT('%', #{keyword}, '%')
        OR
        a.UI_RealName LIKE CONCAT('%', #{keyword}, '%')
      )
    </if>
  </select>
</mapper>