1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390 |
- <?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="com.boman.web.core.mapper.CzrkMapper">
- <resultMap type="com.boman.domain.Czrk" id="CzrkResult">
- <result property="id" column="id"/>
- <result property="czrkJzdzId" column="czrk_jzdz_id"/>
- <result property="userName" column="user_name"/>
- <result property="gender" column="gender"/>
- <result property="age" column="age"/>
- <result property="birthday" column="birthday"/>
- <result property="deptId" column="dept_id"/>
- <result property="idCard" column="id_card"/>
- <result property="phoneNum" column="phone_num"/>
- <result property="code" column="code"/>
- <result property="houseType" column="house_type"/>
- <result property="rlr" column="rlr"/>
- <result property="rlrNike" column="rlr_nike"/>
- <result property="rlTime" column="rl_time"/>
- <result property="keyIndustries" column="key_industries"/>
- <result property="yhzgx" column="yhzgx"/>
- <result property="workUnit" column="work_unit"/>
- <result property="provinceId" column="province_id"/>
- <result property="province" column="province"/>
- <result property="cityId" column="city_id"/>
- <result property="city" column="city"/>
- <result property="regionId" column="region_id"/>
- <result property="isRl" column="is_rl"/>
- <result property="region" column="region"/>
- <result property="villageTownsId" column="village_towns_id"/>
- <result property="villageTowns" column="village_towns"/>
- <result property="villageId" column="village_id"/>
- <result property="village" column="village"/>
- <result property="villagerGroupId" column="villager_group_id"/>
- <result property="villagerGroup" column="villager_group"/>
- <result property="nowIn" column="now_in"/>
- <result property="remark" column="remark"/>
- <result property="gridId" column="grid_id"/>
- <result property="status" column="status"/>
- <result property="changUser" column="chang_user"/>
- <result property="changNikeUser" column="chang_nike_user"/>
- <result property="changUserTime" column="chang_user_time"/>
- <result property="isConfirm" column="is_confirm"/>
- <result property="confirmInfoUser" column="confirm_info_user"/>
- <result property="confirmInfoNikeUser" column="confirm_info_nike_user"/>
- <result property="confirmInfoUserTime" column="confirm_info_user_time"/>
- <result property="createBy" column="create_by"/>
- <result property="createTime" column="create_time"/>
- <result property="updateBy" column="update_by"/>
- <result property="updateTime" column="update_time"/>
- <result property="isDel" column="is_del"/>
- <result property="deleteReason" column="delete_reason"/>
- <result property="provinceXjd" column="provinceXjd"/>
- <result property="cityXjd" column="cityXjd"/>
- <result property="regionXjd" column="regionXjd"/>
- <result property="villageTownsXjd" column="villageTownsXjd"/>
- <result property="villageXjd" column="villageXjd"/>
- <result property="nowXjd" column="nowXjd"/>
- <collection property="czrkJzdzList" javaType="java.util.List" resultMap="CzrkJzdzResult"/>
- </resultMap>
- <resultMap type="com.boman.domain.CzrkJzdz" id="CzrkJzdzResult">
- <result property="provinceId" column="province_id_jzdz"/>
- <result property="province" column="province_jzdz"/>
- <result property="cityId" column="city_id_jzdz"/>
- <result property="city" column="city_jzdz"/>
- <result property="regionId" column="region_id_jzdz"/>
- <result property="region" column="region_jzdz"/>
- <result property="townId" column="town_id_jzdz"/>
- <result property="town" column="town_jzdz"/>
- <result property="villageId" column="village_id_jzdz"/>
- <result property="village" column="village_jzdz"/>
- <result property="nowIn" column="now_in_jzdz"/>
- </resultMap>
- <resultMap type="com.boman.domain.SysDept" id="SysDeptResult">
- <id property="id" column="id"/>
- <result property="parentId" column="parent_id"/>
- <result property="ancestors" column="ancestors"/>
- <result property="deptName" column="dept_name"/>
- <result property="orderNum" column="order_num"/>
- <result property="leader" column="leader"/>
- <result property="phone" column="phone"/>
- <result property="email" column="email"/>
- <result property="status" column="status"/>
- <result property="delFlag" column="del_flag"/>
- <result property="parentName" column="parent_name"/>
- <result property="num" column="num"/>
- <result property="createBy" column="create_by"/>
- <result property="createTime" column="create_time"/>
- <result property="updateBy" column="update_by"/>
- <result property="updateTime" column="update_time"/>
- </resultMap>
- <resultMap type="com.boman.web.core.domain.ConfirmInfoUser" id="ConfrimInforUserResult">
- <result property="confirmInfoUser" column="confirm_info_user"/>
- <result property="confirmInfoNikeUser" column="confirm_info_nike_user"/>
- <result property="czrkId" column="czrk_id"/>
- </resultMap>
- <sql id="selectCzrkVo">
- select id, user_name, gender, age, birthday,dept_id, id_card, phone_num, code, house_type, rlr,rlr_nike, rl_time, yhzgx
- , work_unit, province_id, province, city_id, city, region_id, region, village_towns_id, village_towns
- , village_id, village, villager_group_id, villager_group, now_in, remark,grid_id, status,is_confirm,confirm_info_user,confirm_info_nike_user,confirm_info_user_time, create_by, create_time
- , update_by, update_time, is_del, delete_reason, is_rl, key_industries from czrk
- </sql>
- <select id="listByCzrk" resultMap="CzrkResult">
- select id, user_name, phone_num, id_card, gender, province, city, region, village_towns, village,
- villager_group, grid_id, house_type, code,is_rl,
- rlr,rlr_nike,now_in,is_confirm,confirm_info_user,confirm_info_nike_user,confirm_info_user_time
- from czrk
- <where>
- is_del = 'N'
- and status = '1'
- <!-- 已认领 -->
- <if test="isRl != null and isRl != ''">and is_rl = #{isRl}</if>
- <if test="userName != null and userName != ''">
- and user_name like concat(#{userName}, '%')
- </if>
- <if test="params.startAge != null and params.startAge != ''">and age >= #{params.startAge}</if>
- <if test="params.endAge != null and params.endAge != ''">and age <= #{params.endAge}</if>
- <if test="gender != null and gender != ''">and gender = #{gender}</if>
- <if test="age != null ">and age = #{age}</if>
- <if test="birthday != null ">and birthday = #{birthday}</if>
- <if test="idCard != null and idCard != ''">and id_card = #{idCard}</if>
- <if test="phoneNum != null and phoneNum != ''">and phone_num = #{phoneNum}</if>
- <if test="houseType != null and houseType != ''">and house_type = #{houseType}</if>
- <if test="provinceId != null and provinceId != ''">and province_id = #{provinceId}</if>
- <if test="province != null and province != ''">and province = #{province}</if>
- <if test="cityId != null and cityId != ''">and city_id = #{cityId}</if>
- <if test="city != null and city != ''">and city = #{city}</if>
- <if test="regionId != null and regionId != ''">and region_id = #{regionId}</if>
- <if test="region != null and region != ''">and region = #{region}</if>
- <if test="villageTownsId != null and villageTownsId != ''">and village_towns_id = #{villageTownsId}</if>
- <if test="villageTowns != null and villageTowns != ''">and village_towns = #{villageTowns}</if>
- <if test="villageId != null and villageId != ''">and village_id = #{villageId}</if>
- <if test="village != null and village != ''">and village = #{village}</if>
- <if test="isConfirm != null and isConfirm != ''">and is_confirm = #{isConfirm}</if>
- <if test="gridId != null and gridId != ''">and grid_id = #{gridId}</if>
- </where>
- order by create_time DESC
- </select>
- <select id="listCzrkByJzdz" resultMap="CzrkResult">
- select c.id, c.user_name, c.phone_num,c.dept_id, c.id_card,
- c.province, c.city ,c.region , c.village_towns, c.village ,c.now_in,
- c.gender, c.grid_id, c.house_type, c.update_by, c.code,c.is_rl, c.rlr,c.rlr_nike,
- c.is_confirm,c.confirm_info_user,c.confirm_info_nike_user,c.confirm_info_user_time
- from czrk c left join czrk_jzdz z on c.id =z.czrk_id
- <where>
- c.is_del = 'N'
- and c.status = '1'
- <if test="isRl != null and isRl != ''">and c.is_rl = #{isRl}</if>
- <if test="userName != null and userName != ''">
- and c.user_name like concat(#{userName}, '%')
- </if>
- <if test="params.startAge != null and params.startAge != ''">and c.age >= #{params.startAge}</if>
- <if test="params.endAge != null and params.endAge != ''">and c.age <= #{params.endAge}</if>
- <if test="idCard != null and idCard != ''">and c.id_card = #{idCard}</if>
- <if test="phoneNum != null and phoneNum != ''">and c.phone_num = #{phoneNum}</if>
- <if test="houseType != null and houseType != ''">and c.house_type = #{houseType}</if>
- <if test="provinceId != null and provinceId != ''">and c.province_id = #{provinceId}</if>
- <if test="cityId != null and cityId != ''">and c.city_id = #{cityId}</if>
- <if test="regionId != null and regionId != ''">and c.region_id = #{regionId}</if>
- <if test="villageTownsId != null and villageTownsId != ''">and c.village_towns_id = #{villageTownsId}</if>
- <if test="villageId != null and villageId != ''">and c.village_id = #{villageId}</if>
- <if test="isConfirm != null and isConfirm != ''">and c.is_confirm = #{isConfirm}</if>
- <if test="provinceIdXjd != null and provinceIdXjd != ''">and z.province_id = #{provinceIdXjd}</if>
- <if test="cityIdXjd != null and cityIdXjd != ''">and z.city_id = #{cityIdXjd}</if>
- <if test="regionIdXjd != null and regionIdXjd != ''">and z.region_id = #{regionIdXjd}</if>
- <if test="villageTownsIdXjd != null and villageTownsIdXjd != ''">and z.town_id = #{villageTownsIdXjd}</if>
- <if test="villageIdXjd != null and villageIdXjd != ''">and z.village_id = #{villageIdXjd}</if>
- </where>
- order by c.create_time DESC
- </select>
- <select id="listByRlryRel" resultType="com.boman.domain.Czrk">
- SELECT
- czrk.id,
- ANY_VALUE(czrk.user_name) userName,
- ANY_VALUE(czrk.phone_num) phoneNum,
- ANY_VALUE(czrk.id_card) idCard,
- ANY_VALUE(czrk.gender) gender,
- ANY_VALUE(czrk.province) province,
- ANY_VALUE(czrk.is_rl) isRl,
- ANY_VALUE(czrk.city) city,
- ANY_VALUE(czrk.region) region,
- ANY_VALUE(czrk.house_type) houseType,
- ANY_VALUE(czrk.update_by) updateBy,
- ANY_VALUE(czrk. CODE) CODE,
- ANY_VALUE(czrk.rlr) rlr,
- ANY_VALUE(czrk.update_time) updateTime,
- ANY_VALUE(czrk.delete_reason) deleteReason,
- ANY_VALUE(czrk.now_in) nowIn,
- ANY_VALUE(jzdz.province) provinceXjd,
- ANY_VALUE(jzdz.city) cityXjd,
- ANY_VALUE(jzdz.region) regionXjd,
- ANY_VALUE(jzdz.town) villageTownsXjd,
- ANY_VALUE(jzdz.village) villageXjd,
- ANY_VALUE(jzdz.now_in) domicile
- from czrk
- left join czrk_jzdz jzdz on czrk.id = jzdz.czrk_id
- <where>
- jzdz.status = 'Y'
- <!-- 已认领 -->
- <if test="isRl != null and isRl != ''">and czrk.is_rl = #{isRl}</if>
- <if test="userName != null and userName != ''">
- and (czrk.user_name like concat(#{userName}, '%') or czrk.id_card like concat( #{userName}, '%'))
- </if>
- <if test="params.startAge != null and params.startAge != ''">and czrk.age >= #{params.startAge}</if>
- <if test="params.endAge != null and params.endAge != ''">and czrk.age <= #{params.endAge}</if>
- <if test="gender != null and gender != ''">and czrk.gender = #{gender}</if>
- <if test="age != null ">and czrk.age = #{age}</if>
- <if test="birthday != null ">and czrk.birthday = #{birthday}</if>
- <if test="idCard != null and idCard != ''">and czrk.id_card = #{idCard}</if>
- <if test="phoneNum != null and phoneNum != ''">and czrk.phone_num = #{phoneNum}</if>
- <if test="code != null and code != ''">and czrk.code = #{code}</if>
- <if test="houseType != null and houseType != ''">and czrk.house_type = #{houseType}</if>
- <if test="rlr != null and rlr != ''">and czrk.rlr = #{rlr}</if>
- <if test="rlTime != null ">and czrk.rl_time = #{rlTime}</if>
- <if test="yhzgx != null and yhzgx != ''">and czrk.yhzgx = #{yhzgx}</if>
- <if test="workUnit != null and workUnit != ''">and czrk.work_unit = #{workUnit}</if>
- <if test="provinceId != null and provinceId != ''">and czrk.province_id = #{provinceId}</if>
- <if test="provinceIdXjd != null and provinceIdXjd != ''">and jzdz.province_id = #{provinceId}</if>
- <if test="cityIdXjd != null and cityIdXjd != ''">and jzdz.city_id = #{cityIdXjd}</if>
- <if test="regionIdXjd != null and regionIdXjd != ''">and jzdz.region_id = #{regionIdXjd}</if>
- <if test="villageTownsIdXjd != null and villageTownsIdXjd != ''">and jzdz.town_id = #{villageTownsIdXjd}
- </if>
- <if test="villageIdXjd != null and villageIdXjd != ''">and jzdz.village_id = #{villageIdXjd}</if>
- <if test="province != null and province != ''">and czrk.province = #{province}</if>
- <if test="cityId != null and cityId != ''">and czrk.city_id = #{cityId}</if>
- <if test="city != null and city != ''">and czrk.city = #{city}</if>
- <if test="regionId != null and regionId != ''">and czrk.region_id = #{regionId}</if>
- <if test="region != null and region != ''">and czrk.region = #{region}</if>
- <if test="villageTownsId != null and villageTownsId != ''">and czrk.village_towns_id = #{villageTownsId}
- </if>
- <if test="villageTowns != null and villageTowns != ''">and czrk.village_towns = #{villageTowns}</if>
- <if test="villageId != null and villageId != ''">and czrk.village_id = #{villageId}</if>
- <if test="village != null and village != ''">and czrk.village = #{village}</if>
- <if test="villagerGroupId != null and villagerGroupId != ''">and czrk.villager_group_id =
- #{villagerGroupId}
- </if>
- <if test="villagerGroup != null and villagerGroup != ''">and czrk.villager_group = #{villagerGroup}</if>
- <if test="nowIn != null and nowIn != ''">and czrk.now_in = #{nowIn}</if>
- <if test="status != null and status != ''">and czrk.status = #{status}</if>
- <if test="isDel != null and isDel != ''">and czrk.is_del = #{isDel}</if>
- <if test="deleteReason != null and deleteReason != ''">and czrk.delete_reason = #{deleteReason}</if>
- <if test="gridId != null and gridId != ''">and czrk.grid_id = #{gridId}</if>
- <if test="deptIdList != null and deptIdList.size() > 0">
- and czrk.dept_id in
- <foreach item="deptId" collection="deptIdList" open="(" separator="," close=")">
- #{deptId}
- </foreach>
- </if>
- </where>
- GROUP BY czrk.id ORDER BY czrk.update_time DESC
- </select>
- <select id="listByXz" resultMap="CzrkResult">
- select vi.id, vi.create_time, vi.update_time, vi.is_del, vi.update_by, vi.user_name, vi.phone_num, vi.id_card
- , vi.gender, vi.province, vi.city, vi.region, vi.now_in, vi.house_type, vi.update_by, vi.code,vi.yhzgx
- from czrk vi
- where vi.status = '1' and is_del = 'N' and vi.update_time >= #{startTime} and vi.update_time <= #{endTime}
- <if test="userName != null and userName != ''">
- and vi.user_name like concat( #{userName}, '%')
- </if>
- <if test="villageTowns != null and villageTowns != ''">
- and vi.village_towns = #{villageTowns}
- </if>
- <if test="village != null and village != ''">and vi.village = #{village}</if>
- <if test="villagerGroup != null and villagerGroup != ''">and vi.villager_group = #{villagerGroup}</if>
- <if test="houseType != null and houseType != ''">and vi.house_type = #{houseType}</if>
- <if test="province != null and province != ''">and vi.province = #{province}</if>
- <if test="city != null and city != ''">and vi.city = #{city}</if>
- <if test="regionId != null and regionId != ''">and vi.region_id = #{regionId}</if>
- <if test="region != null and region != ''">and vi.region = #{region}</if>
- <if test="gender != null and gender != ''">and vi.gender = #{gender}</if>
- <if test="idCard != null and idCard != ''">and vi.id_card like concat(#{idCard}, '%')</if>
- <if test="phoneNum != null and phoneNum != ''">and vi.phone_num = #{phoneNum}</if>
- <!--<if test="params.startAge != null and params.startAge != ''"> and vi.age >= #{params.startAge}</if>
- <if test="params.endAge != null and params.endAge != ''"> and vi.age <= #{params.endAge}</if>-->
- <if test="status != null and status != ''">and vi.status = #{status}</if>
- <if test="code != null and code != ''">and vi.code = #{code}</if>
- <if test="birthday != null and birthday != ''">and vi.birthday = #{birthday}</if>
- <if test="workUnit != null and workUnit != ''">and vi.work_unit = #{workUnit}</if>
- <if test="nowIn != null and nowIn != ''">and vi.now_in = #{nowIn}</if>
- <if test="gridId != null and gridId != ''">and vi.grid_id = #{gridId}</if>
- </select>
- <select id="countByCzXz" resultType="int">
- select count(1)
- from czrk vi
- where vi.is_del = 'N' and vi.create_time >= #{startTime} and vi.create_time <= #{endTime}
- <choose>
- <when test="type == 1">and vi.province_id = #{areaId}</when>
- <when test="type == 2">and vi.city_id = #{areaId}</when>
- <when test="type == 3">and vi.region_id = #{areaId}</when>
- <when test="type == 4">and vi.village_towns_id = #{areaId}</when>
- <when test="type == 5">and vi.village_id = #{areaId}</when>
- </choose>
- </select>
- <select id="listByCzXz" resultMap="CzrkResult">
- select vi.id, vi.create_time
- from czrk vi
- where vi.is_del = 'N' and vi.create_time >= #{startTime} and vi.create_time <= #{endTime}
- <choose>
- <when test="type == 1">and vi.province_id = #{areaId}</when>
- <when test="type == 2">and vi.city_id = #{areaId}</when>
- <when test="type == 3">and vi.region_id = #{areaId}</when>
- <when test="type == 4">and vi.village_towns_id = #{areaId}</when>
- <when test="type == 5">and vi.village_id = #{areaId}</when>
- </choose>
- </select>
- <select id="listByJs" resultMap="CzrkResult">
- select vi.id, vi.create_time, vi.update_time, vi.is_del, vi.update_by, vi.user_name, vi.phone_num, vi.id_card
- , vi.gender, vi.province, vi.city, vi.region, vi.now_in, vi.house_type, vi.update_by, vi.code,vi.yhzgx
- from czrk vi
- where vi.status in ('2','3','4') and vi.update_time >= #{startTime} and vi.update_time <= #{endTime}
- <if test="userName != null and userName != ''">
- and vi.user_name like concat(#{userName}, '%')
- </if>
- <if test="villageTowns != null and villageTowns != ''">
- and vi.village_towns = #{villageTowns}
- </if>
- <if test="village != null and village != ''">and vi.village = #{village}</if>
- <if test="villagerGroup != null and villagerGroup != ''">and vi.villager_group = #{villagerGroup}</if>
- <if test="houseType != null and houseType != ''">and vi.house_type = #{houseType}</if>
- <if test="province != null and province != ''">and vi.province = #{province}</if>
- <if test="city != null and city != ''">and vi.city = #{city}</if>
- <if test="regionId != null and regionId != ''">and vi.region_id = #{regionId}</if>
- <if test="region != null and region != ''">and vi.region = #{region}</if>
- <if test="userName != null and userName != ''">and vi.user_name like concat(#{userName}, '%')</if>
- <if test="gender != null and gender != ''">and vi.gender = #{gender}</if>
- <if test="idCard != null and idCard != ''">and vi.id_card like concat(#{idCard}, '%')</if>
- <if test="phoneNum != null and phoneNum != ''">and vi.phone_num = #{phoneNum}</if>
- <!--<if test="params.startAge != null and params.startAge != ''"> and vi.age >= #{params.startAge}</if>
- <if test="params.endAge != null and params.endAge != ''"> and vi.age <= #{params.endAge}</if>-->
- <if test="status != null and status != ''">and vi.status = #{status}</if>
- <if test="code != null and code != ''">and vi.code = #{code}</if>
- <if test="birthday != null and birthday != ''">and vi.birthday = #{birthday}</if>
- <if test="workUnit != null and workUnit != ''">and vi.work_unit = #{workUnit}</if>
- <if test="nowIn != null and nowIn != ''">and vi.now_in = #{nowIn}</if>
- <if test="gridId != null and gridId != ''">and vi.grid_id = #{gridId}</if>
- </select>
- <select id="countByCzJs" resultType="int">
- select count(1)
- from czrk vi
- where vi.is_del = 'Y' and vi.update_time >= #{startTime} and vi.update_time <= #{endTime}
- <choose>
- <when test="type == 1">and vi.province_id = #{areaId}</when>
- <when test="type == 2">and vi.city_id = #{areaId}</when>
- <when test="type == 3">and vi.region_id = #{areaId}</when>
- <when test="type == 4">and vi.village_towns_id = #{areaId}</when>
- <when test="type == 5">and vi.village_id = #{areaId}</when>
- </choose>
- </select>
- <select id="listByCzJs" resultMap="CzrkResult">
- select vi.id, vi.update_time
- from czrk vi
- where vi.is_del = 'Y' and vi.update_time >= #{startTime} and vi.update_time <= #{endTime}
- <choose>
- <when test="type == 1">and vi.province_id = #{areaId}</when>
- <when test="type == 2">and vi.city_id = #{areaId}</when>
- <when test="type == 3">and vi.region_id = #{areaId}</when>
- <when test="type == 4">and vi.village_towns_id = #{areaId}</when>
- <when test="type == 5">and vi.village_id = #{areaId}</when>
- </choose>
- </select>
- <select id="listByCode" resultMap="CzrkResult">
- select vi.id, vi.user_name, vi.phone_num, vi.id_card, vi.gender, vi.province, vi.city,
- vi.region,vi.village_towns,vi.village,vi.villager_group, vi.now_in
- , vi.house_type, vi.update_by, vi.code, vi.rlr, vi.yhzgx
- from czrk vi
- <!--把户主放第一位-->
- where vi.is_del = 'N' and vi.code = #{code} and vi.status = '1' order by house_type desc
- </select>
- <select id="listByCodeSynchronization" resultMap="CzrkResult">
- select vi.id, vi.user_name, vi.phone_num, vi.id_card, vi.gender,
- vi.province_id,vi.province, vi.city_id, vi.city,vi.region_id, vi.region,
- vi.village_towns_id, vi.village_towns, vi.village_id, vi.village, vi.villager_group_id, vi.villager_group,
- vi.now_in, vi.code
- from czrk vi
- <!--把户主放第一位-->
- where vi.is_del = 'N' and vi.code = #{code} and vi.status = '1' order by house_type desc
- </select>
- <select id="countCzrk" resultType="int">
- select count(vi.id)
- from czrk vi
- where vi.is_del = 'N'
- <choose>
- <when test="type == 1">and vi.province_id = #{areaId}</when>
- <when test="type == 2">and vi.city_id = #{areaId}</when>
- <when test="type == 3">and vi.region_id = #{areaId}</when>
- <when test="type == 4">and vi.village_towns_id = #{areaId}</when>
- <when test="type == 5">and vi.village_id = #{areaId}</when>
- </choose>
- </select>
- <select id="countHj1" resultType="int">
- select count(vi.id)
- from czrk vi
- where vi.is_del = 'N'
- <if test="deptIdList != null and deptIdList.size() > 0">
- and vi.dept_id in
- <foreach item="deptId" collection="deptIdList" open="(" separator="," close=")">
- #{deptId}
- </foreach>
- </if>
- </select>
- <select id="countCz1" resultType="int">
- SELECT COUNT(DISTINCT(jzdz.id_card)) from czrk_jzdz jzdz
- where jzdz.status = 'Y'
- <if test="deptIdList != null and deptIdList.size() > 0">
- and jzdz.dept_id in
- <foreach item="deptId" collection="deptIdList" open="(" separator="," close=")">
- #{deptId}
- </foreach>
- </if>
- </select>
- <select id="countByCzXz1" resultType="int">
- SELECT COUNT(DISTINCT(jzdz.id_card)) from czrk_jzdz jzdz
- where jzdz.status = 'Y' and jzdz.create_time >= #{startTime} and jzdz.create_time <= #{endTime}
- <if test="deptIdList != null and deptIdList.size() > 0">
- and jzdz.dept_id in
- <foreach item="deptId" collection="deptIdList" open="(" separator="," close=")">
- #{deptId}
- </foreach>
- </if>
- </select>
- <select id="listByCzXz1" resultType="com.boman.domain.Czrk">
- SELECT ANY_VALUE(jzdz.id_card) idCard,
- ANY_VALUE(jzdz.create_time) createTime from czrk_jzdz jzdz
- where jzdz.status = 'Y' and jzdz.create_time >= #{startTime} and jzdz.create_time <= #{endTime}
- <if test="deptIdList != null and deptIdList.size() > 0">
- and jzdz.dept_id in
- <foreach item="deptId" collection="deptIdList" open="(" separator="," close=")">
- #{deptId}
- </foreach>
- </if>
- group by jzdz.id_card
- </select>
- <select id="countByCzJs1" resultType="int">
- SELECT count(DISTINCT(jzdz.id_card)) from czrk_jzdz jzdz
- where jzdz.status = 'N' and jzdz.create_time >= #{startTime} and jzdz.create_time <= #{endTime}
- <if test="deptIdList != null and deptIdList.size() > 0">
- and jzdz.dept_id in
- <foreach item="deptId" collection="deptIdList" open="(" separator="," close=")">
- #{deptId}
- </foreach>
- </if>
- </select>
- <select id="listByCzJs1" resultType="com.boman.domain.Czrk">
- SELECT ANY_VALUE(id_card) idCard,
- ANY_VALUE(update_time) updateTime from czrk_jzdz jzdz
- where jzdz.status = 'N' and jzdz.update_time >= #{startTime} and jzdz.update_time <= #{endTime}
- <if test="deptIdList != null and deptIdList.size() > 0">
- and jzdz.dept_id in
- <foreach item="deptId" collection="deptIdList" open="(" separator="," close=")">
- #{deptId}
- </foreach>
- </if>
- group by jzdz.id_card
- </select>
- <select id="countByHjXz1" resultType="int">
- select count(vi.id)
- from czrk vi
- where vi.is_del = 'N' and vi.create_time >= #{startTime} and vi.create_time <= #{endTime}
- <if test="deptIdList != null and deptIdList.size() > 0">
- and vi.dept_id in
- <foreach item="deptId" collection="deptIdList" open="(" separator="," close=")">
- #{deptId}
- </foreach>
- </if>
- </select>
- <select id="listByHjXz1" resultMap="CzrkResult">
- select create_time
- from czrk vi
- where vi.is_del = 'N' and vi.create_time >= #{startTime} and vi.create_time <= #{endTime}
- <if test="deptIdList != null and deptIdList.size() > 0">
- and vi.dept_id in
- <foreach item="deptId" collection="deptIdList" open="(" separator="," close=")">
- #{deptId}
- </foreach>
- </if>
- </select>
- <select id="countByHjJs1" resultType="int">
- select count(vi.id)
- from czrk vi
- where vi.is_del = 'Y' and vi.update_time >= #{startTime} and vi.update_time <= #{endTime}
- <if test="deptIdList != null and deptIdList.size() > 0">
- and vi.dept_id in
- <foreach item="deptId" collection="deptIdList" open="(" separator="," close=")">
- #{deptId}
- </foreach>
- </if>
- </select>
- <select id="listByHjJs1" resultMap="CzrkResult">
- select vi.update_time
- from czrk vi
- where vi.is_del = 'Y' and vi.update_time >= #{startTime} and vi.update_time <= #{endTime}
- <if test="deptIdList != null and deptIdList.size() > 0">
- and vi.dept_id in
- <foreach item="deptId" collection="deptIdList" open="(" separator="," close=")">
- #{deptId}
- </foreach>
- </if>
- </select>
- <select id="selectCzrkById" parameterType="Long" resultMap="CzrkResult">
- <include refid="selectCzrkVo"/>
- where id = #{id} and is_del = 'N' limit 1
- </select>
- <select id="selectCzrkByIds" parameterType="list" resultMap="CzrkResult">
- <include refid="selectCzrkVo"/>
- <if test="ids != null and ids.size() > 0">
- where id in
- <foreach item="id" collection="ids" open="(" separator="," close=")">
- #{id}
- </foreach>
- </if>
- </select>
- <select id="countIdCard" resultType="int">
- select count(vi.id) from czrk vi where vi.is_del = 'N' and id_card = #{idCard}
- </select>
- <select id="stsByYrl" resultType="int">
- select count(1)
- from czrk c left join czrk_jzdz z on c.id =z.czrk_id
- <where>
- c.is_del = 'N'
- and c.status = '1'
- and c.is_rl = '是'
- <if test="userName != null and userName != ''">
- and c.user_name like concat(#{userName}, '%')
- </if>
- <if test="params.startAge != null and params.startAge != ''">and c.age >= #{params.startAge}</if>
- <if test="params.endAge != null and params.endAge != ''">and c.age <= #{params.endAge}</if>
- <if test="idCard != null and idCard != ''">and c.id_card = #{idCard}</if>
- <if test="phoneNum != null and phoneNum != ''">and c.phone_num = #{phoneNum}</if>
- <if test="isConfirm != null and isConfirm != ''">and c.is_confirm = #{isConfirm}</if>
- <if test="houseType != null and houseType != ''">and c.house_type = #{houseType}</if>
- <if test="provinceId != null and provinceId != ''">and c.province_id = #{provinceId}</if>
- <if test="cityId != null and cityId != ''">and c.city_id = #{cityId}</if>
- <if test="regionId != null and regionId != ''">and c.region_id = #{regionId}</if>
- <if test="villageTownsId != null and villageTownsId != ''">and c.village_towns_id = #{villageTownsId}</if>
- <if test="villageId != null and villageId != ''">and c.village_id = #{villageId}</if>
- <if test="isConfirm != null and isConfirm != ''">and c.is_confirm = #{isConfirm}</if>
- <if test="provinceIdXjd != null and provinceIdXjd != ''">and z.province_id = #{provinceIdXjd}</if>
- <if test="cityIdXjd != null and cityIdXjd != ''">and z.city_id = #{cityIdXjd}</if>
- <if test="regionIdXjd != null and regionIdXjd != ''">and z.region_id = #{regionIdXjd}</if>
- <if test="villageTownsIdXjd != null and villageTownsIdXjd != ''">and z.town_id = #{villageTownsIdXjd}</if>
- <if test="villageIdXjd != null and villageIdXjd != ''">and z.village_id = #{villageIdXjd}</if>
- </where>
- </select>
- <select id="listIsRl" resultMap="CzrkResult">
- SELECT id, is_rl
- from czrk
- where is_del = 'N'
- <if test="idCard != null and idCard != ''">
- and id_card like concat(#{idCard}, '%')
- </if>
- <choose>
- <when test="type == 1">and province_id = #{areaId}</when>
- <when test="type == 2">and city_id = #{areaId}</when>
- <when test="type == 3">and region_id = #{areaId}</when>
- <when test="type == 4">and village_towns_id = #{areaId}</when>
- <when test="type == 5">and village_id = #{areaId}</when>
- </choose>
- </select>
- <select id="getHzByCode" resultMap="CzrkResult">
- SELECT user_name, id_card
- from czrk
- where house_type = '是' and code = #{code} and is_del = 'N' limit 1;
- </select>
- <select id="getColumnNamesByIdCard" resultType="com.alibaba.fastjson.JSONObject">
- SELECT id, ${columnNames}
- from czrk
- where id_card = #{idCard} limit 1;
- </select>
- <select id="stsByWrl" resultType="int">
- select count(1)
- from czrk c left join czrk_jzdz z on c.id = z.czrk_id
- <where>
- c.is_del = 'N'
- and c.is_rl = '否'
- and c.status = '1'
- <if test="userName != null and userName != ''">
- and c.user_name like concat(#{userName}, '%')
- </if>
- <if test="params.startAge != null and params.startAge != ''">and c.age >= #{params.startAge}</if>
- <if test="params.endAge != null and params.endAge != ''">and c.age <= #{params.endAge}</if>
- <if test="idCard != null and idCard != ''">and c.id_card = #{idCard}</if>
- <if test="phoneNum != null and phoneNum != ''">and c.phone_num = #{phoneNum}</if>
- <if test="isConfirm != null and isConfirm != ''">and c.is_confirm = #{isConfirm}</if>
- <if test="provinceId != null and provinceId != ''">and c.province_id = #{provinceId}</if>
- <if test="cityId != null and cityId != ''">and c.city_id = #{cityId}</if>
- <if test="regionId != null and regionId != ''">and c.region_id = #{regionId}</if>
- <if test="villageTownsId != null and villageTownsId != ''">and c.village_towns_id = #{villageTownsId}</if>
- <if test="villageId != null and villageId != ''">and c.village_id = #{villageId}</if>
- <if test="provinceIdXjd != null and provinceIdXjd != ''">and z.province_id = #{provinceIdXjd}</if>
- <if test="cityIdXjd != null and cityIdXjd != ''">and z.city_id = #{cityIdXjd}</if>
- <if test="regionIdXjd != null and regionIdXjd != ''">and z.region_id = #{regionIdXjd}</if>
- <if test="villageTownsIdXjd != null and villageTownsIdXjd != ''">and z.town_id = #{villageTownsIdXjd}</if>
- <if test="villageIdXjd != null and villageIdXjd != ''">and z.village_id = #{villageIdXjd}</if>
- </where>
- </select>
- <select id="stsByAll" resultType="int">
- select count(1)
- from czrk c left join czrk_jzdz z on c.id =z.czrk_id
- <where>
- c.is_del = 'N'
- and c.status = '1'
- <if test="isRl != null and isRl != ''">and c.is_rl = #{isRl}</if>
- <if test="userName != null and userName != ''">
- and c.user_name like concat(#{userName}, '%')
- </if>
- <if test="params.startAge != null and params.startAge != ''">and c.age >= #{params.startAge}</if>
- <if test="params.endAge != null and params.endAge != ''">and c.age <= #{params.endAge}</if>
- <if test="idCard != null and idCard != ''">and c.id_card = #{idCard}</if>
- <if test="phoneNum != null and phoneNum != ''">and c.phone_num = #{phoneNum}</if>
- <if test="isConfirm != null and isConfirm != ''">and c.is_confirm = #{isConfirm}</if>
- <if test="houseType != null and houseType != ''">and c.house_type = #{houseType}</if>
- <if test="provinceId != null and provinceId != ''">and c.province_id = #{provinceId}</if>
- <if test="cityId != null and cityId != ''">and c.city_id = #{cityId}</if>
- <if test="regionId != null and regionId != ''">and c.region_id = #{regionId}</if>
- <if test="villageTownsId != null and villageTownsId != ''">and c.village_towns_id = #{villageTownsId}</if>
- <if test="villageId != null and villageId != ''">and c.village_id = #{villageId}</if>
- <if test="isConfirm != null and isConfirm != ''">and c.is_confirm = #{isConfirm}</if>
- <if test="provinceIdXjd != null and provinceIdXjd != ''">and z.province_id = #{provinceIdXjd}</if>
- <if test="cityIdXjd != null and cityIdXjd != ''">and z.city_id = #{cityIdXjd}</if>
- <if test="regionIdXjd != null and regionIdXjd != ''">and z.region_id = #{regionIdXjd}</if>
- <if test="villageTownsIdXjd != null and villageTownsIdXjd != ''">and z.town_id = #{villageTownsIdXjd}</if>
- <if test="villageIdXjd != null and villageIdXjd != ''">and z.village_id = #{villageIdXjd}</if>
- </where>
- </select>
- <insert id="insertCzrk" useGeneratedKeys="true" keyProperty="id">
- insert into czrk
- <trim prefix="(" suffix=")" suffixOverrides=",">
- <if test="userName != null">user_name,</if>
- <if test="gender != null">gender,</if>
- <if test="age != null">age,</if>
- <if test="birthday != null">birthday,</if>
- <if test="deptId != null">dept_id,</if>
- <if test="idCard != null">id_card,</if>
- <if test="phoneNum != null">phone_num,</if>
- <if test="code != null">code,</if>
- <if test="keyIndustries != null">key_Industries,</if>
- <if test="houseType != null">house_type,</if>
- <if test="rlr != null">rlr,</if>
- <if test="isRl != null">is_rl,</if>
- <if test="rlTime != null">rl_time,</if>
- <if test="yhzgx != null">yhzgx,</if>
- <if test="workUnit != null">work_unit,</if>
- <if test="provinceId != null">province_id,</if>
- <if test="province != null">province,</if>
- <if test="cityId != null">city_id,</if>
- <if test="city != null">city,</if>
- <if test="regionId != null">region_id,</if>
- <if test="region != null">region,</if>
- <if test="villageTownsId != null">village_towns_id,</if>
- <if test="villageTowns != null">village_towns,</if>
- <if test="villageId != null">village_id,</if>
- <if test="village != null">village,</if>
- <if test="villagerGroupId != null">villager_group_id,</if>
- <if test="villagerGroup != null">villager_group,</if>
- <if test="nowIn != null">now_in,</if>
- <if test="remark != null">remark,</if>
- <if test="gridId != null">grid_id,</if>
- <if test="status != null">status,</if>
- <if test="isConfirm != null">is_confirm,</if>
- <if test="confirmInfoUser != null and confirmInfoUser != ''">confirm_info_user,</if>
- <if test="confirmInfoUserTime != null ">confirm_info_user_time,</if>
- <if test="createBy != null">create_by,</if>
- <if test="updateBy != null">update_by,</if>
- <if test="isDel != null and isDel != ''">is_del,</if>
- <if test="deleteReason != null">delete_reason,</if>
- create_time, update_time
- </trim>
- <trim prefix="values (" suffix=")" suffixOverrides=",">
- <if test="userName != null">#{userName},</if>
- <if test="gender != null">#{gender},</if>
- <if test="age != null">#{age},</if>
- <if test="birthday != null">#{birthday},</if>
- <if test="deptId != null">#{deptId},</if>
- <if test="idCard != null">#{idCard},</if>
- <if test="phoneNum != null">#{phoneNum},</if>
- <if test="code != null">#{code},</if>
- <if test="keyIndustries != null">#{keyIndustries},</if>
- <if test="houseType != null">#{houseType},</if>
- <if test="rlr != null">#{rlr},</if>
- <if test="isRl != null">#{isRl},</if>
- <if test="rlTime != null">#{rlTime},</if>
- <if test="yhzgx != null">#{yhzgx},</if>
- <if test="workUnit != null">#{workUnit},</if>
- <if test="provinceId != null">#{provinceId},</if>
- <if test="province != null">#{province},</if>
- <if test="cityId != null">#{cityId},</if>
- <if test="city != null">#{city},</if>
- <if test="regionId != null">#{regionId},</if>
- <if test="region != null">#{region},</if>
- <if test="villageTownsId != null">#{villageTownsId},</if>
- <if test="villageTowns != null">#{villageTowns},</if>
- <if test="villageId != null">#{villageId},</if>
- <if test="village != null">#{village},</if>
- <if test="villagerGroupId != null">#{villagerGroupId},</if>
- <if test="villagerGroup != null">#{villagerGroup},</if>
- <if test="nowIn != null">#{nowIn},</if>
- <if test="remark != null">#{remark},</if>
- <if test="gridId != null">#{gridId},</if>
- <if test="status != null">#{status},</if>
- <if test="isConfirm != null">#{isConfirm},</if>
- <if test="confirmInfoUser != null and confirmInfoUser != ''">#{confirmInfoUser},</if>
- <if test="confirmInfoUserTime != null ">#{confirmInfoUserTime},</if>
- <if test="createBy != null">#{createBy},</if>
- <if test="updateBy != null">#{updateBy},</if>
- <if test="isDel != null and isDel != ''">#{isDel},</if>
- <if test="deleteReason != null">#{deleteReason},</if>
- sysdate(), sysdate()
- </trim>
- </insert>
- <update id="updateCzrk">
- update czrk
- <trim prefix="SET" suffixOverrides=",">
- <if test="userName != null">user_name = #{userName},</if>
- <if test="gender != null">gender = #{gender},</if>
- <if test="age != null">age = #{age},</if>
- <if test="birthday != null">birthday = #{birthday},</if>
- <if test="idCard != null">id_card = #{idCard},</if>
- <if test="phoneNum != null">phone_num = #{phoneNum},</if>
- <if test="code != null">code = #{code},</if>
- <if test="keyIndustries != null">key_industries = #{keyIndustries},</if>
- <if test="houseType != null">house_type = #{houseType},</if>
- <if test="rlr != null">rlr = #{rlr},</if>
- <if test="rlrNike != null">rlr_nike = #{rlrNike},</if>
- <if test="isRl != null">is_rl = #{isRl},</if>
- <if test="rlTime != null">rl_time = #{rlTime},</if>
- <if test="yhzgx != null">yhzgx = #{yhzgx},</if>
- <if test="workUnit != null">work_unit = #{workUnit},</if>
- <if test="provinceId != ''">province_id = #{provinceId},</if>
- <if test="province != ''">province = #{province},</if>
- <if test="cityId != ''">city_id = #{cityId},</if>
- <if test="city != ''">city = #{city},</if>
- <if test="regionId != ''">region_id = #{regionId},</if>
- <if test="region != ''">region = #{region},</if>
- <if test="villageTownsId != ''">village_towns_id = #{villageTownsId},</if>
- <if test="villageTowns != ''">village_towns = #{villageTowns},</if>
- <if test="villageId != ''">village_id = #{villageId},</if>
- <if test="village != ''">village = #{village},</if>
- <if test="villagerGroupId != ''">villager_group_id = #{villagerGroupId},</if>
- <if test="villagerGroup != ''">villager_group = #{villagerGroup},</if>
- <if test="nowIn != null">now_in = #{nowIn},</if>
- <if test="remark != null">remark = #{remark},</if>
- <if test="gridId != null">grid_id = #{gridId},</if>
- <if test="changUser != null">chang_user = #{changUser},</if>
- <if test="changNikeUser != null">chang_nike_user = #{changNikeUser},</if>
- <if test="status != null">status = #{status},</if>
- <if test="isConfirm != null">is_confirm = #{isConfirm},</if>
- <if test="confirmInfoUser != null ">confirm_info_user = #{confirmInfoUser},</if>
- <if test="confirmInfoNikeUser != null">confirm_info_nike_user =
- #{confirmInfoNikeUser},
- </if>
- <if test="confirmInfoUserTime != null ">confirm_info_user_time = #{confirmInfoUserTime},</if>
- <if test="createBy != null">create_by = #{createBy},</if>
- <if test="createTime != null">create_time = #{createTime},</if>
- <if test="updateBy != null">update_by = #{updateBy},</if>
- <if test="isDel != null and isDel != ''">is_del = #{isDel},</if>
- <if test="deleteReason != null">delete_reason = #{deleteReason},</if>
- update_time = sysdate(),
- chang_user_time = #{changUserTime}
- </trim>
- where id = #{id}
- </update>
- <update id="updateCzrkByNucleicAcid">
- update czrk
- set is_nucleicAcid = 'Y',nucleicAcid_time = #{nucleicAcidTime}
- where id_card = #{idCard}
- </update>
- <delete id="deleteCzrkById" parameterType="Long">
- delete from czrk where id = #{id}
- </delete>
- <update id="reduction">
- update czrk
- set is_del = 'N'
- , update_by = #{updateBy}
- , update_time = sysdate()
- ,delete_reason = ''
- where id = #{id}
- </update>
- <!-- <delete id="deleteCzrk" parameterType="String">-->
- <!-- delete from czrk where id in -->
- <!-- <foreach item="id" collection="array" open="(" separator="," close=")">-->
- <!-- #{id}-->
- <!-- </foreach>-->
- <!-- </delete>-->
- <update id="deleteCzrk">
- update czrk
- set is_del = 'Y'
- , delete_reason = #{deleteReason}
- , update_by = #{updateBy}
- , update_time = sysdate()
- where id = #{id}
- </update>
- <update id="updateHouseholdRegister">
- update czrk
- set province_id = #{czrk.provinceId},
- province = #{czrk.province},
- city_id = #{czrk.cityId},
- city = #{czrk.city},
- region_id = #{czrk.regionId},
- region = #{czrk.region},
- village_towns_id = #{czrk.villageTownsId},
- village_towns = #{czrk.villageTowns},
- village_id = #{czrk.villageId},
- village = #{czrk.village},
- villager_group_id = #{czrk.villagerGroupId},
- villager_group = #{czrk.villagerGroup},
- now_in = #{czrk.nowIn}
- where is_del = 'N' and code = #{czrk.code};
- </update>
- <select id="findHjInfo" resultMap="CzrkResult">
- select c.id, c.user_name ,c.gender,
- c.birthday,c.age,c.code,c.phone_num,c.key_industries,c.province_id,c.province,c.city_id,c.city,c.region_id,c.region,c.village_towns_id,c.village_towns,c.village_id,c.village,c.villager_group_id,c.villager_group,
- c.now_in,c.house_type,c.code,c.yhzgx,c.remark,
- cj.province_id as province_id_jzdz,cj.province as province_jzdz,cj.city_id as city_id_jzdz,cj.city as
- city_jzdz,cj.region_id as region_id_jzdz,cj.region as region_jzdz,cj.town_id as town_id_jzdz,cj.town as
- town_jzdz,cj.village_id as village_id_jzdz,cj.village as village_jzdz,cj.now_in as now_in_jzdz
- from czrk c left join czrk_jzdz cj on c.id_card = cj.id_card
- <where>
- c.is_del = 'N'
- and cj.status = 'Y'
- <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' and jzdz.status = 'Y'
- <if test="idCard != null and idCard != ''">
- and czrk.id_card = #{idCard}
- </if>
- <if test="houseType != null and houseType != ''">
- and czrk.house_type = #{houseType}
- </if>
- <if test="isConfirm != null and isConfirm != ''">
- and czrk.is_confirm = #{isConfirm}
- </if>
- <if test="userName != null and userName != ''">
- and czrk.user_name 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.town_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>
- <select id="countByHjXz" resultType="int">
- SELECT COUNT(DISTINCT(jzdz.id_card)) from czrk_jzdz jzdz
- where jzdz.status = 'Y' and jzdz.create_time >= #{startTime} and jzdz.create_time <= #{endTime}
- <!--SELECT czrk.id, czrk.create_time
- 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.town_id = #{areaId}</when>
- <when test="type == 5">and jzdz.village_id = #{areaId}</when>
- </choose>
- <!--GROUP BY czrk.id-->
- </select>
- <select id="listByHjXz" resultMap="CzrkResult">
- SELECT czrk.id, czrk.create_time
- where czrk.is_del = 'N' and czrk.create_time >= #{startTime} and czrk.create_time <= #{endTime}
- <!-- <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.town_id = #{areaId}</when>
- <when test="type == 5">and jzdz.village_id = #{areaId}</when>
- </choose>
- GROUP BY czrk.id
- </select>
- <select id="countByHjJs" resultType="int">
- SELECT COUNT(DISTINCT(jzdz.id_card)) from czrk_jzdz jzdz
- where jzdz.status = 'N' and jzdz.update_time >= #{startTime} and jzdz.update_time <= #{endTime}
- <!-- SELECT czrk.id, czrk.update_time
- from czrk
- left join czrk_jzdz jzdz on czrk.id = jzdz.czrk_id
- where czrk.is_del = 'Y' and czrk.update_time >= #{startTime} and czrk.update_time <= #{endTime}
- <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.town_id = #{areaId}</when>
- <when test="type == 5">and jzdz.village_id = #{areaId}</when>
- </choose>
- <!--GROUP BY czrk.id-->
- </select>
- <select id="listByHjJs" resultMap="CzrkResult">
- SELECT czrk.id, czrk.update_time
- from czrk
- left join czrk_jzdz jzdz on czrk.id = jzdz.czrk_id
- where czrk.is_del = 'Y' and czrk.update_time >= #{startTime} and czrk.update_time <= #{endTime}
- <!-- <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.town_id = #{areaId}</when>
- <when test="type == 5">and jzdz.village_id = #{areaId}</when>
- </choose>
- GROUP BY czrk.id
- </select>
- <select id="countHj" resultType="int">
- SELECT COUNT(DISTINCT(jzdz.id_card)) from czrk_jzdz jzdz where jzdz.status = 'Y'
- <!-- SELECT czrk.id
- 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.town_id = #{areaId}</when>
- <when test="type == 5">and jzdz.village_id = #{areaId}</when>
- </choose>
- <!--GROUP BY czrk.id-->
- </select>
- <select id="countAll" resultType="int">
- select count(1) from czrk where is_del = 'N';
- </select>
- <select id="selectCzrkListByPage" parameterType="Integer" resultMap="CzrkResult">
- select * from czrk where village_id = '' and village_towns_id != '' and dept_id != 1 limit #{startNum}, #{endNum}
- </select>
- <select id="selectDeptNameById" parameterType="Long" resultMap="SysDeptResult">
- select * from sys_dept where id = #{id} limit 1;
- </select>
- <update id="confirmInfoByIds">
- update czrk
- <trim prefix="SET" suffixOverrides=",">
- is_confirm = 'Y',
- <if test="userName != null and userName !=''">confirm_info_user = #{userName},</if>
- confirm_info_user_time = sysdate()
- </trim>
- where id in
- <foreach collection="ids" item="id" open="(" separator="," close=")">
- #{id}
- </foreach>
- </update>
- <insert id="insertConfirmInfoUser" useGeneratedKeys="true" keyProperty="id">
- insert into confim_info_user
- <trim prefix="(" suffix=")" suffixOverrides=",">
- <if test="confirmInfoUser != null">confirm_info_user,</if>
- <if test="confirmInfoNikeUser != null">confirm_info_nike_user,</if>
- <if test="czrkId != null">czrk_id,</if>
- create_time
- </trim>
- <trim prefix="values (" suffix=")" suffixOverrides=",">
- <if test="confirmInfoUser != null">#{confirmInfoUser},</if>
- <if test="confirmInfoNikeUser != null">#{confirmInfoNikeUser},</if>
- <if test="czrkId != null">#{czrkId},</if>
- sysdate()
- </trim>
- </insert>
- <select id="selectCzrkByCode" resultType="java.lang.Integer" resultMap="CzrkResult">
- select id_card from czrk where is_del = 'N' and code = #{code} and house_type = '是' limit 1
- </select>
- <update id="changeCzrk" parameterType="com.boman.domain.Czrk">
- update czrk
- set status = #{status},
- chang_user = #{changUser},
- house_type = #{houseType},
- chang_nike_user = #{changNikeUser},
- chang_user_time = sysdate(),
- update_time = sysdate()
- where id = #{id};
- </update>
- <select id="selectCzrkByIdCard" resultType="java.lang.String" resultMap="CzrkResult">
- <include refid="selectCzrkVo"/>
- where is_del = 'N' and id_card = #{idCard} limit 1
- </select>
- <select id="selectLost" resultMap="CzrkResult">
- <include refid="selectCzrkVo"/>
- where is_confirm = 'Y' and (village_towns is null or village_towns = '') and is_del ='N'
- </select>
- <select id="unusualList" resultMap="CzrkResult">
- select id, user_name, phone_num,dept_id, id_card, province, city, region, village_towns, village,
- villager_group,status, house_type,chang_user,chang_nike_user,chang_user_time from czrk
- <where>
- <if test="userName != null and userName != ''">
- and user_name like concat(#{userName}, '%')
- </if>
- <if test="params.startAge != null and params.startAge != ''">and age >= #{params.startAge}</if>
- <if test="params.endAge != null and params.endAge != ''">and age <= #{params.endAge}</if>
- <if test="status != null and status != ''">and status = #{status}</if>
- <if test="age != null ">and age = #{age}</if>
- <if test="idCard != null and idCard != ''">and id_card = #{idCard}</if>
- <if test="phoneNum != null and phoneNum != ''">and phone_num = #{phoneNum}</if>
- <if test="provinceId != null and provinceId != ''">and province_id = #{provinceId}</if>
- <if test="province != null and province != ''">and province = #{province}</if>
- <if test="cityId != null and cityId != ''">and city_id = #{cityId}</if>
- <if test="city != null and city != ''">and city = #{city}</if>
- <if test="regionId != null and regionId != ''">and region_id = #{regionId}</if>
- <if test="region != null and region != ''">and region = #{region}</if>
- <if test="villageTownsId != null and villageTownsId != ''">and village_towns_id = #{villageTownsId}</if>
- <if test="villageTowns != null and villageTowns != ''">and village_towns = #{villageTowns}</if>
- <if test="villageId != null and villageId != ''">and village_id = #{villageId}</if>
- <if test="village != null and village != ''">and village = #{village}</if>
- <if test="isConfirm != null and isConfirm != ''">and is_confirm = #{isConfirm}</if>
- <if test="isDel != null and isDel != ''">and is_del = #{isDel}</if>
- </where>
- order by chang_user_time DESC
- </select>
- <select id="selectCzrkListByDeptId" resultMap="CzrkResult">
- select id, dept_id, create_time, is_del from czrk
- where 1=1
- <if test="deptIdList != null and deptIdList.size() > 0">
- and dept_id in
- <foreach item="deptId" collection="deptIdList" open="(" separator="," close=")">
- #{deptId}
- </foreach>
- </if>
- </select>
- <select id="getAllCzrkRegionId" resultMap="CzrkResult">
- select id, dept_id, region_id, region, village_towns_id, village_towns
- , village_id, village, create_time, update_time, is_del,status from czrk
- where region_id = #{regionId} and is_del = 'N';
- </select>
- <select id="getAllCzrk" resultMap="CzrkResult">
- select
- ANY_VALUE(c.user_name) as user_name,
- ANY_VALUE(c.age) as age,
- <!--ANY_VALUE(STUFF (c.id_card, 7, 8, '********')) AS id_card,-->
- ANY_VALUE(c.id_card) AS id_card,
- ANY_VALUE(c.province) as province,
- ANY_VALUE(c.city) as city,
- ANY_VALUE(c.region) as region,
- ANY_VALUE(c.village_towns) as village_towns,
- ANY_VALUE(c.village) as village,
- ANY_VALUE(c.villager_group) as villager_group,
- ANY_VALUE(REPLACE (c.now_in, '/', '')) AS now_in,
- ANY_VALUE(c.key_industries) as key_industries,
- ANY_VALUE(c.gender) as gender,
- ANY_VALUE(c.phone_num) as phone_num,
- ANY_VALUE(c.CODE) as CODE,
- ANY_VALUE(c.house_type) as house_type,
- ANY_VALUE(c.yhzgx) as yhzgx,
- ANY_VALUE(cj.province) AS provinceXjd,
- ANY_VALUE(cj.city) AS cityXjd,
- ANY_VALUE(cj.region) AS regionXjd,
- ANY_VALUE(cj.town) AS villageTownsXjd,
- ANY_VALUE(cj.village) AS villageXjd,
- ANY_VALUE(REPLACE (cj.now_in, '/', '')) AS nowXjd
- from czrk c
- left join czrk_jzdz cj on c.id =cj.czrk_id
- <where>
- c.is_del = 'N'
- and c.status = '1'
- <!-- 已认领 -->
- <if test="isRl != null and isRl != ''">and c.is_rl = #{isRl}</if>
- <if test="userName != null and userName != ''">
- and c.user_name like concat(#{userName}, '%')
- </if>
- <if test="params.startAge != null and params.startAge != ''">and c.age >= #{params.startAge}</if>
- <if test="params.endAge != null and params.endAge != ''">and c.age <= #{params.endAge}</if>
- <if test="gender != null and gender != ''">and c.gender = #{gender}</if>
- <if test="birthday != null ">and c.birthday = #{birthday}</if>
- <if test="idCard != null and idCard != ''">and c.id_card = #{idCard}</if>
- <if test="phoneNum != null and phoneNum != ''">and c.phone_num = #{phoneNum}</if>
- <if test="code != null and code != ''">and c.code = #{code}</if>
- <if test="houseType != null and houseType != ''">and c.house_type = #{houseType}</if>
- <if test="rlr != null and rlr != ''">and c.rlr = #{rlr}</if>
- <if test="rlTime != null ">and c.rl_time = #{rlTime}</if>
- <if test="yhzgx != null and yhzgx != ''">and c.yhzgx = #{yhzgx}</if>
- <if test="workUnit != null and workUnit != ''">and c.work_unit = #{workUnit}</if>
- <if test="provinceId != null and provinceId != ''">and c.province_id = #{provinceId}</if>
- <if test="province != null and province != ''">and c.province = #{province}</if>
- <if test="cityId != null and cityId != ''">and c.city_id = #{cityId}</if>
- <if test="city != null and city != ''">and c.city = #{city}</if>
- <if test="regionId != null and regionId != ''">and c.region_id = #{regionId}</if>
- <if test="region != null and region != ''">and c.region = #{region}</if>
- <if test="villageTownsId != null and villageTownsId != ''">and c.village_towns_id = #{villageTownsId}</if>
- <if test="villageTowns != null and villageTowns != ''">and c.village_towns = #{villageTowns}</if>
- <if test="villageId != null and villageId != ''">and c.village_id = #{villageId}</if>
- <if test="village != null and village != ''">and c.village = #{village}</if>
- <!-- <if test="villagerGroupId != null and villagerGroupId != ''"> and villager_group_id = #{villagerGroupId}</if>
- <if test="villagerGroup != null and villagerGroup != ''"> and villager_group = #{villagerGroup}</if>-->
- <if test="nowIn != null and nowIn != ''">and c.now_in = #{nowIn}</if>
- <if test="isConfirm != null and isConfirm != ''">and c.is_confirm = #{isConfirm}</if>
- <if test="deleteReason != null and deleteReason != ''">and c.delete_reason = #{deleteReason}</if>
- <if test="gridId != null and gridId != ''">and c.grid_id = #{gridId}</if>
- <if test="deptIdList != null and deptIdList.size() > 0">
- and c.dept_id in
- <foreach item="deptId" collection="deptIdList" open="(" separator="," close=")">
- #{deptId}
- </foreach>
- </if>
- <if test="idCardList != null and idCardList.size() > 0">
- and c.id_card in
- <foreach item="idCard" collection="idCardList" open="(" separator="," close=")">
- #{idCard}
- </foreach>
- </if>
- <if test="provinceIdXjd != null">and cj.province_id = #{provinceIdXjd}</if>
- <if test="cityIdXjd != null">and cj.city_id = #{cityIdXjd}</if>
- <if test="regionIdXjd != null">and cj.region_id = #{regionIdXjd}</if>
- <if test="villageTownsIdXjd != null">and cj.town_id = #{villageTownsIdXjd}</if>
- <if test="villageIdXjd != null">and cj.village_id = #{villageIdXjd}</if>
- </where>
- order by c.code ,c.house_type desc,c.id_card;
- </select>
- <select id="listByCzrkJzdz" resultMap="CzrkResult">
- select c.id, c.user_name, c.phone_num,c.dept_id, c.id_card,
- z.province as provinceXjd, z.city as cityXjd,z.region as regionXjd, z.town as villageTownsXjd, z.village as
- villageXjd,z.now_in,
- c.gender, c.grid_id, c.house_type, c.update_by, c.code, c.rlr,c.rlr_nike,
- c.is_confirm,c.confirm_info_user,c.confirm_info_nike_user,c.confirm_info_user_time
- from czrk c left join czrk_jzdz z on c.id =z.czrk_id
- <where>
- c.is_del = 'N'
- and c.status = '1'
- <if test="isRl != null and isRl != ''">and c.is_rl = #{isRl}</if>
- <if test="userName != null and userName != ''">
- and c.user_name like concat(#{userName}, '%')
- </if>
- <if test="params.startAge != null and params.startAge != ''">and c.age >= #{params.startAge}</if>
- <if test="params.endAge != null and params.endAge != ''">and c.age <= #{params.endAge}</if>
- <if test="idCard != null and idCard != ''">and c.id_card = #{idCard}</if>
- <if test="phoneNum != null and phoneNum != ''">and c.phone_num = #{phoneNum}</if>
- <if test="houseType != null and houseType != ''">and c.house_type = #{houseType}</if>
- <if test="provinceId != null and provinceId != ''">and c.province_id = #{provinceId}</if>
- <if test="cityId != null and cityId != ''">and c.city_id = #{cityId}</if>
- <if test="regionId != null and regionId != ''">and c.region_id = #{regionId}</if>
- <if test="villageTownsId != null and villageTownsId != ''">and c.village_towns_id = #{villageTownsId}</if>
- <if test="villageId != null and villageId != ''">and c.village_id = #{villageId}</if>
- <if test="isConfirm != null and isConfirm != ''">and c.is_confirm = #{isConfirm}</if>
- <if test="provinceIdXjd != null and provinceIdXjd != ''">and z.province_id = #{provinceIdXjd}</if>
- <if test="cityIdXjd != null and cityIdXjd != ''">and z.city_id = #{cityIdXjd}</if>
- <if test="regionIdXjd != null and regionIdXjd != ''">and z.region_id = #{regionIdXjd}</if>
- <if test="villageTownsIdXjd != null and villageTownsIdXjd != ''">and z.town_id = #{villageTownsIdXjd}</if>
- <if test="villageIdXjd != null and villageIdXjd != ''">and z.village_id = #{villageIdXjd}</if>
- </where>
- order by c.create_time DESC
- </select>
- <select id="selectCzrkByNotRl" resultMap="CzrkResult">
- select c.id, c.user_name, c.phone_num,c.dept_id, c.id_card, c.gender, c.province, c.city, c.region,
- c.village_towns, c.village, c.villager_group, c.grid_id
- , c.house_type, c.update_by, c.code, c.rlr,c.rlr_nike, c.update_time, c.delete_reason,
- c.now_in,c.is_confirm,c.confirm_info_user,c.confirm_info_nike_user,c.confirm_info_user_time
- from czrk c
- <where>
- c.is_del = 'N'
- and c.is_rl = '否'
- and c.is_confirm = 'N'
- and c.status in ('1','2')
- <if test="userName != null and userName != ''">
- and c.user_name like concat(#{userName}, '%')
- </if>
- <if test="params.startAge != null and params.startAge != ''">and c.age >= #{params.startAge}</if>
- <if test="params.endAge != null and params.endAge != ''">and c.age <= #{params.endAge}</if>
- <if test="idCard != null and idCard != ''">and c.id_card = #{idCard}</if>
- <if test="phoneNum != null and phoneNum != ''">and c.phone_num = #{phoneNum}</if>
- <if test="provinceId != null and provinceId != ''">and c.province_id = #{provinceId}</if>
- <if test="cityId != null and cityId != ''">and c.city_id = #{cityId}</if>
- <if test="regionId != null and regionId != ''">and c.region_id = #{regionId}</if>
- <if test="villageTownsId != null and villageTownsId != ''">and c.village_towns_id = #{villageTownsId}</if>
- <if test="villageId != null and villageId != ''">and c.village_id = #{villageId}</if>
- </where>
- order by c.update_time DESC
- </select>
- <select id="selectCzrkByNotRlCz" resultMap="CzrkResult">
- select c.id, c.user_name, c.phone_num, c.id_card, c.gender,
- z.province as provinceXjd, z.city as cityXjd,z.region as regionXjd, z.town as villageTownsXjd, z.village as
- villageXjd,z.now_in,c.grid_id
- , c.house_type, c.update_by, c.code, c.rlr,c.rlr_nike, c.update_time, c.delete_reason,
- c.now_in,c.is_confirm,c.confirm_info_user,c.confirm_info_nike_user,c.confirm_info_user_time
- from czrk c left join czrk_jzdz z on c.id = z.czrk_id
- <where>
- c.is_del = 'N'
- and c.is_rl = '否'
- and c.is_confirm = 'N'
- and c.status in ('1','2')
- <if test="userName != null and userName != ''">
- and c.user_name like concat(#{userName}, '%')
- </if>
- <if test="params.startAge != null and params.startAge != ''">and c.age >= #{params.startAge}</if>
- <if test="params.endAge != null and params.endAge != ''">and c.age <= #{params.endAge}</if>
- <if test="idCard != null and idCard != ''">and c.id_card = #{idCard}</if>
- <if test="phoneNum != null and phoneNum != ''">and c.phone_num = #{phoneNum}</if>
- <if test="provinceId != null and provinceId != ''">and c.province_id = #{provinceId}</if>
- <if test="cityId != null and cityId != ''">and c.city_id = #{cityId}</if>
- <if test="regionId != null and regionId != ''">and c.region_id = #{regionId}</if>
- <if test="villageTownsId != null and villageTownsId != ''">and c.village_towns_id = #{villageTownsId}</if>
- <if test="villageId != null and villageId != ''">and c.village_id = #{villageId}</if>
- <if test="provinceIdXjd != null and provinceIdXjd != ''">and z.province_id = #{provinceIdXjd}</if>
- <if test="cityIdXjd != null and cityIdXjd != ''">and z.city_id = #{cityIdXjd}</if>
- <if test="regionIdXjd != null and regionIdXjd != ''">and z.region_id = #{regionIdXjd}</if>
- <if test="villageTownsIdXjd != null and villageTownsIdXjd != ''">and z.town_id = #{villageTownsIdXjd}</if>
- <if test="villageIdXjd != null and villageIdXjd != ''">and z.village_id = #{villageIdXjd}</if>
- </where>
- order by c.update_time DESC
- </select>
- <select id="listByIdCard" resultMap="CzrkResult">
- select vi.id, vi.create_time, vi.update_time, vi.is_del, vi.update_by, vi.user_name, vi.phone_num, vi.id_card
- , vi.gender, vi.province, vi.city, vi.region, vi.now_in, vi.house_type, vi.update_by, vi.code
- from czrk vi
- where vi.id_card in
- <foreach item="idCard" collection="czrkIdCardList" open="(" separator="," close=")">
- #{idCard}
- </foreach>
- </select>
- <select id="selectCzrkCount" resultType="long">
- select ifnull(count(1),0)
- from czrk
- <where>
- is_del = 'N'
- and status = '1'
- <!-- 已认领 -->
- <if test="isRl != null and isRl != ''">and is_rl = #{isRl}</if>
- <if test="userName != null and userName != ''">
- and user_name like concat(#{userName}, '%')
- </if>
- <if test="params.startAge != null and params.startAge != ''">and age >= #{params.startAge}</if>
- <if test="params.endAge != null and params.endAge != ''">and age <= #{params.endAge}</if>
- <if test="gender != null and gender != ''">and gender = #{gender}</if>
- <if test="age != null ">and age = #{age}</if>
- <if test="birthday != null ">and birthday = #{birthday}</if>
- <if test="idCard != null and idCard != ''">and id_card = #{idCard}</if>
- <if test="phoneNum != null and phoneNum != ''">and phone_num = #{phoneNum}</if>
- <if test="isConfirm != null and isConfirm != ''">and is_confirm = #{isConfirm}</if>
- <if test="houseType != null and houseType != ''">and house_type = #{houseType}</if>
- <if test="provinceId != null and provinceId != ''">and province_id = #{provinceId}</if>
- <if test="province != null and province != ''">and province = #{province}</if>
- <if test="cityId != null and cityId != ''">and city_id = #{cityId}</if>
- <if test="city != null and city != ''">and city = #{city}</if>
- <if test="regionId != null and regionId != ''">and region_id = #{regionId}</if>
- <if test="region != null and region != ''">and region = #{region}</if>
- <if test="villageTownsId != null and villageTownsId != ''">and village_towns_id = #{villageTownsId}</if>
- <if test="villageTowns != null and villageTowns != ''">and village_towns = #{villageTowns}</if>
- <if test="villageId != null and villageId != ''">and village_id = #{villageId}</if>
- <if test="village != null and village != ''">and village = #{village}</if>
- <if test="isConfirm != null and isConfirm != ''">and is_confirm = #{isConfirm}</if>
- <if test="gridId != null and gridId != ''">and grid_id = #{gridId}</if>
- </where>
- order by create_time DESC
- </select>
- <select id="selectCzrkJzdzCount" resultType="long">
- select ifnull(count(1),0)
- from czrk c left join czrk_jzdz z on c.id =z.czrk_id
- <where>
- c.is_del = 'N'
- and c.status = '1'
- <if test="isRl != null and isRl != ''">and c.is_rl = #{isRl}</if>
- <if test="userName != null and userName != ''">
- and c.user_name like concat(#{userName}, '%')
- </if>
- <if test="params.startAge != null and params.startAge != ''">and c.age >= #{params.startAge}</if>
- <if test="params.endAge != null and params.endAge != ''">and c.age <= #{params.endAge}</if>
- <if test="idCard != null and idCard != ''">and c.id_card = #{idCard}</if>
- <if test="phoneNum != null and phoneNum != ''">and c.phone_num = #{phoneNum}</if>
- <if test="isConfirm != null and isConfirm != ''">and c.is_confirm = #{isConfirm}</if>
- <if test="houseType != null and houseType != ''">and c.house_type = #{houseType}</if>
- <if test="provinceId != null and provinceId != ''">and c.province_id = #{provinceId}</if>
- <if test="cityId != null and cityId != ''">and c.city_id = #{cityId}</if>
- <if test="regionId != null and regionId != ''">and c.region_id = #{regionId}</if>
- <if test="villageTownsId != null and villageTownsId != ''">and c.village_towns_id = #{villageTownsId}</if>
- <if test="villageId != null and villageId != ''">and c.village_id = #{villageId}</if>
- <if test="isConfirm != null and isConfirm != ''">and c.is_confirm = #{isConfirm}</if>
- <if test="provinceIdXjd != null and provinceIdXjd != ''">and z.province_id = #{provinceIdXjd}</if>
- <if test="cityIdXjd != null and cityIdXjd != ''">and z.city_id = #{cityIdXjd}</if>
- <if test="regionIdXjd != null and regionIdXjd != ''">and z.region_id = #{regionIdXjd}</if>
- <if test="villageTownsIdXjd != null and villageTownsIdXjd != ''">and z.town_id = #{villageTownsIdXjd}</if>
- <if test="villageIdXjd != null and villageIdXjd != ''">and z.village_id = #{villageIdXjd}</if>
- </where>
- order by c.create_time DESC
- </select>
- <select id="getCzrkByIdCard" resultMap="CzrkResult">
- select id,id_card,house_type from czrk where is_del = 'N' and id_card = #{idCard}
- </select>
- </mapper>
|