123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771 |
- <?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.VaccineInfoMapper">
-
- <resultMap type="com.boman.domain.VaccineInfoOperation" id="VaccineInfoResult">
- <result property="id" column="id" />
- <result property="villageTowns" column="village_towns" />
- <result property="village" column="village" />
- <result property="villagerGroup" column="villager_group" />
- <result property="age" column="age" />
- <result property="houseType" column="house_type" />
- <result property="domicile" column="domicile" />
- <result property="province" column="province" />
- <result property="city" column="city" />
- <result property="region" column="region" />
- <result property="vaccineName" column="vaccine_name" />
- <result property="residenceTown" column="residence_town" />
- <result property="residenceVillage" column="residence_village" />
- <result property="userName" column="user_name" />
- <result property="gender" column="gender" />
- <result property="idCard" column="id_card" />
- <result property="phoneNum" column="phone_num" />
- <result property="keyIndustries" column="key_industries" />
- <result property="isVaccination" column="is_vaccination" />
- <result property="contraindication" column="contraindication" />
- <result property="suspend" column="suspend" />
- <result property="shouldBe" column="should_be" />
- <result property="other" column="other" />
- <result property="remark" column="remark" />
- <result property="status" column="status" />
- <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="code" column="code" />
- <result property="birthday" column="birthday" />
- <result property="workUnit" column="work_unit" />
- <result property="crowdClassification" column="crowd_classification" />
- <result property="manufacturer" column="manufacturer" />
- <result property="nowIn" column="now_in" />
- <result property="url" column="url" />
- <result property="jici" column="jici" />
- <result property="suspendUrl" column="suspend_url" />
- <result property="otherUrl" column="other_url" />
- <result property="shouldSlow" column="should_slow" />
- <result property="vaccinationTime" column="vaccination_time" />
- <result property="progress" column="progress" />
- <result property="deptId" column="dept_id" />
- <result property="rlr" column="rlr" />
- <result property="deleteReason" column="delete_reason" />
- <collection property="vaccineInfoUserList" javaType="java.util.List" resultMap="VaccineInfoUser" />
- </resultMap>
- <resultMap id="VaccineInfoUser" type="com.boman.domain.VaccineInfoUser">
- <id property="id" column="id_user" />
- <result property="idCard" column="id_card_user" />
- <result property="vaccineName" column="vaccine_name_user" />
- <result property="jici" column="jici_user" />
- <result property="vaccinationTime" column="vaccination_time_user" />
- <result property="vaccinationPlace" column="vaccination_place_user" />
- <result property="progress" column="progress_user" />
- <result property="url" column="url_user" />
- <result property="status" column="status_user" />
- </resultMap>
- <sql id="selectVaccineInfoVo">
- select vi.id, vi.village_towns, vi.village, vi.villager_group,vi.age, vi.house_type, vi.domicile, vi.province, vi.city,
- vi.region, vi.user_name, vi.gender, vi.id_card, vi.phone_num, vi.key_industries, vi.is_vaccination, vi.vaccine_name, vi.jici,
- vi.vaccination_time, vi.vaccination_place, vi.contraindication, vi.suspend,vi.suspend_url,vi.other_url,vi.vaccination_time,
- vi.should_be, vi.other, vi.progress, vi.remark, vi.status, vi.create_by, vi.create_time, vi.update_by, vi.update_time,
- vi.is_del,vi.code,vi.birthday,vi.work_unit,vi.crowd_classification,vi.manufacturer,vi.now_in,vi.url,vi.dept_id,
- vi.residence_town as residenceTown, vi.residence_village as residenceVillage,
- viu.id as id_user,viu.id_card as id_card_user,viu.vaccine_name as vaccine_name_user,viu.jici as jici_user,viu.vaccination_time as vaccination_time_user,
- viu.vaccination_place as vaccination_place_user,viu.progress as progress_user,viu.status as status_user,viu.url as url_user
- from vaccine_info vi left join vaccine_info_user viu
- on vi.id_card = viu.id_card and viu.is_del = 'N'
- </sql>
- <select id="selectVaccineInfoList" resultMap="VaccineInfoResult">
- select vi.id, vi.village_towns, vi.village, vi.villager_group,vi.age, vi.house_type, vi.domicile, vi.province, vi.city,vi.should_slow,
- vi.region, vi.user_name, vi.gender, vi.id_card, vi.phone_num, vi.key_industries, vi.is_vaccination, vi.vaccine_name, vi.jici,
- vi.vaccination_time, vi.vaccination_place, vi.contraindication, vi.suspend,vi.suspend_url,vi.other_url,vi.vaccination_time,
- vi.should_be, vi.other, vi.progress, vi.remark, vi.status, vi.create_by, vi.create_time, vi.update_by, vi.update_time,
- vi.is_del,vi.code,vi.birthday,vi.work_unit,vi.crowd_classification,vi.manufacturer,vi.now_in,vi.url,vi.dept_id from vaccine_info vi
- <where>
- vi.is_del = 'N'
- <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="domicile != null and domicile != ''"> and vi.domicile = #{domicile}</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="jici != null and jici != ''"> and vi.jici <= #{jici}</if>
- <if test="vaccineName != null and vaccineName != ''"> and vi.vaccine_name like concat('%', #{vaccineName}, '%')</if>
- <if test="vaccinationTime != null "> and DATE_FORMAT(vi.vaccination_time,'%Y-%m-%d') = DATE_FORMAT(#{vaccinationTime},'%Y-%m-%d')</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="keyIndustries != null and keyIndustries != ''"> and vi.key_industries = #{keyIndustries}</if>
- <if test="isVaccination != null and isVaccination != ''"> and vi.is_vaccination = #{isVaccination}</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="contraindication != null and contraindication != ''"> and vi.contraindication = #{contraindication}</if>
- <if test="suspend != null and suspend != ''"> and vi.suspend = #{suspend}</if>
- <if test="shouldBe != null and shouldBe != ''"> and vi.should_be = #{shouldBe}</if>
- <if test="other != null and other != ''"> and vi.other = #{other}</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="crowdClassification != null and crowdClassification != ''"> and vi.crowd_classification = #{crowdClassification}</if>
- <if test="manufacturer != null and manufacturer != ''"> and vi.manufacturer = #{manufacturer}</if>
- <if test="nowIn != null and nowIn != ''"> and vi.now_in = #{nowIn}</if>
- <if test="shouldSlow != null and shouldSlow != ''"> and vi.should_slow = #{shouldSlow}</if>
- <if test="createTime != null and createTime != ''"> and vi.create_time >= #{startTime}</if>
- <if test="endTime != null and endTime != ''"> and vi.create_time <= #{endTime}</if>
- <if test="shouldSlow != null and shouldSlow != ''"> and vi.should_slow = #{shouldSlow}</if>
- <if test="idCardS != null and idCardS.size() > 0">
- and vi.id_card in
- <foreach item="idCard" collection="idCardS" open="(" separator="," close=")">
- #{idCard}
- </foreach>
- </if>
- <if test="deptIdList != null and deptIdList.size() > 0">
- and vi.dept_id in
- <foreach item="deptId" collection="deptIdList" open="(" separator="," close=")">
- #{deptId}
- </foreach>
- </if>
- </where>
- order by vi.create_time DESC ,vi.vaccination_time DESC
- </select>
- <select id="listByXz" resultMap="VaccineInfoResult">
- 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 vaccine_info vi
- where vi.is_del = 'N' and vi.create_time >= #{startTime} and vi.create_time <= #{endTime}
- <if test="userName != null and userName != ''">
- and (vi.user_name like concat('%', #{userName}, '%') or vi.id_card 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="domicile != null and domicile != ''"> and vi.domicile = #{domicile}</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="jici != null and jici != ''"> and vi.jici <= #{jici}</if>
- <if test="vaccineName != null and vaccineName != ''"> and vi.vaccine_name like concat('%', #{vaccineName}, '%')</if>
- <if test="vaccinationTime != null "> and DATE_FORMAT(vi.vaccination_time,'%Y-%m-%d') = DATE_FORMAT(#{vaccinationTime},'%Y-%m-%d')</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="keyIndustries != null and keyIndustries != ''"> and vi.key_industries = #{keyIndustries}</if>
- <if test="isVaccination != null and isVaccination != ''"> and vi.is_vaccination = #{isVaccination}</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="contraindication != null and contraindication != ''"> and vi.contraindication = #{contraindication}</if>
- <if test="suspend != null and suspend != ''"> and vi.suspend = #{suspend}</if>
- <if test="shouldBe != null and shouldBe != ''"> and vi.should_be = #{shouldBe}</if>
- <if test="other != null and other != ''"> and vi.other = #{other}</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="crowdClassification != null and crowdClassification != ''"> and vi.crowd_classification = #{crowdClassification}</if>
- <if test="manufacturer != null and manufacturer != ''"> and vi.manufacturer = #{manufacturer}</if>
- <if test="nowIn != null and nowIn != ''"> and vi.now_in = #{nowIn}</if>
- <if test="shouldSlow != null and shouldSlow != ''"> and vi.should_slow = #{shouldSlow}</if>
- <if test="createTime != null and createTime != ''"> and vi.create_time >= #{startTime}</if>
- <if test="endTime != null and endTime != ''"> and vi.create_time <= #{endTime}</if>
- <if test="shouldSlow != null and shouldSlow != ''"> and vi.should_slow = #{shouldSlow}</if>
- <if test="idCardS != null and idCardS.size() > 0">
- and vi.id_card in
- <foreach item="idCard" collection="idCardS" open="(" separator="," close=")">
- #{idCard}
- </foreach>
- </if>
- <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="countByXz" resultType="int">
- select count(1)
- from vaccine_info vi
- where vi.is_del = 'N' and vi.create_time >= #{startTime} and vi.create_time <= #{endTime}
- <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="domicile != null and domicile != ''"> and vi.domicile = #{domicile}</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="jici != null and jici != ''"> and vi.jici <= #{jici}</if>
- <if test="vaccineName != null and vaccineName != ''"> and vi.vaccine_name like concat('%', #{vaccineName}, '%')</if>
- <if test="vaccinationTime != null "> and DATE_FORMAT(vi.vaccination_time,'%Y-%m-%d') = DATE_FORMAT(#{vaccinationTime},'%Y-%m-%d')</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="keyIndustries != null and keyIndustries != ''"> and vi.key_industries = #{keyIndustries}</if>
- <if test="isVaccination != null and isVaccination != ''"> and vi.is_vaccination = #{isVaccination}</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="contraindication != null and contraindication != ''"> and vi.contraindication = #{contraindication}</if>
- <if test="suspend != null and suspend != ''"> and vi.suspend = #{suspend}</if>
- <if test="shouldBe != null and shouldBe != ''"> and vi.should_be = #{shouldBe}</if>
- <if test="other != null and other != ''"> and vi.other = #{other}</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="crowdClassification != null and crowdClassification != ''"> and vi.crowd_classification = #{crowdClassification}</if>
- <if test="manufacturer != null and manufacturer != ''"> and vi.manufacturer = #{manufacturer}</if>
- <if test="nowIn != null and nowIn != ''"> and vi.now_in = #{nowIn}</if>
- <if test="shouldSlow != null and shouldSlow != ''"> and vi.should_slow = #{shouldSlow}</if>
- <if test="createTime != null and createTime != ''"> and vi.create_time >= #{startTime}</if>
- <if test="endTime != null and endTime != ''"> and vi.create_time <= #{endTime}</if>
- <if test="shouldSlow != null and shouldSlow != ''"> and vi.should_slow = #{shouldSlow}</if>
- <if test="idCardS != null and idCardS.size() > 0">
- and vi.id_card in
- <foreach item="idCard" collection="idCardS" open="(" separator="," close=")">
- #{idCard}
- </foreach>
- </if>
- <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="listByJs" resultMap="VaccineInfoResult">
- 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 vaccine_info vi
- where vi.is_del = 'Y' and vi.update_time >= #{startTime} and vi.update_time <= #{endTime}
- <if test="userName != null and userName != ''">
- and (vi.user_name like concat('%', #{userName}, '%') or vi.id_card 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="domicile != null and domicile != ''"> and vi.domicile = #{domicile}</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="jici != null and jici != ''"> and vi.jici <= #{jici}</if>
- <if test="vaccineName != null and vaccineName != ''"> and vi.vaccine_name like concat('%', #{vaccineName}, '%')</if>
- <if test="vaccinationTime != null "> and DATE_FORMAT(vi.vaccination_time,'%Y-%m-%d') = DATE_FORMAT(#{vaccinationTime},'%Y-%m-%d')</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="keyIndustries != null and keyIndustries != ''"> and vi.key_industries = #{keyIndustries}</if>
- <if test="isVaccination != null and isVaccination != ''"> and vi.is_vaccination = #{isVaccination}</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="contraindication != null and contraindication != ''"> and vi.contraindication = #{contraindication}</if>
- <if test="suspend != null and suspend != ''"> and vi.suspend = #{suspend}</if>
- <if test="shouldBe != null and shouldBe != ''"> and vi.should_be = #{shouldBe}</if>
- <if test="other != null and other != ''"> and vi.other = #{other}</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="crowdClassification != null and crowdClassification != ''"> and vi.crowd_classification = #{crowdClassification}</if>
- <if test="manufacturer != null and manufacturer != ''"> and vi.manufacturer = #{manufacturer}</if>
- <if test="nowIn != null and nowIn != ''"> and vi.now_in = #{nowIn}</if>
- <if test="shouldSlow != null and shouldSlow != ''"> and vi.should_slow = #{shouldSlow}</if>
- <if test="createTime != null and createTime != ''"> and vi.create_time >= #{startTime}</if>
- <if test="endTime != null and endTime != ''"> and vi.create_time <= #{endTime}</if>
- <if test="shouldSlow != null and shouldSlow != ''"> and vi.should_slow = #{shouldSlow}</if>
- <if test="idCardS != null and idCardS.size() > 0">
- and vi.id_card in
- <foreach item="idCard" collection="idCardS" open="(" separator="," close=")">
- #{idCard}
- </foreach>
- </if>
- <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="countByJs" resultType="int">
- select count(1)
- from vaccine_info vi
- where vi.is_del = 'Y' and vi.update_time >= #{startTime} and vi.update_time <= #{endTime}
- <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="domicile != null and domicile != ''"> and vi.domicile = #{domicile}</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="jici != null and jici != ''"> and vi.jici <= #{jici}</if>
- <if test="vaccineName != null and vaccineName != ''"> and vi.vaccine_name like concat('%', #{vaccineName}, '%')</if>
- <if test="vaccinationTime != null "> and DATE_FORMAT(vi.vaccination_time,'%Y-%m-%d') = DATE_FORMAT(#{vaccinationTime},'%Y-%m-%d')</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="keyIndustries != null and keyIndustries != ''"> and vi.key_industries = #{keyIndustries}</if>
- <if test="isVaccination != null and isVaccination != ''"> and vi.is_vaccination = #{isVaccination}</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="contraindication != null and contraindication != ''"> and vi.contraindication = #{contraindication}</if>
- <if test="suspend != null and suspend != ''"> and vi.suspend = #{suspend}</if>
- <if test="shouldBe != null and shouldBe != ''"> and vi.should_be = #{shouldBe}</if>
- <if test="other != null and other != ''"> and vi.other = #{other}</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="crowdClassification != null and crowdClassification != ''"> and vi.crowd_classification = #{crowdClassification}</if>
- <if test="manufacturer != null and manufacturer != ''"> and vi.manufacturer = #{manufacturer}</if>
- <if test="nowIn != null and nowIn != ''"> and vi.now_in = #{nowIn}</if>
- <if test="shouldSlow != null and shouldSlow != ''"> and vi.should_slow = #{shouldSlow}</if>
- <if test="createTime != null and createTime != ''"> and vi.create_time >= #{startTime}</if>
- <if test="endTime != null and endTime != ''"> and vi.create_time <= #{endTime}</if>
- <if test="shouldSlow != null and shouldSlow != ''"> and vi.should_slow = #{shouldSlow}</if>
- <if test="idCardS != null and idCardS.size() > 0">
- and vi.id_card in
- <foreach item="idCard" collection="idCardS" open="(" separator="," close=")">
- #{idCard}
- </foreach>
- </if>
- <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="countCzrk" resultType="int">
- select count(vi.id)
- from vaccine_info vi
- where vi.is_del = 'N'
- <!-- 已认领 -->
- <if test="ryrl == true">and (vi.village_towns is not null or vi.village_towns != '')</if>
- <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="countIdCard" resultType="int">
- select count(vi.id) from vaccine_info vi where vi.is_del = 'N' and id_card = #{idCard}
- </select>
- <select id="listByCode" resultMap="VaccineInfoResult">
- select vi.id, 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.rlr
- from vaccine_info vi
- where vi.is_del = 'N' and code = #{code}
- </select>
- <select id="listByRlry" resultMap="VaccineInfoResult">
- select vi.id, 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.rlr, vi.update_time, vi.delete_reason
- from vaccine_info vi
- <where>
- vi.is_del = #{isDel}
- <!-- 已认领 -->
- <if test="ryrl == true">and (vi.village_towns is not null or vi.village_towns != '')</if>
- <!-- 未认领 -->
- <if test="ryrl == false">and (vi.village_towns is null or vi.village_towns = '')</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="houseType != null and houseType != ''">and vi.house_type = #{houseType}</if>
- <if test="domicile != null and domicile != ''">and vi.domicile = #{domicile}</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="jici != null and jici != ''">and vi.jici <= #{jici}</if>
- <if test="vaccineName != null and vaccineName != ''">and vi.vaccine_name like concat('%', #{vaccineName},
- '%')
- </if>
- <if test="vaccinationTime != null ">and DATE_FORMAT(vi.vaccination_time,'%Y-%m-%d') =
- DATE_FORMAT(#{vaccinationTime},'%Y-%m-%d')
- </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}, '%') or vi.id_card 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="keyIndustries != null and keyIndustries != ''">and vi.key_industries = #{keyIndustries}</if>
- <if test="isVaccination != null and isVaccination != ''">and vi.is_vaccination = #{isVaccination}</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="contraindication != null and contraindication != ''">and vi.contraindication = #{contraindication}</if>
- <if test="suspend != null and suspend != ''">and vi.suspend = #{suspend}</if>
- <if test="shouldBe != null and shouldBe != ''">and vi.should_be = #{shouldBe}</if>
- <if test="other != null and other != ''">and vi.other = #{other}</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="crowdClassification != null and crowdClassification != ''">and vi.crowd_classification =
- #{crowdClassification}
- </if>
- <if test="manufacturer != null and manufacturer != ''">and vi.manufacturer = #{manufacturer}</if>
- <if test="nowIn != null and nowIn != ''">and vi.now_in = #{nowIn}</if>
- <if test="shouldSlow != null and shouldSlow != ''">and vi.should_slow = #{shouldSlow}</if>
- <if test="idCardS != null and idCardS.size() > 0">
- and vi.id_card in
- <foreach item="idCard" collection="idCardS" open="(" separator="," close=")">
- #{idCard}
- </foreach>
- </if>
- <if test="deptIdList != null and deptIdList.size() > 0">
- and vi.dept_id in
- <foreach item="deptId" collection="deptIdList" open="(" separator="," close=")">
- #{deptId}
- </foreach>
- </if>
- </where>
- order by vi.create_time DESC ,vi.vaccination_time DESC
- </select>
- <select id="stsByYrl" resultType="int">
- select count(vi.id)
- from vaccine_info vi
- where vi.is_del = 'N'
- <!-- 已认领 -->
- and (vi.village_towns is not null or vi.village_towns != '')
- <if test="userName != null and userName != ''">
- and (vi.user_name like concat('%', #{userName}, '%') or vi.id_card like concat('%', #{userName}, '%'))
- </if>
- <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="stsByWrl" resultType="int">
- select count(vi.id)
- from vaccine_info vi
- where vi.is_del = 'N'
- <!-- 未认领 -->
- and (vi.village_towns is null or vi.village_towns = '')
- <if test="userName != null and userName != ''">
- and (vi.user_name like concat('%', #{userName}, '%') or vi.id_card like concat('%', #{userName}, '%'))
- </if>
- <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>
- <update id="deleteCzrk">
- update vaccine_info
- set is_del = 'Y'
- , delete_reason = #{deleteReason}
- , update_by = #{updateBy}
- , update_time = sysdate()
- where id = #{id}
- </update>
- <update id="reduction">
- update vaccine_info
- set is_del = 'N'
- , update_by = #{updateBy}
- , update_time = sysdate()
- where id = #{id}
- </update>
- <select id="selectVaccineInfoListByPage" parameterType="Integer" resultMap="VaccineInfoResult">
- select * from vaccine_info limit #{startNum}, #{endNum}
- </select>
- <select id="selectVaccineInfoById" parameterType="Long" resultMap="VaccineInfoResult">
- <include refid="selectVaccineInfoVo"/>
- where vi.id = #{id} and vi.is_del = 'N'
- order by viu.vaccination_time
- </select>
- <select id="selectVaccineInfoByIdCard" parameterType="String" resultMap="VaccineInfoResult">
- <include refid="selectVaccineInfoVo"/>
- where vi.id_card = #{idCard} and vi.is_del = 'N'
- order by viu.vaccination_time
- </select>
- <select id="selectVaccineInfoByIds" parameterType="Long" resultMap="VaccineInfoResult">
- <include refid="selectVaccineInfoVo"/>
- where vi.id in
- <foreach item="id" collection="array" open="(" separator="," close=")">
- #{id}
- </foreach>
- and vi.is_del = 'N'
- </select>
-
- <insert id="insertVaccineInfo" useGeneratedKeys="true" keyProperty="id">
- insert into vaccine_info
- <trim prefix="(" suffix=")" suffixOverrides=",">
- <if test="villageTowns != null">village_towns,</if>
- <if test="village != null">village,</if>
- <if test="villagerGroup != null">villager_group,</if>
- <if test="houseType != null">house_type,</if>
- <if test="domicile != null">domicile,</if>
- <if test="province != null">province,</if>
- <if test="city != null">city,</if>
- <if test="region != null and region != ''">region,</if>
- <if test="userName != null">user_name,</if>
- <if test="gender != null">gender,</if>
- <if test="idCard != null">id_card,</if>
- <if test="phoneNum != null">phone_num,</if>
- <if test="keyIndustries != null">key_industries,</if>
- <if test="isVaccination != null">is_vaccination,</if>
- <if test="vaccineName != null">vaccine_name,</if>
- <if test="jici != null">jici,</if>
- <if test="vaccinationTime != null">vaccination_time,</if>
- <if test="vaccinationPlace != null">vaccination_place,</if>
- <if test="contraindication != null">contraindication,</if>
- <if test="suspend != null">suspend,</if>
- <if test="shouldBe != null">should_be,</if>
- <if test="other != null">other,</if>
- <if test="progress != null">progress,</if>
- <if test="remark != null">remark,</if>
- <if test="status != null">status,</if>
- <if test="createBy != null">create_by,</if>
- <if test="updateBy != null">update_by,</if>
- <if test="updateTime != null">update_time,</if>
- <if test="isDel != null and isDel != ''">is_del,</if>
- <if test="code != null and code != ''">code,</if>
- <if test="birthday != null and birthday != ''">birthday,</if>
- <if test="workUnit != null and workUnit != ''">work_unit,</if>
- <if test="crowdClassification != null and crowdClassification != ''">crowd_classification,</if>
- <if test="manufacturer != null and manufacturer != ''">manufacturer,</if>
- <if test="nowIn != null and nowIn != ''">now_in,</if>
- <if test="url != null and url != ''">url,</if>
- <if test="shouldSlow != null and shouldSlow != ''">should_slow,</if>
- <if test="suspendUrl != null and suspendUrl != ''">suspend_url,</if>
- <if test="otherUrl != null and otherUrl != ''">other_url,</if>
- <if test="age != null and age != ''">age,</if>
- <if test="deptId != null">dept_id,</if>
- <if test="deleteReason != null">delete_reason,</if>
- create_time
- </trim>
- <trim prefix="values (" suffix=")" suffixOverrides=",">
- <if test="villageTowns != null">#{villageTowns},</if>
- <if test="village != null">#{village},</if>
- <if test="villagerGroup != null">#{villagerGroup},</if>
- <if test="houseType != null">#{houseType},</if>
- <if test="domicile != null">#{domicile},</if>
- <if test="province != null">#{province},</if>
- <if test="city != null">#{city},</if>
- <if test="region != null and region != ''">#{region},</if>
- <if test="userName != null">#{userName},</if>
- <if test="gender != null">#{gender},</if>
- <if test="idCard != null">#{idCard},</if>
- <if test="phoneNum != null">#{phoneNum},</if>
- <if test="keyIndustries != null">#{keyIndustries},</if>
- <if test="isVaccination != null">#{isVaccination},</if>
- <if test="vaccineName != null">#{vaccineName},</if>
- <if test="jici != null">#{jici},</if>
- <if test="vaccinationTime != null">#{vaccinationTime},</if>
- <if test="vaccinationPlace != null">#{vaccinationPlace},</if>
- <if test="contraindication != null">#{contraindication},</if>
- <if test="suspend != null">#{suspend},</if>
- <if test="shouldBe != null">#{shouldBe},</if>
- <if test="other != null">#{other},</if>
- <if test="progress != null">#{progress},</if>
- <if test="remark != null">#{remark},</if>
- <if test="status != null">#{status},</if>
- <if test="createBy != null">#{createBy},</if>
- <if test="updateBy != null">#{updateBy},</if>
- <if test="updateTime != null">#{updateTime},</if>
- <if test="isDel != null and isDel != ''">#{isDel},</if>
- <if test="code != null and code != ''">#{code},</if>
- <if test="birthday != null and birthday != ''">#{birthday},</if>
- <if test="workUnit != null and workUnit != ''">#{workUnit},</if>
- <if test="crowdClassification != null and crowdClassification != ''">#{crowdClassification},</if>
- <if test="manufacturer != null and manufacturer != ''">#{manufacturer},</if>
- <if test="nowIn != null and nowIn != ''">#{nowIn},</if>
- <if test="url != null and url != ''">#{url},</if>
- <if test="shouldSlow != null and shouldSlow != ''">#{shouldSlow},</if>
- <if test="suspendUrl != null and suspendUrl != ''">#{suspendUrl},</if>
- <if test="otherUrl != null and otherUrl != ''">#{otherUrl},</if>
- <if test="age != null and age != ''">#{age},</if>
- <if test="deptId != null">#{deptId},</if>
- <if test="deleteReason != null">#{deleteReason},</if>
- sysdate()
- </trim>
- </insert>
- <update id="updateVaccineInfo" >
- update vaccine_info
- <trim prefix="SET" suffixOverrides=",">
- <if test="villageTowns != null">village_towns = #{villageTowns},</if>
- <if test="village != null">village = #{village},</if>
- <if test="villagerGroup != null">villager_group = #{villagerGroup},</if>
- <if test="houseType != null">house_type = #{houseType},</if>
- <if test="domicile != null">domicile = #{domicile},</if>
- <if test="province != null">province = #{province},</if>
- <if test="city != null">city = #{city},</if>
- <if test="region != null and region != ''">region = #{region},</if>
- <if test="userName != null">user_name = #{userName},</if>
- <if test="gender != null">gender = #{gender},</if>
- <if test="idCard != null">id_card = #{idCard},</if>
- <if test="phoneNum != null">phone_num = #{phoneNum},</if>
- <if test="keyIndustries != null">key_industries = #{keyIndustries},</if>
- <if test="isVaccination != null">is_vaccination = #{isVaccination},</if>
- <if test="vaccineName != null">vaccine_name = #{vaccineName},</if>
- <if test="jici != null">jici = #{jici},</if>
- <if test="vaccinationTime != null">vaccination_time = #{vaccinationTime},</if>
- <if test="vaccinationPlace != null">vaccination_place = #{vaccinationPlace},</if>
- <if test="contraindication != null">contraindication = #{contraindication},</if>
- <if test="suspend != null">suspend = #{suspend},</if>
- <if test="shouldBe != null">should_be = #{shouldBe},</if>
- <if test="other != null">other = #{other},</if>
- <if test="progress != null">progress = #{progress},</if>
- <if test="remark != null">remark = #{remark},</if>
- <if test="status != null">status = #{status},</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="updateTime != null">update_time = sysdate(),</if>
- <if test="isDel != null and isDel != ''">is_del = #{isDel},</if>
- <if test="code != null and code != ''">code = #{code},</if>
- <if test="birthday != null and birthday != ''">birthday = #{birthday},</if>
- <if test="workUnit != null and workUnit != ''">work_unit = #{workUnit},</if>
- <if test="crowdClassification != null and crowdClassification != ''">crowd_classification = #{crowdClassification},</if>
- <if test="manufacturer != null and manufacturer != ''">manufacturer = #{manufacturer},</if>
- <if test="nowIn != null and nowIn != ''">now_in = #{nowIn},</if>
- <if test="url != null and url != ''">url = #{url},</if>
- <if test="shouldSlow != null and shouldSlow != ''">should_slow = #{shouldSlow},</if>
- <if test="suspendUrl != null and suspendUrl != ''">suspend_url = #{suspendUrl},</if>
- <if test="otherUrl != null and otherUrl != ''">other_url = #{otherUrl},</if>
- <if test="age != null and age != ''">age = #{age},</if>
- <if test="deptId != null">dept_id = #{deptId},</if>
- <if test="rlr != null and rlr != ''">rlr = #{rlr},</if>
- <if test="deleteReason != null and deleteReason != ''">delete_reason = #{deleteReason},</if>
- </trim>
- where id = #{id}
- </update>
- <update id="update" >
- update vaccine_info
- <trim prefix="SET" suffixOverrides=",">
- <if test="villageTowns != null">village_towns = #{villageTowns},</if>
- <if test="village != null">village = #{village},</if>
- <if test="villagerGroup != null">villager_group = #{villagerGroup},</if>
- <if test="houseType != null">house_type = #{houseType},</if>
- <if test="domicile != null">domicile = #{domicile},</if>
- <if test="province != null">province = #{province},</if>
- <if test="city != null">city = #{city},</if>
- <if test="region != null and region != ''">region = #{region},</if>
- <if test="userName != null">user_name = #{userName},</if>
- <if test="gender != null">gender = #{gender},</if>
- <!-- <if SysRegion="idCard != null">id_card = #{idCard},</if>-->
- <if test="phoneNum != null">phone_num = #{phoneNum},</if>
- <if test="keyIndustries != null">key_industries = #{keyIndustries},</if>
- <if test="isVaccination != null">is_vaccination = #{isVaccination},</if>
- <if test="vaccineName != null">vaccine_name = #{vaccineName},</if>
- <if test="jici != null">jici = #{jici},</if>
- <if test="vaccinationTime != null">vaccination_time = #{vaccinationTime},</if>
- <if test="vaccinationPlace != null">vaccination_place = #{vaccinationPlace},</if>
- <if test="contraindication != null">contraindication = #{contraindication},</if>
- <if test="suspend != null">suspend = #{suspend},</if>
- <if test="shouldBe != null">should_be = #{shouldBe},</if>
- <if test="other != null">other = #{other},</if>
- <if test="progress != null">progress = #{progress},</if>
- <if test="remark != null">remark = #{remark},</if>
- <if test="status != null">status = #{status},</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="updateTime != null">update_time = #{updateTime},</if>
- <if test="isDel != null and isDel != ''">is_del = #{isDel},</if>
- <if test="code != null and code != ''">code = #{code},</if>
- <if test="birthday != null and birthday != ''">birthday = #{birthday},</if>
- <if test="workUnit != null and workUnit != ''">work_unit = #{workUnit},</if>
- <if test="crowdClassification != null and crowdClassification != ''">crowd_classification = #{crowdClassification},</if>
- <if test="manufacturer != null and manufacturer != ''">manufacturer = #{manufacturer},</if>
- <if test="nowIn != null and nowIn != ''">now_in = #{nowIn},</if>
- <if test="url != null and url != ''">url = #{url},</if>
- <if test="shouldSlow != null and shouldSlow != ''">should_slow = #{shouldSlow},</if>
- <if test="suspendUrl != null and suspendUrl != ''">suspend_url = #{suspendUrl},</if>
- <if test="otherUrl != null and otherUrl != ''">other_url = #{otherUrl},</if>
- <if test="age != null and age != ''">age = #{age},</if>
- <if test="deptId != null">dept_id = #{deptId},</if>
- </trim>
- where code = #{code} or (id_card like concat('%', #{idCard}, '%') and user_name like concat('%', #{userName}, '%'))
- </update>
- <delete id="deleteVaccineInfoById" parameterType="Long">
- update vaccine_info set is_del = 'Y' where id = #{id}
- </delete>
- <delete id="deleteVaccineInfoByIds" parameterType="String">
- update vaccine_info set is_del = 'Y' where id in
- <foreach item="id" collection="array" open="(" separator="," close=")">
- #{id}
- </foreach>
- </delete>
- <select id="findHjInfo" resultMap="VaccineInfoResult">
- select id, user_name ,gender, birthday,age,code from vaccine_info
- <where>
- is_del = 'N'
- <if test="idCard != null and idCard != '' "> and id_card = #{idCard}</if>
- </where>
- limit 1
- </select>
- <select id="selectSysDictDataByDictLabel" parameterType="string" resultType="String">
- select dict_value from sys_dict_data where dict_label = #{vaccineName} and status = '0'
- </select>
- <select id="listByTotalTaskCnt" resultMap="VaccineInfoResult">
- SELECT id_card, village_towns, vaccination_time, age, jici, vaccine_name
- FROM vaccine_info
- WHERE age > 18
- </select>
- <select id="getByIdCard" resultMap="VaccineInfoResult">
- select * from vaccine_info where id_card = #{idCard} limit 1;
- </select>
- <!-- AND (-->
- <!-- contraindication IS NULL-->
- <!-- OR suspend IS NULL-->
- <!-- OR other IS NULL-->
- <!-- );-->
- </mapper>
|