12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466 |
- <?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="isNucleicAcid" column="is_nucleicAcid"/>
- <result property="nucleicAcidTime" column="nucleicAcid_time"/>
- <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,is_nucleicAcid,nucleicAcid_time
- from czrk
- <where>
- is_del = 'N'
- and status = '1'
- <!-- 已认领 -->
- <if test="isRl != null and isRl != ''">and is_rl = #{isRl}</if>
- <if test="isNucleicAcid != null and isNucleicAcid != ''">and is_nucleicAcid = #{isNucleicAcid}</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'
- </trim>
- where id in
- <foreach collection="czrkList" item="czrk" open="(" separator="," close=")">
- #{czrk.id}
- </foreach>
- </update>
- <update id="updateCzrkHs">
- <foreach collection="czrkList" item="czrk" index="index" open="" close="" separator=";">
- update czrk
- <set>
- is_nucleicAcid= 'Y',
- nucleicAcid_time = ${czrk.nucleicAcidTime}
- </set>
- where id_card = ${czrk.idCard}
- </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, is_nucleicAcid from czrk
- where region_id = #{regionId} and is_del = 'N';
- </select>
- <select id="getAllCzrkVillageTownsId" resultMap="CzrkResult">
- select id, dept_id, region_id, region, village_towns_id, village_towns
- , village_id, village, create_time, update_time, is_del,status, is_nucleicAcid from czrk
- where village_towns_id = #{areaId} and is_del = 'N';
- </select>
- <select id="getAllCzrkVillageId" resultMap="CzrkResult">
- select id, dept_id, region_id, region, village_towns_id, village_towns
- , village_id, village, create_time, update_time, is_del,status, is_nucleicAcid from czrk
- where village_id = #{areaId} and is_del = 'N';
- </select>
- <select id="getAllCzrk" resultMap="CzrkResult">
- select
- ANY_VALUE(c.user_name) as user_name,
- ANY_VALUE(c.is_nucleicAcid) as is_nucleicAcid,
- ANY_VALUE(c.nucleicAcid_time) as nucleicAcid_time,
- 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="isNucleicAcid != null and isNucleicAcid != ''">and c.is_nucleicAcid = #{isNucleicAcid}</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="getAllCzrkNoTown" resultMap="CzrkResult">
- select
- ANY_VALUE(c.user_name) as user_name,
- ANY_VALUE(c.is_nucleicAcid) as is_nucleicAcid,
- ANY_VALUE(c.nucleicAcid_time) as nucleicAcid_time,
- 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'
- <!-- 已认领 -->
- and cj.region_id = '340882000000'
- and (cj.town_id = '' or cj.town_id = '0')
- </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,c.is_nucleicAcid,c.nucleicAcid_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="isNucleicAcid != null and isNucleicAcid != ''">and c.is_nucleicAcid = #{isNucleicAcid}</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>
|