123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671 |
- <?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.AccountingDataMapper">
- <resultMap type="com.boman.web.core.domain.vo.AccountingDataVo" id="AccountingDataResult">
- <result property="id" column="id"/>
- <result property="jcsj" column="jcsj"/>
- <result property="lxdh" column="lxdh"/>
- <result property="address" column="address"/>
- <result property="batchNumber" column="batch_number"/>
- <result property="focusPerson" column="focus_person"/>
- <result property="jcjg" column="jcjg"/>
- <result property="fromCity" column="from_city"/>
- <result property="jcdd" column="jcdd"/>
- <result property="cjdd" column="cjdd"/>
- <result property="toCity" column="to_city"/>
- <result property="source" column="source"/>
- <result property="zjhm" column="zjhm"/>
- <result property="cjsj" column="cjsj"/>
- <result property="certificateNoType" column="certificate_no_type"/>
- <result property="xm" column="xm"/>
- <result property="transit" column="transit"/>
- <result property="collectorName" column="collector_name"/>
- <result property="cjqxqh" column="cjqxqh"/>
- <result property="cjssxq" column="cjssxq"/>
- <result property="mainKey" column="main_key"/>
- <result property="modifyDate" column="modify_date"/>
- <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="hjh" column="hjh"/>
- <!--以下是返回是需要使用-->
- <result property="phoneNum" column="phone_num"/>
- <result property="province" column="province"/>
- <result property="city" column="city"/>
- <result property="region" column="region"/>
- <result property="villageTowns" column="village_towns"/>
- <result property="village" column="village"/>
- <result property="nowIn" column="now_in"/>
- <result property="nowInSelect" column="nowInSelect"/>
- <result property="domicileSelect" column="domicileSelect"/>
- <result property="isNucleicAcid" column="isNucleicAcid"/>
- <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"/>
- </resultMap>
- <sql id="selectAccountingDataVo">
- select id,
- jcsj,
- lxdh,
- address,
- batch_number,
- focus_person,
- jcjg,
- from_city,
- jcdd,
- cjdd,
- to_city,
- source,
- zjhm,
- cjsj,
- certificate_no_type,
- xm,
- transit,
- collector_name,
- cjqxqh,
- cjssxq,
- main_key,
- modify_date,
- create_by,
- create_time,
- update_by,
- update_time
- from accounting_data
- </sql>
- <select id="nucleicAcidJcd" resultMap="AccountingDataResult"
- parameterType="com.boman.web.core.domain.vo.AccountingDataVo">
- <include refid="selectAccountingDataVo"/>
- <where>
- 1=1
- <if test="zjhm != null and zjhm != ''">and zjhm = #{zjhm}</if>
- <if test="xm != null and xm != ''">and xm like concat(#{xm}, '%')</if>
- <if test="lxdh != null and lxdh != ''">and lxdh = #{lxdh}</if>
- <if test="params.startTime != null and params.startTime != '' and params.startTime != 'null'">and
- DATE_FORMAT(cjsj,'%Y-%m-%d %H:%i:%s') >= DATE_FORMAT(#{params.startTime},'%Y-%m-%d %H:%i:%s')
- </if>
- <if test="params.endTime != null and params.endTime != '' and params.endTime != 'null'">and
- DATE_FORMAT(cjsj,'%Y-%m-%d %H:%i:%s') <= DATE_FORMAT(#{params.endTime},'%Y-%m-%d %H:%i:%s')
- </if>
- <if test="cjssxq != null and cjssxq != ''">and cjssxq like concat('%',#{cjssxq}, '%')</if>
- <if test="cjqxqh != null and cjqxqh != ''">and cjqxqh = #{cjqxqh}</if>
- </where>
- order by cjsj desc
- </select>
- <select id="nucleicAcidZd" resultMap="AccountingDataResult"
- parameterType="com.boman.web.core.domain.vo.AccountingDataVo">
- <include refid="selectAccountingDataVo"/>
- <where>
- 1=1
- <if test="zjhm != null and zjhm != ''">and zjhm = #{zjhm}</if>
- <if test="xm != null and xm != ''">and xm like concat(#{xm}, '%')</if>
- <if test="lxdh != null and lxdh != ''">and lxdh = #{lxdh}</if>
- <if test="params.startTime != null and params.startTime != '' and params.startTime != 'null'">and
- DATE_FORMAT(cjsj,'%Y-%m-%d %H:%i:%s') >= DATE_FORMAT(#{params.startTime},'%Y-%m-%d %H:%i:%s')
- </if>
- <if test="params.endTime != null and params.endTime != '' and params.endTime != 'null'">and
- DATE_FORMAT(cjsj,'%Y-%m-%d %H:%i:%s') <= DATE_FORMAT(#{params.endTime},'%Y-%m-%d %H:%i:%s')
- </if>
- <if test="cjqxqh != null and cjqxqh != ''">and cjqxqh = #{cjqxqh}</if>
- <if test="cjdd != null and cjdd != ''">and cjdd = #{cjdd}</if>
- </where>
- </select>
- <select id="selectAccountingDataHjList" parameterType="com.boman.web.core.domain.vo.AccountingDataVo"
- resultMap="AccountingDataResult">
- SELECT
- r.id,r.user_name as xm,r.id_card as
- zjhm,r.province,r.city,r.region,r.village_towns,r.village,r.now_in,r.phone_num,d.lxdh,d.jcsj,d.jcdd,d.cjdd,d.cjsj
- FROM czrk r left join `accounting_data` d on r.id_card = d.zjhm
- <where>
- r.is_del = 'N'
- and r.status = '1'
- <if test="zjhm != null and zjhm != ''">and r.id_card = #{zjhm}</if>
- <if test="xm != null and xm != ''">and r.user_name like concat(#{xm}, '%')</if>
- <if test="lxdh != null and lxdh != ''">and r.phone_num = #{lxdh}</if>
- <if test="params.startTime != null and params.startTime != '' and params.startTime != 'null'">and
- DATE_FORMAT(d.cjsj,'%Y-%m-%d %H:%i:%s') >= DATE_FORMAT(#{params.startTime},'%Y-%m-%d %H:%i:%s')
- </if>
- <if test="params.endTime != null and params.endTime != '' and params.endTime != 'null'">and
- DATE_FORMAT(d.cjsj,'%Y-%m-%d %H:%i:%s') <= DATE_FORMAT(#{params.endTime},'%Y-%m-%d %H:%i:%s')
- </if>
- <if test="provinceId != null and provinceId != ''">and r.province_id = #{provinceId}</if>
- <if test="cityId != null and cityId != ''">and r.city_id = #{cityId}</if>
- <if test="regionId != null and regionId != ''">and r.region_id = #{regionId}</if>
- <if test="villageTownsId != null and villageTownsId != ''">and r.village_towns_id = #{villageTownsId}</if>
- <if test="villageId != null and villageId != ''">and r.village_id = #{villageId}</if>
- </where>
- order by d.cjsj DESC,r.create_time DESC
- </select>
- <select id="selectNoAccountingDataHjList" parameterType="com.boman.web.core.domain.vo.AccountingDataVo"
- resultMap="AccountingDataResult">
- select cz.id,cz.user_name as xm,cz.id_card as
- zjhm,cz.province,cz.city,cz.region,cz.village_towns,cz.village,cz.now_in,cz.phone_num from czrk cz
- where id_card not in (
- SELECT
- r.id_card
- FROM czrk r left join `accounting_data` d on r.id_card = d.zjhm
- <where>
- r.is_del = 'N'
- and r.status = '1'
- <if test="zjhm != null and zjhm != ''">and r.id_card = #{zjhm}</if>
- <if test="xm != null and xm != ''">and r.user_name like concat(#{xm}, '%')</if>
- <if test="params.startTime != null and params.startTime != '' and params.startTime != 'null'">and
- DATE_FORMAT(d.cjsj,'%Y-%m-%d %H:%i:%s') >= DATE_FORMAT(#{params.startTime},'%Y-%m-%d %H:%i:%s')
- </if>
- <if test="params.endTime != null and params.endTime != '' and params.endTime != 'null'">and
- DATE_FORMAT(d.cjsj,'%Y-%m-%d %H:%i:%s') <= DATE_FORMAT(#{params.endTime},'%Y-%m-%d %H:%i:%s')
- </if>
- <if test="provinceId != null and provinceId != ''">and r.province_id = #{provinceId}</if>
- <if test="cityId != null and cityId != ''">and r.city_id = #{cityId}</if>
- <if test="regionId != null and regionId != ''">and r.region_id = #{regionId}</if>
- <if test="villageTownsId != null and villageTownsId != ''">and r.village_towns_id = #{villageTownsId}</if>
- <if test="villageId != null and villageId != ''">and r.village_id = #{villageId}</if>
- </where>
- )
- and cz.is_del = 'N'
- and cz.status = '1'
- <if test="zjhm != null and zjhm != ''">and cz.id_card = #{zjhm}</if>
- <if test="lxdh != null and lxdh != ''">and cz.phone_num = #{lxdh}</if>
- <if test="xm != null and xm != ''">and cz.user_name like concat(#{xm}, '%')</if>
- <if test="provinceId != null and provinceId != ''">and cz.province_id = #{provinceId}</if>
- <if test="cityId != null and cityId != ''">and cz.city_id = #{cityId}</if>
- <if test="regionId != null and regionId != ''">and cz.region_id = #{regionId}</if>
- <if test="villageTownsId != null and villageTownsId != ''">and cz.village_towns_id = #{villageTownsId}</if>
- <if test="villageId != null and villageId != ''">and cz.village_id = #{villageId}</if>
- order by cz.create_time DESC
- </select>
- <select id="selectAccountingDataJzdzList" parameterType="com.boman.web.core.domain.vo.AccountingDataVo"
- resultMap="AccountingDataResult">
- select r.user_name as xm, r.phone_num, r.id_card as zjhm,
- z.province as provinceXjd , z.city as cityXjd,z.region as regionXjd , z.town as villageTownsXjd, z.village as
- villageXjd,z.now_in,d.lxdh,d.jcsj,d.jcdd,d.cjdd,d.cjsj
- from czrk r left join czrk_jzdz z on r.id =z.czrk_id
- left join `accounting_data` d on r.id_card = d.zjhm
- <where>
- r.is_del = 'N'
- and r.status = '1'
- <if test="zjhm != null and zjhm != ''">and r.id_card = #{zjhm}</if>
- <if test="lxdh != null and lxdh != ''">and r.phone_num = #{lxdh}</if>
- <if test="xm != null and xm != ''">and r.user_name like concat(#{xm}, '%')</if>
- <if test="params.startTime != null and params.startTime != '' and params.startTime != 'null'">and
- DATE_FORMAT(d.cjsj,'%Y-%m-%d %H:%i:%s') >= DATE_FORMAT(#{params.startTime},'%Y-%m-%d %H:%i:%s')
- </if>
- <if test="params.endTime != null and params.endTime != '' and params.endTime != 'null'">and
- DATE_FORMAT(d.cjsj,'%Y-%m-%d %H:%i:%s') <= DATE_FORMAT(#{params.endTime},'%Y-%m-%d %H:%i:%s')
- </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 d.cjsj DESC,r.create_time DESC
- </select>
- <select id="selectNoAccountingDataJzdzList" parameterType="com.boman.web.core.domain.vo.AccountingDataVo"
- resultMap="AccountingDataResult">
- select rz.user_name as xm, rz.phone_num, rz.id_card as zjhm,
- zj.province as provinceXjd , zj.city as cityXjd,zj.region as regionXjd , zj.town as villageTownsXjd, zj.village
- as
- villageXjd,zj.now_in
- from czrk rz left join czrk_jzdz zj on rz.id =zj.czrk_id
- where rz.id_card not in (
- select r.id_card
- from czrk r left join czrk_jzdz z on r.id =z.czrk_id
- left join `accounting_data` d on r.id_card = d.zjhm
- <where>
- r.is_del = 'N'
- and r.status = '1'
- <if test="zjhm != null and zjhm != ''">and r.id_card = #{zjhm}</if>
- <if test="xm != null and xm != ''">and r.user_name like concat(#{xm}, '%')</if>
- <if test="params.startTime != null and params.startTime != '' and params.startTime != 'null'">and
- DATE_FORMAT(d.cjsj,'%Y-%m-%d %H:%i:%s') >= DATE_FORMAT(#{params.startTime},'%Y-%m-%d %H:%i:%s')
- </if>
- <if test="params.endTime != null and params.endTime != '' and params.endTime != 'null'">and
- DATE_FORMAT(d.cjsj,'%Y-%m-%d %H:%i:%s') <= DATE_FORMAT(#{params.endTime},'%Y-%m-%d %H:%i:%s')
- </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>
- )
- and rz.is_del = 'N'
- and rz.status = '1'
- <if test="zjhm != null and zjhm != ''">and rz.id_card = #{zjhm}</if>
- <if test="lxdh != null and lxdh != ''">and rz.phone_num = #{lxdh}</if>
- <if test="xm != null and xm != ''">and rz.user_name like concat(#{xm}, '%')</if>
- <if test="provinceIdXjd != null and provinceIdXjd != ''">and zj.province_id = #{provinceIdXjd}</if>
- <if test="cityIdXjd != null and cityIdXjd != ''">and zj.city_id = #{cityIdXjd}</if>
- <if test="regionIdXjd != null and regionIdXjd != ''">and zj.region_id = #{regionIdXjd}</if>
- <if test="villageTownsIdXjd != null and villageTownsIdXjd != ''">and zj.town_id = #{villageTownsIdXjd}</if>
- <if test="villageIdXjd != null and villageIdXjd != ''">and zj.village_id = #{villageIdXjd}</if>
- order by rz.create_time DESC
- </select>
- <select id="detailedInfoByIdCard" resultMap="AccountingDataResult">
- select r.user_name as xm, r.phone_num, r.id_card as zjhm,
- z.province as provinceXjd , z.city as cityXjd,z.region as regionXjd , z.town as villageTownsXjd, z.village as
- villageXjd,z.now_in as nowXjd,d.lxdh,d.jcsj,d.jcdd,d.cjdd,d.cjsj,
- r.province,r.city,r.region,r.village_towns,r.village,r.now_in
- from czrk r left join czrk_jzdz z on r.id =z.czrk_id
- left join `accounting_data` d on r.id_card = d.zjhm
- <where>
- r.is_del = 'N'
- and r.status = '1'
- <if test="zjhm != null and zjhm != ''">and r.id_card = #{zjhm}</if>
- <if test="cjsj != null and cjsj != '' and cjsj != 'null'">
- and d.cjsj = #{cjsj}
- </if>
- </where>
- limit 1
- </select>
- <insert id="insertAccountingData" useGeneratedKeys="true" keyProperty="id">
- insert into accounting_data
- <trim prefix="(" suffix=")" suffixOverrides=",">
- <if test="id != null">id,</if>
- <if test="jcsj != null">jcsj,</if>
- <if test="lxdh != null">lxdh,</if>
- <if test="address != null">address,</if>
- <if test="batchNumber != null">batch_number,</if>
- <if test="focusPerson != null">focus_person,</if>
- <if test="jcjg != null">jcjg,</if>
- <if test="fromCity != null">from_city,</if>
- <if test="jcdd != null">jcdd,</if>
- <if test="cjdd != null">cjdd,</if>
- <if test="toCity != null">to_city,</if>
- <if test="source != null">source,</if>
- <if test="zjhm != null">zjhm,</if>
- <if test="cjsj != null">cjsj,</if>
- <if test="certificateNoType != null">certificate_no_type,</if>
- <if test="xm != null">xm,</if>
- <if test="collectorName != null">collector_name,</if>
- <if test="cjqxqh != null">cjqxqh,</if>
- <if test="cjssxq != null">cjssxq,</if>
- <if test="createBy != null">create_by,</if>
- create_time
- </trim>
- <trim prefix="values (" suffix=")" suffixOverrides=",">
- <if test="id != null">#{id},</if>
- <if test="jcsj != null">#{jcsj},</if>
- <if test="lxdh != null">#{lxdh},</if>
- <if test="address != null">#{address},</if>
- <if test="batchNumber != null">#{batchNumber},</if>
- <if test="focusPerson != null">#{focusPerson},</if>
- <if test="jcjg != null">#{jcjg},</if>
- <if test="fromCity != null">#{fromCity},</if>
- <if test="jcdd != null">#{jcdd},</if>
- <if test="cjdd != null">#{cjdd},</if>
- <if test="toCity != null">#{toCity},</if>
- <if test="source != null">#{source},</if>
- <if test="zjhm != null">#{zjhm},</if>
- <if test="cjsj != null">#{cjsj},</if>
- <if test="certificateNoType != null">#{certificateNoType},</if>
- <if test="xm != null">#{xm},</if>
- <if test="collectorName != null">#{collectorName},</if>
- <if test="cjqxqh != null">#{cjqxqh},</if>
- <if test="cjssxq != null">#{cjssxq},</if>
- <if test="createBy != null">#{createBy},</if>
- sysdate()
- </trim>
- </insert>
- <select id="selectById" parameterType="String" resultType="int">
- select count(1)
- from accounting_data
- where zjhm = #{zjhm} and cjsj = #{cjsj}
- </select>
- <select id="getExportHj" resultMap="AccountingDataResult">
- SELECT
- r.id,r.user_name as xm,r.id_card as zjhm,r.code as hjh,r.is_nucleicAcid as isNucleicAcid,
- r.province,r.city,r.region,r.village_towns,r.village,r.now_in,r.phone_num,
- d.lxdh,d.jcsj,d.jcdd,d.cjdd,d.cjsj,
- z.province as provinceXjd , z.city as cityXjd,z.region as regionXjd , z.town as villageTownsXjd, z.village as
- villageXjd,z.now_in
- FROM czrk r
- left join `accounting_data` d on r.id_card = d.zjhm
- left join czrk_jzdz z on r.id =z.czrk_id
- <where>
- r.is_del = 'N'
- and r.status = '1'
- <if test="zjhm != null and zjhm != ''">and r.id_card = #{zjhm}</if>
- <if test="xm != null and xm != ''">and r.user_name like concat(#{xm}, '%')</if>
- <if test="params.startTime != null and params.startTime != '' and params.startTime != 'null'">and
- DATE_FORMAT(d.cjsj,'%Y-%m-%d %H:%i:%s') >= DATE_FORMAT(#{params.startTime},'%Y-%m-%d %H:%i:%s')
- </if>
- <if test="params.endTime != null and params.endTime != '' and params.endTime != 'null'">and
- DATE_FORMAT(d.cjsj,'%Y-%m-%d %H:%i:%s') <= DATE_FORMAT(#{params.endTime},'%Y-%m-%d %H:%i:%s')
- </if>
- <if test="provinceId != null and provinceId != ''">and r.province_id = #{provinceId}</if>
- <if test="cityId != null and cityId != ''">and r.city_id = #{cityId}</if>
- <if test="regionId != null and regionId != ''">and r.region_id = #{regionId}</if>
- <if test="villageTownsId != null and villageTownsId != ''">and r.village_towns_id = #{villageTownsId}</if>
- <if test="villageId != null and villageId != ''">and r.village_id = #{villageId}</if>
- </where>
- order by d.cjsj DESC,r.create_time DESC
- </select>
- <select id="getExportHjNo" resultMap="AccountingDataResult">
- SELECT
- zr.id,zr.user_name as xm,zr.id_card as zjhm,zr.code as hjh,zr.is_nucleicAcid as isNucleicAcid,
- zr.province,zr.city,zr.region,zr.village_towns,zr.village,zr.now_in,zr.phone_num,
- zj.province as provinceXjd , zj.city as cityXjd,zj.region as regionXjd , zj.town as villageTownsXjd, zj.village
- as
- villageXjd,zj.now_in
- FROM czrk zr
- left join czrk_jzdz zj on zr.id =zj.czrk_id
- where zr.id_card not in (
- SELECT
- r.id_card
- FROM czrk r
- left join `accounting_data` d on r.id_card = d.zjhm
- <where>
- r.is_del = 'N'
- and r.status = '1'
- <if test="zjhm != null and zjhm != ''">and r.id_card = #{zjhm}</if>
- <if test="xm != null and xm != ''">and r.user_name like concat(#{xm}, '%')</if>
- <if test="params.startTime != null and params.startTime != '' and params.startTime != 'null'">and
- DATE_FORMAT(d.cjsj,'%Y-%m-%d %H:%i:%s') >= DATE_FORMAT(#{params.startTime},'%Y-%m-%d %H:%i:%s')
- </if>
- <if test="params.endTime != null and params.endTime != '' and params.endTime != 'null'">and
- DATE_FORMAT(d.cjsj,'%Y-%m-%d %H:%i:%s') <= DATE_FORMAT(#{params.endTime},'%Y-%m-%d %H:%i:%s')
- </if>
- <if test="provinceId != null and provinceId != ''">and r.province_id = #{provinceId}</if>
- <if test="cityId != null and cityId != ''">and r.city_id = #{cityId}</if>
- <if test="regionId != null and regionId != ''">and r.region_id = #{regionId}</if>
- <if test="villageTownsId != null and villageTownsId != ''">and r.village_towns_id = #{villageTownsId}</if>
- <if test="villageId != null and villageId != ''">and r.village_id = #{villageId}</if>
- </where>
- )
- and zr.is_del = 'N'
- and zr.status = '1'
- <if test="zjhm != null and zjhm != ''">and zr.id_card = #{zjhm}</if>
- <if test="xm != null and xm != ''">and zr.user_name like concat(#{xm}, '%')</if>
- <if test="provinceId != null and provinceId != ''">and zr.province_id = #{provinceId}</if>
- <if test="cityId != null and cityId != ''">and zr.city_id = #{cityId}</if>
- <if test="regionId != null and regionId != ''">and zr.region_id = #{regionId}</if>
- <if test="villageTownsId != null and villageTownsId != ''">and zr.village_towns_id = #{villageTownsId}</if>
- <if test="villageId != null and villageId != ''">and zr.village_id = #{villageId}</if>
- order by zr.create_time DESC
- </select>
- <select id="exportCz" resultMap="AccountingDataResult">
- select
- r.id,r.user_name as xm,r.id_card as zjhm,r.code as hjh,r.is_nucleicAcid as isNucleicAcid,
- r.province,r.city,r.region,r.village_towns,r.village,r.now_in,r.phone_num,
- d.lxdh,d.jcsj,d.jcdd,d.cjdd,d.cjsj,
- z.province as provinceXjd , z.city as cityXjd,z.region as regionXjd , z.town as villageTownsXjd, z.village as
- villageXjd,z.now_in
- from czrk r
- left join czrk_jzdz z on r.id =z.czrk_id
- left join `accounting_data` d on r.id_card = d.zjhm
- <where>
- r.is_del = 'N'
- and r.status = '1'
- <if test="zjhm != null and zjhm != ''">and r.id_card = #{zjhm}</if>
- <if test="xm != null and xm != ''">and r.user_name like concat(#{xm}, '%')</if>
- <if test="params.startTime != null and params.startTime != '' and params.startTime != 'null'">and
- DATE_FORMAT(d.cjsj,'%Y-%m-%d %H:%i:%s') >= DATE_FORMAT(#{params.startTime},'%Y-%m-%d %H:%i:%s')
- </if>
- <if test="params.endTime != null and params.endTime != '' and params.endTime != 'null'">and
- DATE_FORMAT(d.cjsj,'%Y-%m-%d %H:%i:%s') <= DATE_FORMAT(#{params.endTime},'%Y-%m-%d %H:%i:%s')
- </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 d.cjsj DESC,r.create_time DESC
- </select>
- <select id="exportCzjNo" resultMap="AccountingDataResult">
- select
- zr.id,zr.user_name as xm,zr.id_card as zjhm,zr.code as hjh,zr.is_nucleicAcid as isNucleicAcid,
- zr.province,zr.city,zr.region,zr.village_towns,zr.village,zr.now_in,zr.phone_num,
- zj.province as provinceXjd , zj.city as cityXjd,zj.region as regionXjd , zj.town as villageTownsXjd, zj.village
- as
- villageXjd,zj.now_in
- from czrk zr
- left join czrk_jzdz zj on zr.id =zj.czrk_id
- where zr.id_card not in (
- select
- r.id_card
- from czrk r
- left join czrk_jzdz z on r.id =z.czrk_id
- left join `accounting_data` d on r.id_card = d.zjhm
- <where>
- r.is_del = 'N'
- and r.status = '1'
- <if test="zjhm != null and zjhm != ''">and r.id_card = #{zjhm}</if>
- <if test="xm != null and xm != ''">and r.user_name like concat(#{xm}, '%')</if>
- <if test="params.startTime != null and params.startTime != '' and params.startTime != 'null'">and
- DATE_FORMAT(d.cjsj,'%Y-%m-%d %H:%i:%s') >= DATE_FORMAT(#{params.startTime},'%Y-%m-%d %H:%i:%s')
- </if>
- <if test="params.endTime != null and params.endTime != '' and params.endTime != 'null'">and
- DATE_FORMAT(d.cjsj,'%Y-%m-%d %H:%i:%s') <= DATE_FORMAT(#{params.endTime},'%Y-%m-%d %H:%i:%s')
- </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>
- )
- and zr.is_del = 'N'
- and zr.status = '1'
- <if test="zjhm != null and zjhm != ''">and zr.id_card = #{zjhm}</if>
- <if test="xm != null and xm != ''">and zr.user_name like concat(#{xm}, '%')</if>
- <if test="provinceIdXjd != null and provinceIdXjd != ''">and zj.province_id = #{provinceIdXjd}</if>
- <if test="cityIdXjd != null and cityIdXjd != ''">and zj.city_id = #{cityIdXjd}</if>
- <if test="regionIdXjd != null and regionIdXjd != ''">and zj.region_id = #{regionIdXjd}</if>
- <if test="villageTownsIdXjd != null and villageTownsIdXjd != ''">and zj.town_id = #{villageTownsIdXjd}</if>
- <if test="villageIdXjd != null and villageIdXjd != ''">and zj.village_id = #{villageIdXjd}</if>
- order by zr.create_time DESC
- </select>
- <select id="getAccountingDataOne" resultMap="AccountingDataResult">
- select id, cjsj, lxdh, create_date, modify_date
- FROM accounting_data
- order by cjsj desc limit 1;
- </select>
- <select id="getAllData" resultMap="AccountingDataResult">
- select id, cjsj, lxdh, create_date, zjhm, xm
- FROM accounting_data
- </select>
- <select id="thirdNucleicAcid" resultMap="AccountingDataResult">
- SELECT
- sfzhm as zjhm
- ,xm as xm
- ,sjhm as lxdh
- ,cjsj as cjsj
- ,jgcjss as jcsj
- ,jcdd as jcdd
- ,jcjg as jcjg
- ,cjdd as cjdd
- ,sjly as cjssxq
- FROM
- ods_qss_hsjcxx_all
- WHERE
- 1 = 1
- and sjly != '东软系统'
- AND (
- cjsj > #{startTime}
- AND #{endTime} >= cjsj
- )
- UNION
- SELECT
- s.id_card_no AS zjhm,
- s.user_name AS xm,
- s.user_phone AS lxdh,
- s.collect_datetime AS cjsj,
- r.testing_datetime AS jcsj,
- t.testing_site_name AS jcdd,
- (
- CASE
- WHEN r.sign_name = 'negative' THEN
- '0'
- ELSE
- '1'
- END
- ) AS jcjg,
- s.collect_site_name AS cjdd,
- c.town AS cjssxq
- FROM `tb_whole_testing_sample_921` s
- LEFT JOIN tb_whole_testing_result_921 r ON s.id = r.id
- LEFT JOIN tb_whole_collect_site_city c ON s.collect_site_code = c.id
- LEFT JOIN tb_testing_site_921 t ON t.testing_site_code = r.testing_site_code
- where s.create_datetime > #{startTime} and #{endTime}>=s.create_datetime
- </select>
- <select id="tongjiHjZ" resultType="java.lang.Integer">
- SELECT count(1)
- from (
- SELECT ANY_VALUE(concat(r.id_card, '\t'))
- FROM czrk r
- left join `accounting_data` d on r.id_card = d.zjhm
- where r.is_del = 'N'
- and r.status = '1'
- and d.cjsj > #{startTime}
- and #{endTime} >= d.cjsj
- and r.village_towns_id = #{areaId}
- GROUP BY zjhm) a;
- </select>
- <select id="tongjiCzZ" resultType="java.lang.Integer">
- SELECT count(1)
- from (select ANY_VALUE(r.id_card)
- from czrk_jzdz z
- left join czrk r on r.id = z.czrk_id
- left join `accounting_data` d on r.id_card = d.zjhm
- where r.is_del = 'N'
- and r.status = '1'
- and d.cjsj > #{startTime}
- and #{endTime} >= d.cjsj
- and z.town_id = #{areaId}
- GROUP BY zjhm) a;
- </select>
- <select id="tongjiHjC" resultType="java.lang.Integer">
- SELECT count(1)
- from (
- SELECT ANY_VALUE(concat(r.id_card, '\t'))
- FROM czrk r
- left join `accounting_data` d on r.id_card = d.zjhm
- where r.is_del = 'N'
- and r.status = '1'
- and d.cjsj > #{startTime}
- and #{endTime} >= d.cjsj
- and r.village_id = #{areaId}
- GROUP BY zjhm) a;
- </select>
- <select id="tongjiCzC" resultType="java.lang.Integer">
- SELECT count(1)
- from (select ANY_VALUE(r.id_card)
- from czrk_jzdz z
- left join czrk r on r.id = z.czrk_id
- left join `accounting_data` d on r.id_card = d.zjhm
- where r.is_del = 'N'
- and r.status = '1'
- and d.cjsj > #{startTime}
- and #{endTime} >= d.cjsj
- and z.village_id = #{areaId}
- GROUP BY zjhm) a;
- </select>
- <select id="selectWanShiTongList" resultMap="AccountingDataResult">
- SELECT
- sfzhm as zjhm
- ,xm as xm
- ,sjhm as lxdh
- ,cjsj as cjsj
- ,jgcjss as jcsj
- ,jcdd as jcdd
- ,jcjg as jcjg
- ,sjly as cjdd
- FROM
- ods_qss_hsjcxx_all
- <where> 1=1
- <if test="zjhm != null and zjhm != ''">and sfzhm = #{zjhm}</if>
- <if test="params.startTime != null and params.startTime != '' and params.startTime != 'null'">and
- DATE_FORMAT(cjsj,'%Y-%m-%d %H:%i:%s') >= DATE_FORMAT(#{params.startTime},'%Y-%m-%d %H:%i:%s')
- </if>
- <if test="params.endTime != null and params.endTime != '' and params.endTime != 'null'">and
- DATE_FORMAT(cjsj,'%Y-%m-%d %H:%i:%s') <= DATE_FORMAT(#{params.endTime},'%Y-%m-%d %H:%i:%s')
- </if>
- </where>
- order by cjsj desc
- </select>
- <select id="selectWanShiTongInfo" resultMap="AccountingDataResult">
- SELECT
- sfzhm as zjhm
- ,xm as xm
- ,sjhm as lxdh
- ,cjsj as cjsj
- ,jgcjss as jcsj
- ,jcdd as jcdd
- ,jcjg as jcjg
- ,sjly as cjdd
- FROM
- ods_qss_hsjcxx_all
- WHERE
- 1 = 1
- AND cjsj like concat(#{cjsj}, '%')
- AND sfzhm = #{zjhm}
- limit 1
- </select>
- <select id="detailedJcd" resultMap="AccountingDataResult">
- <include refid="selectAccountingDataVo"/>
- where id = #{id}
- </select>
- <select id="selectRepeat" resultType="java.lang.Integer"
- parameterType="com.boman.web.core.domain.vo.AccountingDataVo">
- select count(1) from accounting_data
- <where>
- 1=1
- <if test="zjhm != null and zjhm != ''">and zjhm = #{zjhm}</if>
- <if test="xm != null and xm != ''">and xm = #{xm}</if>
- <if test="lxdh != null and lxdh != ''">and lxdh = #{lxdh}</if>
- <if test="cjsj != null and cjsj != '' and cjsj != 'null'">and
- cjsj = #{cjsj}
- </if>
- </where>
- </select>
- </mapper>
|