VaccineInfoMapper.xml 49 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771
  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <!DOCTYPE mapper
  3. PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
  4. "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
  5. <mapper namespace="com.boman.web.core.mapper.VaccineInfoMapper">
  6. <resultMap type="com.boman.domain.VaccineInfoOperation" id="VaccineInfoResult">
  7. <result property="id" column="id" />
  8. <result property="villageTowns" column="village_towns" />
  9. <result property="village" column="village" />
  10. <result property="villagerGroup" column="villager_group" />
  11. <result property="age" column="age" />
  12. <result property="houseType" column="house_type" />
  13. <result property="domicile" column="domicile" />
  14. <result property="province" column="province" />
  15. <result property="city" column="city" />
  16. <result property="region" column="region" />
  17. <result property="vaccineName" column="vaccine_name" />
  18. <result property="residenceTown" column="residence_town" />
  19. <result property="residenceVillage" column="residence_village" />
  20. <result property="userName" column="user_name" />
  21. <result property="gender" column="gender" />
  22. <result property="idCard" column="id_card" />
  23. <result property="phoneNum" column="phone_num" />
  24. <result property="keyIndustries" column="key_industries" />
  25. <result property="isVaccination" column="is_vaccination" />
  26. <result property="contraindication" column="contraindication" />
  27. <result property="suspend" column="suspend" />
  28. <result property="shouldBe" column="should_be" />
  29. <result property="other" column="other" />
  30. <result property="remark" column="remark" />
  31. <result property="status" column="status" />
  32. <result property="createBy" column="create_by" />
  33. <result property="createTime" column="create_time" />
  34. <result property="updateBy" column="update_by" />
  35. <result property="updateTime" column="update_time" />
  36. <result property="isDel" column="is_del" />
  37. <result property="code" column="code" />
  38. <result property="birthday" column="birthday" />
  39. <result property="workUnit" column="work_unit" />
  40. <result property="crowdClassification" column="crowd_classification" />
  41. <result property="manufacturer" column="manufacturer" />
  42. <result property="nowIn" column="now_in" />
  43. <result property="url" column="url" />
  44. <result property="jici" column="jici" />
  45. <result property="suspendUrl" column="suspend_url" />
  46. <result property="otherUrl" column="other_url" />
  47. <result property="shouldSlow" column="should_slow" />
  48. <result property="vaccinationTime" column="vaccination_time" />
  49. <result property="progress" column="progress" />
  50. <result property="deptId" column="dept_id" />
  51. <result property="rlr" column="rlr" />
  52. <result property="deleteReason" column="delete_reason" />
  53. <collection property="vaccineInfoUserList" javaType="java.util.List" resultMap="VaccineInfoUser" />
  54. </resultMap>
  55. <resultMap id="VaccineInfoUser" type="com.boman.domain.VaccineInfoUser">
  56. <id property="id" column="id_user" />
  57. <result property="idCard" column="id_card_user" />
  58. <result property="vaccineName" column="vaccine_name_user" />
  59. <result property="jici" column="jici_user" />
  60. <result property="vaccinationTime" column="vaccination_time_user" />
  61. <result property="vaccinationPlace" column="vaccination_place_user" />
  62. <result property="progress" column="progress_user" />
  63. <result property="url" column="url_user" />
  64. <result property="status" column="status_user" />
  65. </resultMap>
  66. <sql id="selectVaccineInfoVo">
  67. select vi.id, vi.village_towns, vi.village, vi.villager_group,vi.age, vi.house_type, vi.domicile, vi.province, vi.city,
  68. vi.region, vi.user_name, vi.gender, vi.id_card, vi.phone_num, vi.key_industries, vi.is_vaccination, vi.vaccine_name, vi.jici,
  69. vi.vaccination_time, vi.vaccination_place, vi.contraindication, vi.suspend,vi.suspend_url,vi.other_url,vi.vaccination_time,
  70. vi.should_be, vi.other, vi.progress, vi.remark, vi.status, vi.create_by, vi.create_time, vi.update_by, vi.update_time,
  71. vi.is_del,vi.code,vi.birthday,vi.work_unit,vi.crowd_classification,vi.manufacturer,vi.now_in,vi.url,vi.dept_id,
  72. vi.residence_town as residenceTown, vi.residence_village as residenceVillage,
  73. 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,
  74. viu.vaccination_place as vaccination_place_user,viu.progress as progress_user,viu.status as status_user,viu.url as url_user
  75. from vaccine_info vi left join vaccine_info_user viu
  76. on vi.id_card = viu.id_card and viu.is_del = 'N'
  77. </sql>
  78. <select id="selectVaccineInfoList" resultMap="VaccineInfoResult">
  79. 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,
  80. vi.region, vi.user_name, vi.gender, vi.id_card, vi.phone_num, vi.key_industries, vi.is_vaccination, vi.vaccine_name, vi.jici,
  81. vi.vaccination_time, vi.vaccination_place, vi.contraindication, vi.suspend,vi.suspend_url,vi.other_url,vi.vaccination_time,
  82. vi.should_be, vi.other, vi.progress, vi.remark, vi.status, vi.create_by, vi.create_time, vi.update_by, vi.update_time,
  83. 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
  84. <where>
  85. vi.is_del = 'N'
  86. <if test="villageTowns != null and villageTowns != ''">
  87. and vi.village_towns = #{villageTowns}
  88. </if>
  89. <if test="village != null and village != ''"> and vi.village = #{village}</if>
  90. <if test="villagerGroup != null and villagerGroup != ''"> and vi.villager_group = #{villagerGroup}</if>
  91. <if test="houseType != null and houseType != ''"> and vi.house_type = #{houseType}</if>
  92. <if test="domicile != null and domicile != ''"> and vi.domicile = #{domicile}</if>
  93. <if test="province != null and province != ''"> and vi.province = #{province}</if>
  94. <if test="city != null and city != ''"> and vi.city = #{city}</if>
  95. <if test="jici != null and jici != ''"> and vi.jici &lt;= #{jici}</if>
  96. <if test="vaccineName != null and vaccineName != ''"> and vi.vaccine_name like concat('%', #{vaccineName}, '%')</if>
  97. <if test="vaccinationTime != null "> and DATE_FORMAT(vi.vaccination_time,'%Y-%m-%d') = DATE_FORMAT(#{vaccinationTime},'%Y-%m-%d')</if>
  98. <if test="region != null and region != ''"> and vi.region = #{region}</if>
  99. <if test="userName != null and userName != ''"> and vi.user_name like concat('%', #{userName}, '%')</if>
  100. <if test="gender != null and gender != ''"> and vi.gender = #{gender}</if>
  101. <if test="idCard != null and idCard != ''"> and vi.id_card like concat('%', #{idCard}, '%')</if>
  102. <if test="phoneNum != null and phoneNum != ''"> and vi.phone_num = #{phoneNum}</if>
  103. <if test="keyIndustries != null and keyIndustries != ''"> and vi.key_industries = #{keyIndustries}</if>
  104. <if test="isVaccination != null and isVaccination != ''"> and vi.is_vaccination = #{isVaccination}</if>
  105. <if test="params.startAge != null and params.startAge != ''"> and vi.age &gt;= #{params.startAge}</if>
  106. <if test="params.endAge != null and params.endAge != ''"> and vi.age &lt;= #{params.endAge}</if>
  107. <if test="contraindication != null and contraindication != ''"> and vi.contraindication = #{contraindication}</if>
  108. <if test="suspend != null and suspend != ''"> and vi.suspend = #{suspend}</if>
  109. <if test="shouldBe != null and shouldBe != ''"> and vi.should_be = #{shouldBe}</if>
  110. <if test="other != null and other != ''"> and vi.other = #{other}</if>
  111. <if test="status != null and status != ''"> and vi.status = #{status}</if>
  112. <if test="code != null and code != ''"> and vi.code = #{code}</if>
  113. <if test="birthday != null and birthday != ''"> and vi.birthday = #{birthday}</if>
  114. <if test="workUnit != null and workUnit != ''"> and vi.work_unit = #{workUnit}</if>
  115. <if test="crowdClassification != null and crowdClassification != ''"> and vi.crowd_classification = #{crowdClassification}</if>
  116. <if test="manufacturer != null and manufacturer != ''"> and vi.manufacturer = #{manufacturer}</if>
  117. <if test="nowIn != null and nowIn != ''"> and vi.now_in = #{nowIn}</if>
  118. <if test="shouldSlow != null and shouldSlow != ''"> and vi.should_slow = #{shouldSlow}</if>
  119. <if test="createTime != null and createTime != ''"> and vi.create_time &gt;= #{startTime}</if>
  120. <if test="endTime != null and endTime != ''"> and vi.create_time &lt;= #{endTime}</if>
  121. <if test="shouldSlow != null and shouldSlow != ''"> and vi.should_slow = #{shouldSlow}</if>
  122. <if test="idCardS != null and idCardS.size() > 0">
  123. and vi.id_card in
  124. <foreach item="idCard" collection="idCardS" open="(" separator="," close=")">
  125. #{idCard}
  126. </foreach>
  127. </if>
  128. <if test="deptIdList != null and deptIdList.size() > 0">
  129. and vi.dept_id in
  130. <foreach item="deptId" collection="deptIdList" open="(" separator="," close=")">
  131. #{deptId}
  132. </foreach>
  133. </if>
  134. </where>
  135. order by vi.create_time DESC ,vi.vaccination_time DESC
  136. </select>
  137. <select id="listByXz" resultMap="VaccineInfoResult">
  138. select vi.id, vi.create_time, vi.update_time, vi.is_del, vi.update_by, vi.user_name, vi.phone_num, vi.id_card
  139. , vi.gender, vi.province, vi.city, vi.region, vi.now_in, vi.house_type, vi.update_by, vi.code
  140. from vaccine_info vi
  141. where vi.is_del = 'N' and vi.create_time &gt;= #{startTime} and vi.create_time &lt;= #{endTime}
  142. <if test="userName != null and userName != ''">
  143. and (vi.user_name like concat('%', #{userName}, '%') or vi.id_card like concat('%', #{userName}, '%'))
  144. </if>
  145. <if test="villageTowns != null and villageTowns != ''">
  146. and vi.village_towns = #{villageTowns}
  147. </if>
  148. <if test="village != null and village != ''"> and vi.village = #{village}</if>
  149. <if test="villagerGroup != null and villagerGroup != ''"> and vi.villager_group = #{villagerGroup}</if>
  150. <if test="houseType != null and houseType != ''"> and vi.house_type = #{houseType}</if>
  151. <if test="domicile != null and domicile != ''"> and vi.domicile = #{domicile}</if>
  152. <if test="province != null and province != ''"> and vi.province = #{province}</if>
  153. <if test="city != null and city != ''"> and vi.city = #{city}</if>
  154. <if test="jici != null and jici != ''"> and vi.jici &lt;= #{jici}</if>
  155. <if test="vaccineName != null and vaccineName != ''"> and vi.vaccine_name like concat('%', #{vaccineName}, '%')</if>
  156. <if test="vaccinationTime != null "> and DATE_FORMAT(vi.vaccination_time,'%Y-%m-%d') = DATE_FORMAT(#{vaccinationTime},'%Y-%m-%d')</if>
  157. <if test="region != null and region != ''"> and vi.region = #{region}</if>
  158. <!-- <if test="userName != null and userName != ''"> and vi.user_name like concat('%', #{userName}, '%')</if>-->
  159. <if test="gender != null and gender != ''"> and vi.gender = #{gender}</if>
  160. <if test="idCard != null and idCard != ''"> and vi.id_card like concat('%', #{idCard}, '%')</if>
  161. <if test="phoneNum != null and phoneNum != ''"> and vi.phone_num = #{phoneNum}</if>
  162. <if test="keyIndustries != null and keyIndustries != ''"> and vi.key_industries = #{keyIndustries}</if>
  163. <if test="isVaccination != null and isVaccination != ''"> and vi.is_vaccination = #{isVaccination}</if>
  164. <if test="params.startAge != null and params.startAge != ''"> and vi.age &gt;= #{params.startAge}</if>
  165. <if test="params.endAge != null and params.endAge != ''"> and vi.age &lt;= #{params.endAge}</if>
  166. <if test="contraindication != null and contraindication != ''"> and vi.contraindication = #{contraindication}</if>
  167. <if test="suspend != null and suspend != ''"> and vi.suspend = #{suspend}</if>
  168. <if test="shouldBe != null and shouldBe != ''"> and vi.should_be = #{shouldBe}</if>
  169. <if test="other != null and other != ''"> and vi.other = #{other}</if>
  170. <if test="status != null and status != ''"> and vi.status = #{status}</if>
  171. <if test="code != null and code != ''"> and vi.code = #{code}</if>
  172. <if test="birthday != null and birthday != ''"> and vi.birthday = #{birthday}</if>
  173. <if test="workUnit != null and workUnit != ''"> and vi.work_unit = #{workUnit}</if>
  174. <if test="crowdClassification != null and crowdClassification != ''"> and vi.crowd_classification = #{crowdClassification}</if>
  175. <if test="manufacturer != null and manufacturer != ''"> and vi.manufacturer = #{manufacturer}</if>
  176. <if test="nowIn != null and nowIn != ''"> and vi.now_in = #{nowIn}</if>
  177. <if test="shouldSlow != null and shouldSlow != ''"> and vi.should_slow = #{shouldSlow}</if>
  178. <if test="createTime != null and createTime != ''"> and vi.create_time &gt;= #{startTime}</if>
  179. <if test="endTime != null and endTime != ''"> and vi.create_time &lt;= #{endTime}</if>
  180. <if test="shouldSlow != null and shouldSlow != ''"> and vi.should_slow = #{shouldSlow}</if>
  181. <if test="idCardS != null and idCardS.size() > 0">
  182. and vi.id_card in
  183. <foreach item="idCard" collection="idCardS" open="(" separator="," close=")">
  184. #{idCard}
  185. </foreach>
  186. </if>
  187. <if test="deptIdList != null and deptIdList.size() > 0">
  188. and vi.dept_id in
  189. <foreach item="deptId" collection="deptIdList" open="(" separator="," close=")">
  190. #{deptId}
  191. </foreach>
  192. </if>
  193. </select>
  194. <select id="countByXz" resultType="int">
  195. select count(1)
  196. from vaccine_info vi
  197. where vi.is_del = 'N' and vi.create_time &gt;= #{startTime} and vi.create_time &lt;= #{endTime}
  198. <if test="villageTowns != null and villageTowns != ''">
  199. and vi.village_towns = #{villageTowns}
  200. </if>
  201. <if test="village != null and village != ''"> and vi.village = #{village}</if>
  202. <if test="villagerGroup != null and villagerGroup != ''"> and vi.villager_group = #{villagerGroup}</if>
  203. <if test="houseType != null and houseType != ''"> and vi.house_type = #{houseType}</if>
  204. <if test="domicile != null and domicile != ''"> and vi.domicile = #{domicile}</if>
  205. <if test="province != null and province != ''"> and vi.province = #{province}</if>
  206. <if test="city != null and city != ''"> and vi.city = #{city}</if>
  207. <if test="jici != null and jici != ''"> and vi.jici &lt;= #{jici}</if>
  208. <if test="vaccineName != null and vaccineName != ''"> and vi.vaccine_name like concat('%', #{vaccineName}, '%')</if>
  209. <if test="vaccinationTime != null "> and DATE_FORMAT(vi.vaccination_time,'%Y-%m-%d') = DATE_FORMAT(#{vaccinationTime},'%Y-%m-%d')</if>
  210. <if test="region != null and region != ''"> and vi.region = #{region}</if>
  211. <if test="userName != null and userName != ''"> and vi.user_name like concat('%', #{userName}, '%')</if>
  212. <if test="gender != null and gender != ''"> and vi.gender = #{gender}</if>
  213. <if test="idCard != null and idCard != ''"> and vi.id_card like concat('%', #{idCard}, '%')</if>
  214. <if test="phoneNum != null and phoneNum != ''"> and vi.phone_num = #{phoneNum}</if>
  215. <if test="keyIndustries != null and keyIndustries != ''"> and vi.key_industries = #{keyIndustries}</if>
  216. <if test="isVaccination != null and isVaccination != ''"> and vi.is_vaccination = #{isVaccination}</if>
  217. <if test="params.startAge != null and params.startAge != ''"> and vi.age &gt;= #{params.startAge}</if>
  218. <if test="params.endAge != null and params.endAge != ''"> and vi.age &lt;= #{params.endAge}</if>
  219. <if test="contraindication != null and contraindication != ''"> and vi.contraindication = #{contraindication}</if>
  220. <if test="suspend != null and suspend != ''"> and vi.suspend = #{suspend}</if>
  221. <if test="shouldBe != null and shouldBe != ''"> and vi.should_be = #{shouldBe}</if>
  222. <if test="other != null and other != ''"> and vi.other = #{other}</if>
  223. <if test="status != null and status != ''"> and vi.status = #{status}</if>
  224. <if test="code != null and code != ''"> and vi.code = #{code}</if>
  225. <if test="birthday != null and birthday != ''"> and vi.birthday = #{birthday}</if>
  226. <if test="workUnit != null and workUnit != ''"> and vi.work_unit = #{workUnit}</if>
  227. <if test="crowdClassification != null and crowdClassification != ''"> and vi.crowd_classification = #{crowdClassification}</if>
  228. <if test="manufacturer != null and manufacturer != ''"> and vi.manufacturer = #{manufacturer}</if>
  229. <if test="nowIn != null and nowIn != ''"> and vi.now_in = #{nowIn}</if>
  230. <if test="shouldSlow != null and shouldSlow != ''"> and vi.should_slow = #{shouldSlow}</if>
  231. <if test="createTime != null and createTime != ''"> and vi.create_time &gt;= #{startTime}</if>
  232. <if test="endTime != null and endTime != ''"> and vi.create_time &lt;= #{endTime}</if>
  233. <if test="shouldSlow != null and shouldSlow != ''"> and vi.should_slow = #{shouldSlow}</if>
  234. <if test="idCardS != null and idCardS.size() > 0">
  235. and vi.id_card in
  236. <foreach item="idCard" collection="idCardS" open="(" separator="," close=")">
  237. #{idCard}
  238. </foreach>
  239. </if>
  240. <if test="deptIdList != null and deptIdList.size() > 0">
  241. and vi.dept_id in
  242. <foreach item="deptId" collection="deptIdList" open="(" separator="," close=")">
  243. #{deptId}
  244. </foreach>
  245. </if>
  246. </select>
  247. <select id="listByJs" resultMap="VaccineInfoResult">
  248. select vi.id, vi.create_time, vi.update_time, vi.is_del, vi.update_by, vi.user_name, vi.phone_num, vi.id_card
  249. , vi.gender, vi.province, vi.city, vi.region, vi.now_in, vi.house_type, vi.update_by, vi.code
  250. from vaccine_info vi
  251. where vi.is_del = 'Y' and vi.update_time &gt;= #{startTime} and vi.update_time &lt;= #{endTime}
  252. <if test="userName != null and userName != ''">
  253. and (vi.user_name like concat('%', #{userName}, '%') or vi.id_card like concat('%', #{userName}, '%'))
  254. </if>
  255. <if test="villageTowns != null and villageTowns != ''">
  256. and vi.village_towns = #{villageTowns}
  257. </if>
  258. <if test="village != null and village != ''"> and vi.village = #{village}</if>
  259. <if test="villagerGroup != null and villagerGroup != ''"> and vi.villager_group = #{villagerGroup}</if>
  260. <if test="houseType != null and houseType != ''"> and vi.house_type = #{houseType}</if>
  261. <if test="domicile != null and domicile != ''"> and vi.domicile = #{domicile}</if>
  262. <if test="province != null and province != ''"> and vi.province = #{province}</if>
  263. <if test="city != null and city != ''"> and vi.city = #{city}</if>
  264. <if test="jici != null and jici != ''"> and vi.jici &lt;= #{jici}</if>
  265. <if test="vaccineName != null and vaccineName != ''"> and vi.vaccine_name like concat('%', #{vaccineName}, '%')</if>
  266. <if test="vaccinationTime != null "> and DATE_FORMAT(vi.vaccination_time,'%Y-%m-%d') = DATE_FORMAT(#{vaccinationTime},'%Y-%m-%d')</if>
  267. <if test="region != null and region != ''"> and vi.region = #{region}</if>
  268. <!--<if test="userName != null and userName != ''"> and vi.user_name like concat('%', #{userName}, '%')</if>-->
  269. <if test="gender != null and gender != ''"> and vi.gender = #{gender}</if>
  270. <if test="idCard != null and idCard != ''"> and vi.id_card like concat('%', #{idCard}, '%')</if>
  271. <if test="phoneNum != null and phoneNum != ''"> and vi.phone_num = #{phoneNum}</if>
  272. <if test="keyIndustries != null and keyIndustries != ''"> and vi.key_industries = #{keyIndustries}</if>
  273. <if test="isVaccination != null and isVaccination != ''"> and vi.is_vaccination = #{isVaccination}</if>
  274. <if test="params.startAge != null and params.startAge != ''"> and vi.age &gt;= #{params.startAge}</if>
  275. <if test="params.endAge != null and params.endAge != ''"> and vi.age &lt;= #{params.endAge}</if>
  276. <if test="contraindication != null and contraindication != ''"> and vi.contraindication = #{contraindication}</if>
  277. <if test="suspend != null and suspend != ''"> and vi.suspend = #{suspend}</if>
  278. <if test="shouldBe != null and shouldBe != ''"> and vi.should_be = #{shouldBe}</if>
  279. <if test="other != null and other != ''"> and vi.other = #{other}</if>
  280. <if test="status != null and status != ''"> and vi.status = #{status}</if>
  281. <if test="code != null and code != ''"> and vi.code = #{code}</if>
  282. <if test="birthday != null and birthday != ''"> and vi.birthday = #{birthday}</if>
  283. <if test="workUnit != null and workUnit != ''"> and vi.work_unit = #{workUnit}</if>
  284. <if test="crowdClassification != null and crowdClassification != ''"> and vi.crowd_classification = #{crowdClassification}</if>
  285. <if test="manufacturer != null and manufacturer != ''"> and vi.manufacturer = #{manufacturer}</if>
  286. <if test="nowIn != null and nowIn != ''"> and vi.now_in = #{nowIn}</if>
  287. <if test="shouldSlow != null and shouldSlow != ''"> and vi.should_slow = #{shouldSlow}</if>
  288. <if test="createTime != null and createTime != ''"> and vi.create_time &gt;= #{startTime}</if>
  289. <if test="endTime != null and endTime != ''"> and vi.create_time &lt;= #{endTime}</if>
  290. <if test="shouldSlow != null and shouldSlow != ''"> and vi.should_slow = #{shouldSlow}</if>
  291. <if test="idCardS != null and idCardS.size() > 0">
  292. and vi.id_card in
  293. <foreach item="idCard" collection="idCardS" open="(" separator="," close=")">
  294. #{idCard}
  295. </foreach>
  296. </if>
  297. <if test="deptIdList != null and deptIdList.size() > 0">
  298. and vi.dept_id in
  299. <foreach item="deptId" collection="deptIdList" open="(" separator="," close=")">
  300. #{deptId}
  301. </foreach>
  302. </if>
  303. </select>
  304. <select id="countByJs" resultType="int">
  305. select count(1)
  306. from vaccine_info vi
  307. where vi.is_del = 'Y' and vi.update_time &gt;= #{startTime} and vi.update_time &lt;= #{endTime}
  308. <if test="villageTowns != null and villageTowns != ''">
  309. and vi.village_towns = #{villageTowns}
  310. </if>
  311. <if test="village != null and village != ''"> and vi.village = #{village}</if>
  312. <if test="villagerGroup != null and villagerGroup != ''"> and vi.villager_group = #{villagerGroup}</if>
  313. <if test="houseType != null and houseType != ''"> and vi.house_type = #{houseType}</if>
  314. <if test="domicile != null and domicile != ''"> and vi.domicile = #{domicile}</if>
  315. <if test="province != null and province != ''"> and vi.province = #{province}</if>
  316. <if test="city != null and city != ''"> and vi.city = #{city}</if>
  317. <if test="jici != null and jici != ''"> and vi.jici &lt;= #{jici}</if>
  318. <if test="vaccineName != null and vaccineName != ''"> and vi.vaccine_name like concat('%', #{vaccineName}, '%')</if>
  319. <if test="vaccinationTime != null "> and DATE_FORMAT(vi.vaccination_time,'%Y-%m-%d') = DATE_FORMAT(#{vaccinationTime},'%Y-%m-%d')</if>
  320. <if test="region != null and region != ''"> and vi.region = #{region}</if>
  321. <if test="userName != null and userName != ''"> and vi.user_name like concat('%', #{userName}, '%')</if>
  322. <if test="gender != null and gender != ''"> and vi.gender = #{gender}</if>
  323. <if test="idCard != null and idCard != ''"> and vi.id_card like concat('%', #{idCard}, '%')</if>
  324. <if test="phoneNum != null and phoneNum != ''"> and vi.phone_num = #{phoneNum}</if>
  325. <if test="keyIndustries != null and keyIndustries != ''"> and vi.key_industries = #{keyIndustries}</if>
  326. <if test="isVaccination != null and isVaccination != ''"> and vi.is_vaccination = #{isVaccination}</if>
  327. <if test="params.startAge != null and params.startAge != ''"> and vi.age &gt;= #{params.startAge}</if>
  328. <if test="params.endAge != null and params.endAge != ''"> and vi.age &lt;= #{params.endAge}</if>
  329. <if test="contraindication != null and contraindication != ''"> and vi.contraindication = #{contraindication}</if>
  330. <if test="suspend != null and suspend != ''"> and vi.suspend = #{suspend}</if>
  331. <if test="shouldBe != null and shouldBe != ''"> and vi.should_be = #{shouldBe}</if>
  332. <if test="other != null and other != ''"> and vi.other = #{other}</if>
  333. <if test="status != null and status != ''"> and vi.status = #{status}</if>
  334. <if test="code != null and code != ''"> and vi.code = #{code}</if>
  335. <if test="birthday != null and birthday != ''"> and vi.birthday = #{birthday}</if>
  336. <if test="workUnit != null and workUnit != ''"> and vi.work_unit = #{workUnit}</if>
  337. <if test="crowdClassification != null and crowdClassification != ''"> and vi.crowd_classification = #{crowdClassification}</if>
  338. <if test="manufacturer != null and manufacturer != ''"> and vi.manufacturer = #{manufacturer}</if>
  339. <if test="nowIn != null and nowIn != ''"> and vi.now_in = #{nowIn}</if>
  340. <if test="shouldSlow != null and shouldSlow != ''"> and vi.should_slow = #{shouldSlow}</if>
  341. <if test="createTime != null and createTime != ''"> and vi.create_time &gt;= #{startTime}</if>
  342. <if test="endTime != null and endTime != ''"> and vi.create_time &lt;= #{endTime}</if>
  343. <if test="shouldSlow != null and shouldSlow != ''"> and vi.should_slow = #{shouldSlow}</if>
  344. <if test="idCardS != null and idCardS.size() > 0">
  345. and vi.id_card in
  346. <foreach item="idCard" collection="idCardS" open="(" separator="," close=")">
  347. #{idCard}
  348. </foreach>
  349. </if>
  350. <if test="deptIdList != null and deptIdList.size() > 0">
  351. and vi.dept_id in
  352. <foreach item="deptId" collection="deptIdList" open="(" separator="," close=")">
  353. #{deptId}
  354. </foreach>
  355. </if>
  356. </select>
  357. <select id="countCzrk" resultType="int">
  358. select count(vi.id)
  359. from vaccine_info vi
  360. where vi.is_del = 'N'
  361. <!-- 已认领 -->
  362. <if test="ryrl == true">and (vi.village_towns is not null or vi.village_towns != '')</if>
  363. <if test="deptIdList != null and deptIdList.size() > 0">
  364. and vi.dept_id in
  365. <foreach item="deptId" collection="deptIdList" open="(" separator="," close=")">
  366. #{deptId}
  367. </foreach>
  368. </if>
  369. </select>
  370. <select id="countIdCard" resultType="int">
  371. select count(vi.id) from vaccine_info vi where vi.is_del = 'N' and id_card = #{idCard}
  372. </select>
  373. <select id="listByCode" resultMap="VaccineInfoResult">
  374. select vi.id, vi.user_name, vi.phone_num, vi.id_card, vi.gender, vi.province, vi.city, vi.region, vi.now_in
  375. , vi.house_type, vi.update_by, vi.code, vi.rlr
  376. from vaccine_info vi
  377. where vi.is_del = 'N' and code = #{code}
  378. </select>
  379. <select id="listByRlry" resultMap="VaccineInfoResult">
  380. select vi.id, vi.user_name, vi.phone_num, vi.id_card, vi.gender, vi.province, vi.city, vi.region, vi.now_in
  381. , vi.house_type, vi.update_by, vi.code, vi.rlr, vi.update_time, vi.delete_reason
  382. from vaccine_info vi
  383. <where>
  384. vi.is_del = #{isDel}
  385. <!-- 已认领 -->
  386. <if test="ryrl == true">and (vi.village_towns is not null or vi.village_towns != '')</if>
  387. <!-- 未认领 -->
  388. <if test="ryrl == false">and (vi.village_towns is null or vi.village_towns = '')</if>
  389. <if test="villageTowns != null and villageTowns != ''">and vi.village_towns = #{villageTowns}</if>
  390. <if test="village != null and village != ''">and vi.village = #{village}</if>
  391. <if test="houseType != null and houseType != ''">and vi.house_type = #{houseType}</if>
  392. <if test="domicile != null and domicile != ''">and vi.domicile = #{domicile}</if>
  393. <if test="province != null and province != ''">and vi.province = #{province}</if>
  394. <if test="city != null and city != ''">and vi.city = #{city}</if>
  395. <if test="jici != null and jici != ''">and vi.jici &lt;= #{jici}</if>
  396. <if test="vaccineName != null and vaccineName != ''">and vi.vaccine_name like concat('%', #{vaccineName},
  397. '%')
  398. </if>
  399. <if test="vaccinationTime != null ">and DATE_FORMAT(vi.vaccination_time,'%Y-%m-%d') =
  400. DATE_FORMAT(#{vaccinationTime},'%Y-%m-%d')
  401. </if>
  402. <if test="region != null and region != ''">and vi.region = #{region}</if>
  403. <!--小程序,一个搜索框既可以搜索姓名,也可以搜索身份证-->
  404. <if test="userName != null and userName != ''">
  405. and (vi.user_name like concat('%', #{userName}, '%') or vi.id_card like concat('%', #{userName}, '%'))
  406. </if>
  407. <if test="gender != null and gender != ''">and vi.gender = #{gender}</if>
  408. <if test="idCard != null and idCard != ''">and vi.id_card like concat('%', #{idCard}, '%')</if>
  409. <if test="phoneNum != null and phoneNum != ''">and vi.phone_num = #{phoneNum}</if>
  410. <if test="keyIndustries != null and keyIndustries != ''">and vi.key_industries = #{keyIndustries}</if>
  411. <if test="isVaccination != null and isVaccination != ''">and vi.is_vaccination = #{isVaccination}</if>
  412. <if test="params.startAge != null and params.startAge != ''">and vi.age &gt;= #{params.startAge}</if>
  413. <if test="params.endAge != null and params.endAge != ''">and vi.age &lt;= #{params.endAge}</if>
  414. <if test="contraindication != null and contraindication != ''">and vi.contraindication = #{contraindication}</if>
  415. <if test="suspend != null and suspend != ''">and vi.suspend = #{suspend}</if>
  416. <if test="shouldBe != null and shouldBe != ''">and vi.should_be = #{shouldBe}</if>
  417. <if test="other != null and other != ''">and vi.other = #{other}</if>
  418. <if test="status != null and status != ''">and vi.status = #{status}</if>
  419. <if test="code != null and code != ''">and vi.code = #{code}</if>
  420. <if test="birthday != null and birthday != ''">and vi.birthday = #{birthday}</if>
  421. <if test="workUnit != null and workUnit != ''">and vi.work_unit = #{workUnit}</if>
  422. <if test="crowdClassification != null and crowdClassification != ''">and vi.crowd_classification =
  423. #{crowdClassification}
  424. </if>
  425. <if test="manufacturer != null and manufacturer != ''">and vi.manufacturer = #{manufacturer}</if>
  426. <if test="nowIn != null and nowIn != ''">and vi.now_in = #{nowIn}</if>
  427. <if test="shouldSlow != null and shouldSlow != ''">and vi.should_slow = #{shouldSlow}</if>
  428. <if test="idCardS != null and idCardS.size() > 0">
  429. and vi.id_card in
  430. <foreach item="idCard" collection="idCardS" open="(" separator="," close=")">
  431. #{idCard}
  432. </foreach>
  433. </if>
  434. <if test="deptIdList != null and deptIdList.size() > 0">
  435. and vi.dept_id in
  436. <foreach item="deptId" collection="deptIdList" open="(" separator="," close=")">
  437. #{deptId}
  438. </foreach>
  439. </if>
  440. </where>
  441. order by vi.create_time DESC ,vi.vaccination_time DESC
  442. </select>
  443. <select id="stsByYrl" resultType="int">
  444. select count(vi.id)
  445. from vaccine_info vi
  446. where vi.is_del = 'N'
  447. <!-- 已认领 -->
  448. and (vi.village_towns is not null or vi.village_towns != '')
  449. <if test="userName != null and userName != ''">
  450. and (vi.user_name like concat('%', #{userName}, '%') or vi.id_card like concat('%', #{userName}, '%'))
  451. </if>
  452. <if test="deptIdList != null and deptIdList.size() > 0">
  453. and vi.dept_id in
  454. <foreach item="deptId" collection="deptIdList" open="(" separator="," close=")">
  455. #{deptId}
  456. </foreach>
  457. </if>
  458. </select>
  459. <select id="stsByWrl" resultType="int">
  460. select count(vi.id)
  461. from vaccine_info vi
  462. where vi.is_del = 'N'
  463. <!-- 未认领 -->
  464. and (vi.village_towns is null or vi.village_towns = '')
  465. <if test="userName != null and userName != ''">
  466. and (vi.user_name like concat('%', #{userName}, '%') or vi.id_card like concat('%', #{userName}, '%'))
  467. </if>
  468. <if test="deptIdList != null and deptIdList.size() > 0">
  469. and vi.dept_id in
  470. <foreach item="deptId" collection="deptIdList" open="(" separator="," close=")">
  471. #{deptId}
  472. </foreach>
  473. </if>
  474. </select>
  475. <update id="deleteCzrk">
  476. update vaccine_info
  477. set is_del = 'Y'
  478. , delete_reason = #{deleteReason}
  479. , update_by = #{updateBy}
  480. , update_time = sysdate()
  481. where id = #{id}
  482. </update>
  483. <update id="reduction">
  484. update vaccine_info
  485. set is_del = 'N'
  486. , update_by = #{updateBy}
  487. , update_time = sysdate()
  488. where id = #{id}
  489. </update>
  490. <select id="selectVaccineInfoListByPage" parameterType="Integer" resultMap="VaccineInfoResult">
  491. select * from vaccine_info limit #{startNum}, #{endNum}
  492. </select>
  493. <select id="selectVaccineInfoById" parameterType="Long" resultMap="VaccineInfoResult">
  494. <include refid="selectVaccineInfoVo"/>
  495. where vi.id = #{id} and vi.is_del = 'N'
  496. order by viu.vaccination_time
  497. </select>
  498. <select id="selectVaccineInfoByIdCard" parameterType="String" resultMap="VaccineInfoResult">
  499. <include refid="selectVaccineInfoVo"/>
  500. where vi.id_card = #{idCard} and vi.is_del = 'N'
  501. order by viu.vaccination_time
  502. </select>
  503. <select id="selectVaccineInfoByIds" parameterType="Long" resultMap="VaccineInfoResult">
  504. <include refid="selectVaccineInfoVo"/>
  505. where vi.id in
  506. <foreach item="id" collection="array" open="(" separator="," close=")">
  507. #{id}
  508. </foreach>
  509. and vi.is_del = 'N'
  510. </select>
  511. <insert id="insertVaccineInfo" useGeneratedKeys="true" keyProperty="id">
  512. insert into vaccine_info
  513. <trim prefix="(" suffix=")" suffixOverrides=",">
  514. <if test="villageTowns != null">village_towns,</if>
  515. <if test="village != null">village,</if>
  516. <if test="villagerGroup != null">villager_group,</if>
  517. <if test="houseType != null">house_type,</if>
  518. <if test="domicile != null">domicile,</if>
  519. <if test="province != null">province,</if>
  520. <if test="city != null">city,</if>
  521. <if test="region != null and region != ''">region,</if>
  522. <if test="userName != null">user_name,</if>
  523. <if test="gender != null">gender,</if>
  524. <if test="idCard != null">id_card,</if>
  525. <if test="phoneNum != null">phone_num,</if>
  526. <if test="keyIndustries != null">key_industries,</if>
  527. <if test="isVaccination != null">is_vaccination,</if>
  528. <if test="vaccineName != null">vaccine_name,</if>
  529. <if test="jici != null">jici,</if>
  530. <if test="vaccinationTime != null">vaccination_time,</if>
  531. <if test="vaccinationPlace != null">vaccination_place,</if>
  532. <if test="contraindication != null">contraindication,</if>
  533. <if test="suspend != null">suspend,</if>
  534. <if test="shouldBe != null">should_be,</if>
  535. <if test="other != null">other,</if>
  536. <if test="progress != null">progress,</if>
  537. <if test="remark != null">remark,</if>
  538. <if test="status != null">status,</if>
  539. <if test="createBy != null">create_by,</if>
  540. <if test="updateBy != null">update_by,</if>
  541. <if test="updateTime != null">update_time,</if>
  542. <if test="isDel != null and isDel != ''">is_del,</if>
  543. <if test="code != null and code != ''">code,</if>
  544. <if test="birthday != null and birthday != ''">birthday,</if>
  545. <if test="workUnit != null and workUnit != ''">work_unit,</if>
  546. <if test="crowdClassification != null and crowdClassification != ''">crowd_classification,</if>
  547. <if test="manufacturer != null and manufacturer != ''">manufacturer,</if>
  548. <if test="nowIn != null and nowIn != ''">now_in,</if>
  549. <if test="url != null and url != ''">url,</if>
  550. <if test="shouldSlow != null and shouldSlow != ''">should_slow,</if>
  551. <if test="suspendUrl != null and suspendUrl != ''">suspend_url,</if>
  552. <if test="otherUrl != null and otherUrl != ''">other_url,</if>
  553. <if test="age != null and age != ''">age,</if>
  554. <if test="deptId != null">dept_id,</if>
  555. <if test="deleteReason != null">delete_reason,</if>
  556. create_time
  557. </trim>
  558. <trim prefix="values (" suffix=")" suffixOverrides=",">
  559. <if test="villageTowns != null">#{villageTowns},</if>
  560. <if test="village != null">#{village},</if>
  561. <if test="villagerGroup != null">#{villagerGroup},</if>
  562. <if test="houseType != null">#{houseType},</if>
  563. <if test="domicile != null">#{domicile},</if>
  564. <if test="province != null">#{province},</if>
  565. <if test="city != null">#{city},</if>
  566. <if test="region != null and region != ''">#{region},</if>
  567. <if test="userName != null">#{userName},</if>
  568. <if test="gender != null">#{gender},</if>
  569. <if test="idCard != null">#{idCard},</if>
  570. <if test="phoneNum != null">#{phoneNum},</if>
  571. <if test="keyIndustries != null">#{keyIndustries},</if>
  572. <if test="isVaccination != null">#{isVaccination},</if>
  573. <if test="vaccineName != null">#{vaccineName},</if>
  574. <if test="jici != null">#{jici},</if>
  575. <if test="vaccinationTime != null">#{vaccinationTime},</if>
  576. <if test="vaccinationPlace != null">#{vaccinationPlace},</if>
  577. <if test="contraindication != null">#{contraindication},</if>
  578. <if test="suspend != null">#{suspend},</if>
  579. <if test="shouldBe != null">#{shouldBe},</if>
  580. <if test="other != null">#{other},</if>
  581. <if test="progress != null">#{progress},</if>
  582. <if test="remark != null">#{remark},</if>
  583. <if test="status != null">#{status},</if>
  584. <if test="createBy != null">#{createBy},</if>
  585. <if test="updateBy != null">#{updateBy},</if>
  586. <if test="updateTime != null">#{updateTime},</if>
  587. <if test="isDel != null and isDel != ''">#{isDel},</if>
  588. <if test="code != null and code != ''">#{code},</if>
  589. <if test="birthday != null and birthday != ''">#{birthday},</if>
  590. <if test="workUnit != null and workUnit != ''">#{workUnit},</if>
  591. <if test="crowdClassification != null and crowdClassification != ''">#{crowdClassification},</if>
  592. <if test="manufacturer != null and manufacturer != ''">#{manufacturer},</if>
  593. <if test="nowIn != null and nowIn != ''">#{nowIn},</if>
  594. <if test="url != null and url != ''">#{url},</if>
  595. <if test="shouldSlow != null and shouldSlow != ''">#{shouldSlow},</if>
  596. <if test="suspendUrl != null and suspendUrl != ''">#{suspendUrl},</if>
  597. <if test="otherUrl != null and otherUrl != ''">#{otherUrl},</if>
  598. <if test="age != null and age != ''">#{age},</if>
  599. <if test="deptId != null">#{deptId},</if>
  600. <if test="deleteReason != null">#{deleteReason},</if>
  601. sysdate()
  602. </trim>
  603. </insert>
  604. <update id="updateVaccineInfo" >
  605. update vaccine_info
  606. <trim prefix="SET" suffixOverrides=",">
  607. <if test="villageTowns != null">village_towns = #{villageTowns},</if>
  608. <if test="village != null">village = #{village},</if>
  609. <if test="villagerGroup != null">villager_group = #{villagerGroup},</if>
  610. <if test="houseType != null">house_type = #{houseType},</if>
  611. <if test="domicile != null">domicile = #{domicile},</if>
  612. <if test="province != null">province = #{province},</if>
  613. <if test="city != null">city = #{city},</if>
  614. <if test="region != null and region != ''">region = #{region},</if>
  615. <if test="userName != null">user_name = #{userName},</if>
  616. <if test="gender != null">gender = #{gender},</if>
  617. <if test="idCard != null">id_card = #{idCard},</if>
  618. <if test="phoneNum != null">phone_num = #{phoneNum},</if>
  619. <if test="keyIndustries != null">key_industries = #{keyIndustries},</if>
  620. <if test="isVaccination != null">is_vaccination = #{isVaccination},</if>
  621. <if test="vaccineName != null">vaccine_name = #{vaccineName},</if>
  622. <if test="jici != null">jici = #{jici},</if>
  623. <if test="vaccinationTime != null">vaccination_time = #{vaccinationTime},</if>
  624. <if test="vaccinationPlace != null">vaccination_place = #{vaccinationPlace},</if>
  625. <if test="contraindication != null">contraindication = #{contraindication},</if>
  626. <if test="suspend != null">suspend = #{suspend},</if>
  627. <if test="shouldBe != null">should_be = #{shouldBe},</if>
  628. <if test="other != null">other = #{other},</if>
  629. <if test="progress != null">progress = #{progress},</if>
  630. <if test="remark != null">remark = #{remark},</if>
  631. <if test="status != null">status = #{status},</if>
  632. <if test="createBy != null">create_by = #{createBy},</if>
  633. <if test="createTime != null">create_time = #{createTime},</if>
  634. <if test="updateBy != null">update_by = #{updateBy},</if>
  635. <if test="updateTime != null">update_time = sysdate(),</if>
  636. <if test="isDel != null and isDel != ''">is_del = #{isDel},</if>
  637. <if test="code != null and code != ''">code = #{code},</if>
  638. <if test="birthday != null and birthday != ''">birthday = #{birthday},</if>
  639. <if test="workUnit != null and workUnit != ''">work_unit = #{workUnit},</if>
  640. <if test="crowdClassification != null and crowdClassification != ''">crowd_classification = #{crowdClassification},</if>
  641. <if test="manufacturer != null and manufacturer != ''">manufacturer = #{manufacturer},</if>
  642. <if test="nowIn != null and nowIn != ''">now_in = #{nowIn},</if>
  643. <if test="url != null and url != ''">url = #{url},</if>
  644. <if test="shouldSlow != null and shouldSlow != ''">should_slow = #{shouldSlow},</if>
  645. <if test="suspendUrl != null and suspendUrl != ''">suspend_url = #{suspendUrl},</if>
  646. <if test="otherUrl != null and otherUrl != ''">other_url = #{otherUrl},</if>
  647. <if test="age != null and age != ''">age = #{age},</if>
  648. <if test="deptId != null">dept_id = #{deptId},</if>
  649. <if test="rlr != null and rlr != ''">rlr = #{rlr},</if>
  650. <if test="deleteReason != null and deleteReason != ''">delete_reason = #{deleteReason},</if>
  651. </trim>
  652. where id = #{id}
  653. </update>
  654. <update id="update" >
  655. update vaccine_info
  656. <trim prefix="SET" suffixOverrides=",">
  657. <if test="villageTowns != null">village_towns = #{villageTowns},</if>
  658. <if test="village != null">village = #{village},</if>
  659. <if test="villagerGroup != null">villager_group = #{villagerGroup},</if>
  660. <if test="houseType != null">house_type = #{houseType},</if>
  661. <if test="domicile != null">domicile = #{domicile},</if>
  662. <if test="province != null">province = #{province},</if>
  663. <if test="city != null">city = #{city},</if>
  664. <if test="region != null and region != ''">region = #{region},</if>
  665. <if test="userName != null">user_name = #{userName},</if>
  666. <if test="gender != null">gender = #{gender},</if>
  667. <!-- <if SysRegion="idCard != null">id_card = #{idCard},</if>-->
  668. <if test="phoneNum != null">phone_num = #{phoneNum},</if>
  669. <if test="keyIndustries != null">key_industries = #{keyIndustries},</if>
  670. <if test="isVaccination != null">is_vaccination = #{isVaccination},</if>
  671. <if test="vaccineName != null">vaccine_name = #{vaccineName},</if>
  672. <if test="jici != null">jici = #{jici},</if>
  673. <if test="vaccinationTime != null">vaccination_time = #{vaccinationTime},</if>
  674. <if test="vaccinationPlace != null">vaccination_place = #{vaccinationPlace},</if>
  675. <if test="contraindication != null">contraindication = #{contraindication},</if>
  676. <if test="suspend != null">suspend = #{suspend},</if>
  677. <if test="shouldBe != null">should_be = #{shouldBe},</if>
  678. <if test="other != null">other = #{other},</if>
  679. <if test="progress != null">progress = #{progress},</if>
  680. <if test="remark != null">remark = #{remark},</if>
  681. <if test="status != null">status = #{status},</if>
  682. <if test="createBy != null">create_by = #{createBy},</if>
  683. <if test="createTime != null">create_time = #{createTime},</if>
  684. <if test="updateBy != null">update_by = #{updateBy},</if>
  685. <if test="updateTime != null">update_time = #{updateTime},</if>
  686. <if test="isDel != null and isDel != ''">is_del = #{isDel},</if>
  687. <if test="code != null and code != ''">code = #{code},</if>
  688. <if test="birthday != null and birthday != ''">birthday = #{birthday},</if>
  689. <if test="workUnit != null and workUnit != ''">work_unit = #{workUnit},</if>
  690. <if test="crowdClassification != null and crowdClassification != ''">crowd_classification = #{crowdClassification},</if>
  691. <if test="manufacturer != null and manufacturer != ''">manufacturer = #{manufacturer},</if>
  692. <if test="nowIn != null and nowIn != ''">now_in = #{nowIn},</if>
  693. <if test="url != null and url != ''">url = #{url},</if>
  694. <if test="shouldSlow != null and shouldSlow != ''">should_slow = #{shouldSlow},</if>
  695. <if test="suspendUrl != null and suspendUrl != ''">suspend_url = #{suspendUrl},</if>
  696. <if test="otherUrl != null and otherUrl != ''">other_url = #{otherUrl},</if>
  697. <if test="age != null and age != ''">age = #{age},</if>
  698. <if test="deptId != null">dept_id = #{deptId},</if>
  699. </trim>
  700. where code = #{code} or (id_card like concat('%', #{idCard}, '%') and user_name like concat('%', #{userName}, '%'))
  701. </update>
  702. <delete id="deleteVaccineInfoById" parameterType="Long">
  703. update vaccine_info set is_del = 'Y' where id = #{id}
  704. </delete>
  705. <delete id="deleteVaccineInfoByIds" parameterType="String">
  706. update vaccine_info set is_del = 'Y' where id in
  707. <foreach item="id" collection="array" open="(" separator="," close=")">
  708. #{id}
  709. </foreach>
  710. </delete>
  711. <select id="findHjInfo" resultMap="VaccineInfoResult">
  712. select id, user_name ,gender, birthday,age,code from vaccine_info
  713. <where>
  714. is_del = 'N'
  715. <if test="idCard != null and idCard != '' "> and id_card = #{idCard}</if>
  716. </where>
  717. limit 1
  718. </select>
  719. <select id="selectSysDictDataByDictLabel" parameterType="string" resultType="String">
  720. select dict_value from sys_dict_data where dict_label = #{vaccineName} and status = '0'
  721. </select>
  722. <select id="listByTotalTaskCnt" resultMap="VaccineInfoResult">
  723. SELECT id_card, village_towns, vaccination_time, age, jici, vaccine_name
  724. FROM vaccine_info
  725. WHERE age > 18
  726. </select>
  727. <select id="getByIdCard" resultMap="VaccineInfoResult">
  728. select * from vaccine_info where id_card = #{idCard} limit 1;
  729. </select>
  730. <!-- AND (-->
  731. <!-- contraindication IS NULL-->
  732. <!-- OR suspend IS NULL-->
  733. <!-- OR other IS NULL-->
  734. <!-- );-->
  735. </mapper>