VaccineInfoMapper.xml 30 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497
  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="userName" column="user_name" />
  19. <result property="gender" column="gender" />
  20. <result property="idCard" column="id_card" />
  21. <result property="phoneNum" column="phone_num" />
  22. <result property="keyIndustries" column="key_industries" />
  23. <result property="isVaccination" column="is_vaccination" />
  24. <result property="contraindication" column="contraindication" />
  25. <result property="suspend" column="suspend" />
  26. <result property="shouldBe" column="should_be" />
  27. <result property="other" column="other" />
  28. <result property="remark" column="remark" />
  29. <result property="status" column="status" />
  30. <result property="createBy" column="create_by" />
  31. <result property="createTime" column="create_time" />
  32. <result property="updateBy" column="update_by" />
  33. <result property="updateTime" column="update_time" />
  34. <result property="isDel" column="is_del" />
  35. <result property="code" column="code" />
  36. <result property="birthday" column="birthday" />
  37. <result property="workUnit" column="work_unit" />
  38. <result property="crowdClassification" column="crowd_classification" />
  39. <result property="manufacturer" column="manufacturer" />
  40. <result property="nowIn" column="now_in" />
  41. <result property="url" column="url" />
  42. <result property="jici" column="jici" />
  43. <result property="suspendUrl" column="suspend_url" />
  44. <result property="otherUrl" column="other_url" />
  45. <result property="shouldSlow" column="should_slow" />
  46. <result property="vaccinationTime" column="vaccination_time" />
  47. <result property="progress" column="progress" />
  48. <result property="deptId" column="dept_id" />
  49. <collection property="vaccineInfoUserList" javaType="java.util.List" resultMap="VaccineInfoUser" />
  50. </resultMap>
  51. <resultMap id="VaccineInfoUser" type="com.boman.domain.VaccineInfoUser">
  52. <id property="id" column="id_user" />
  53. <result property="idCard" column="id_card_user" />
  54. <result property="vaccineName" column="vaccine_name_user" />
  55. <result property="jici" column="jici_user" />
  56. <result property="vaccinationTime" column="vaccination_time_user" />
  57. <result property="vaccinationPlace" column="vaccination_place_user" />
  58. <result property="progress" column="progress_user" />
  59. <result property="url" column="url_user" />
  60. <result property="status" column="status_user" />
  61. </resultMap>
  62. <sql id="selectVaccineInfoVo">
  63. select vi.id, vi.village_towns, vi.village, vi.villager_group,vi.age, vi.house_type, vi.domicile, vi.province, vi.city,
  64. vi.region, vi.user_name, vi.gender, vi.id_card, vi.phone_num, vi.key_industries, vi.is_vaccination, vi.vaccine_name, vi.jici,
  65. vi.vaccination_time, vi.vaccination_place, vi.contraindication, vi.suspend,vi.suspend_url,vi.other_url,vi.vaccination_time,
  66. vi.should_be, vi.other, vi.progress, vi.remark, vi.status, vi.create_by, vi.create_time, vi.update_by, vi.update_time,
  67. vi.is_del,vi.code,vi.birthday,vi.work_unit,vi.crowd_classification,vi.manufacturer,vi.now_in,vi.url,vi.dept_id,
  68. 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,
  69. viu.vaccination_place as vaccination_place_user,viu.progress as progress_user,viu.status as status_user,viu.url as url_user
  70. from vaccine_info vi left join vaccine_info_user viu
  71. on vi.id_card = viu.id_card and viu.is_del = 'N'
  72. </sql>
  73. <select id="selectVaccineInfoList" resultMap="VaccineInfoResult">
  74. 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,
  75. vi.region, vi.user_name, vi.gender, vi.id_card, vi.phone_num, vi.key_industries, vi.is_vaccination, vi.vaccine_name, vi.jici,
  76. vi.vaccination_time, vi.vaccination_place, vi.contraindication, vi.suspend,vi.suspend_url,vi.other_url,vi.vaccination_time,
  77. vi.should_be, vi.other, vi.progress, vi.remark, vi.status, vi.create_by, vi.create_time, vi.update_by, vi.update_time,
  78. 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
  79. <where>
  80. vi.is_del = 'N'
  81. <if test="villageTowns != null and villageTowns != ''">
  82. and vi.village_towns = #{villageTowns}
  83. </if>
  84. <if test="village != null and village != ''"> and vi.village = #{village}</if>
  85. <if test="villagerGroup != null and villagerGroup != ''"> and vi.villager_group = #{villagerGroup}</if>
  86. <if test="houseType != null and houseType != ''"> and vi.house_type = #{houseType}</if>
  87. <if test="domicile != null and domicile != ''"> and vi.domicile = #{domicile}</if>
  88. <if test="province != null and province != ''"> and vi.province = #{province}</if>
  89. <if test="city != null and city != ''"> and vi.city = #{city}</if>
  90. <if test="jici != null and jici != ''"> and vi.jici &lt;= #{jici}</if>
  91. <if test="vaccineName != null and vaccineName != ''"> and vi.vaccine_name like concat('%', #{vaccineName}, '%')</if>
  92. <if test="vaccinationTime != null "> and DATE_FORMAT(vi.vaccination_time,'%Y-%m-%d') = DATE_FORMAT(#{vaccinationTime},'%Y-%m-%d')</if>
  93. <if test="region != null and region != ''"> and vi.region = #{region}</if>
  94. <if test="userName != null and userName != ''"> and vi.user_name like concat('%', #{userName}, '%')</if>
  95. <if test="gender != null and gender != ''"> and vi.gender = #{gender}</if>
  96. <if test="idCard != null and idCard != ''"> and vi.id_card like concat('%', #{idCard}, '%')</if>
  97. <if test="phoneNum != null and phoneNum != ''"> and vi.phone_num = #{phoneNum}</if>
  98. <if test="keyIndustries != null and keyIndustries != ''"> and vi.key_industries = #{keyIndustries}</if>
  99. <if test="isVaccination != null and isVaccination != ''"> and vi.is_vaccination = #{isVaccination}</if>
  100. <if test="params.startAge != null and params.startAge != ''"> and vi.age &gt;= #{params.startAge}</if>
  101. <if test="params.endAge != null and params.endAge != ''"> and vi.age &lt;= #{params.endAge}</if>
  102. <if test="contraindication != null and contraindication != ''"> and vi.contraindication = #{contraindication}</if>
  103. <if test="suspend != null and suspend != ''"> and vi.suspend = #{suspend}</if>
  104. <if test="shouldBe != null and shouldBe != ''"> and vi.should_be = #{shouldBe}</if>
  105. <if test="other != null and other != ''"> and vi.other = #{other}</if>
  106. <if test="status != null and status != ''"> and vi.status = #{status}</if>
  107. <if test="code != null and code != ''"> and vi.code = #{code}</if>
  108. <if test="birthday != null and birthday != ''"> and vi.birthday = #{birthday}</if>
  109. <if test="workUnit != null and workUnit != ''"> and vi.work_unit = #{workUnit}</if>
  110. <if test="crowdClassification != null and crowdClassification != ''"> and vi.crowd_classification = #{crowdClassification}</if>
  111. <if test="manufacturer != null and manufacturer != ''"> and vi.manufacturer = #{manufacturer}</if>
  112. <if test="nowIn != null and nowIn != ''"> and vi.now_in = #{nowIn}</if>
  113. <if test="shouldSlow != null and shouldSlow != ''"> and vi.should_slow = #{shouldSlow}</if>
  114. <if test="createTime != null and createTime != ''"> and vi.create_time &gt;= #{startTime}</if>
  115. <if test="endTime != null and endTime != ''"> and vi.create_time &lt;= #{endTime}</if>
  116. <if test="shouldSlow != null and shouldSlow != ''"> and vi.should_slow = #{shouldSlow}</if>
  117. <if test="idCardS != null and idCardS.size() > 0">
  118. and vi.id_card in
  119. <foreach item="idCard" collection="idCardS" open="(" separator="," close=")">
  120. #{idCard}
  121. </foreach>
  122. </if>
  123. <if test="deptIdList != null and deptIdList.size() > 0">
  124. and vi.dept_id in
  125. <foreach item="deptId" collection="deptIdList" open="(" separator="," close=")">
  126. #{deptId}
  127. </foreach>
  128. </if>
  129. </where>
  130. order by vi.create_time DESC ,vi.vaccination_time DESC
  131. </select>
  132. <select id="listByRlry" resultMap="VaccineInfoResult">
  133. select vi.id, vi.user_name, vi.phone_num, vi.id_card, vi.gender
  134. from vaccine_info vi
  135. <where>
  136. vi.is_del = 'N'
  137. <!-- 已认领 -->
  138. <if test="ryrl == true">and (vi.village_towns is not null or vi.village_towns != '')</if>
  139. <!-- 未认领 -->
  140. <if test="ryrl == false">and (vi.village_towns is null or vi.village_towns = '')</if>
  141. <if test="houseType != null and houseType != ''">and vi.house_type = #{houseType}</if>
  142. <if test="domicile != null and domicile != ''">and vi.domicile = #{domicile}</if>
  143. <if test="province != null and province != ''">and vi.province = #{province}</if>
  144. <if test="city != null and city != ''">and vi.city = #{city}</if>
  145. <if test="jici != null and jici != ''">and vi.jici &lt;= #{jici}</if>
  146. <if test="vaccineName != null and vaccineName != ''">and vi.vaccine_name like concat('%', #{vaccineName},
  147. '%')
  148. </if>
  149. <if test="vaccinationTime != null ">and DATE_FORMAT(vi.vaccination_time,'%Y-%m-%d') =
  150. DATE_FORMAT(#{vaccinationTime},'%Y-%m-%d')
  151. </if>
  152. <if test="region != null and region != ''">and vi.region = #{region}</if>
  153. <!--小程序,一个搜索框既可以搜索姓名,也可以搜索身份证-->
  154. <if test="userName != null and userName != ''">
  155. and (vi.user_name like concat('%', #{userName}, '%') or vi.id_card like concat('%', #{userName}, '%'))
  156. </if>
  157. <if test="gender != null and gender != ''">and vi.gender = #{gender}</if>
  158. <if test="idCard != null and idCard != ''">and vi.id_card like concat('%', #{idCard}, '%')</if>
  159. <if test="phoneNum != null and phoneNum != ''">and vi.phone_num = #{phoneNum}</if>
  160. <if test="keyIndustries != null and keyIndustries != ''">and vi.key_industries = #{keyIndustries}</if>
  161. <if test="isVaccination != null and isVaccination != ''">and vi.is_vaccination = #{isVaccination}</if>
  162. <if test="params.startAge != null and params.startAge != ''">and vi.age &gt;= #{params.startAge}</if>
  163. <if test="params.endAge != null and params.endAge != ''">and vi.age &lt;= #{params.endAge}</if>
  164. <if test="contraindication != null and contraindication != ''">and vi.contraindication = #{contraindication}</if>
  165. <if test="suspend != null and suspend != ''">and vi.suspend = #{suspend}</if>
  166. <if test="shouldBe != null and shouldBe != ''">and vi.should_be = #{shouldBe}</if>
  167. <if test="other != null and other != ''">and vi.other = #{other}</if>
  168. <if test="status != null and status != ''">and vi.status = #{status}</if>
  169. <if test="code != null and code != ''">and vi.code = #{code}</if>
  170. <if test="birthday != null and birthday != ''">and vi.birthday = #{birthday}</if>
  171. <if test="workUnit != null and workUnit != ''">and vi.work_unit = #{workUnit}</if>
  172. <if test="crowdClassification != null and crowdClassification != ''">and vi.crowd_classification =
  173. #{crowdClassification}
  174. </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="idCardS != null and idCardS.size() > 0">
  179. and vi.id_card in
  180. <foreach item="idCard" collection="idCardS" open="(" separator="," close=")">
  181. #{idCard}
  182. </foreach>
  183. </if>
  184. <if test="deptIdList != null and deptIdList.size() > 0">
  185. and vi.dept_id in
  186. <foreach item="deptId" collection="deptIdList" open="(" separator="," close=")">
  187. #{deptId}
  188. </foreach>
  189. </if>
  190. </where>
  191. order by vi.create_time DESC ,vi.vaccination_time DESC
  192. </select>
  193. <select id="stsByYrl" resultType="int">
  194. select count(vi.id)
  195. from vaccine_info vi
  196. where vi.is_del = 'N'
  197. <!-- 已认领 -->
  198. and (vi.village_towns is not null or vi.village_towns != '')
  199. <if test="deptIdList != null and deptIdList.size() > 0">
  200. and vi.dept_id in
  201. <foreach item="deptId" collection="deptIdList" open="(" separator="," close=")">
  202. #{deptId}
  203. </foreach>
  204. </if>
  205. </select>
  206. <select id="stsByWrl" resultType="int">
  207. select count(vi.id)
  208. from vaccine_info vi
  209. where vi.is_del = 'N'
  210. <!-- 未认领 -->
  211. and (vi.village_towns is null or vi.village_towns = '')
  212. <if test="deptIdList != null and deptIdList.size() > 0">
  213. and vi.dept_id in
  214. <foreach item="deptId" collection="deptIdList" open="(" separator="," close=")">
  215. #{deptId}
  216. </foreach>
  217. </if>
  218. </select>
  219. <update id="deleteCzrk">
  220. update vaccine_info
  221. set is_del = 'Y'
  222. , delete_reason = #{deleteReason}
  223. , update_by = #{updateBy}
  224. , update_time = sysdate()
  225. where id = #{id}
  226. </update>
  227. <select id="selectVaccineInfoListByPage" parameterType="Integer" resultMap="VaccineInfoResult">
  228. select * from vaccine_info limit #{startNum}, #{endNum}
  229. </select>
  230. <select id="selectVaccineInfoById" parameterType="Long" resultMap="VaccineInfoResult">
  231. <include refid="selectVaccineInfoVo"/>
  232. where vi.id = #{id} and vi.is_del = 'N'
  233. order by viu.vaccination_time
  234. </select>
  235. <select id="selectVaccineInfoByIdCard" parameterType="String" resultMap="VaccineInfoResult">
  236. <include refid="selectVaccineInfoVo"/>
  237. where vi.id_card = #{idCard} and vi.is_del = 'N'
  238. order by viu.vaccination_time
  239. </select>
  240. <select id="selectVaccineInfoByIds" parameterType="Long" resultMap="VaccineInfoResult">
  241. <include refid="selectVaccineInfoVo"/>
  242. where vi.id in
  243. <foreach item="id" collection="array" open="(" separator="," close=")">
  244. #{id}
  245. </foreach>
  246. and vi.is_del = 'N'
  247. </select>
  248. <insert id="insertVaccineInfo" useGeneratedKeys="true" keyProperty="id">
  249. insert into vaccine_info
  250. <trim prefix="(" suffix=")" suffixOverrides=",">
  251. <if test="villageTowns != null">village_towns,</if>
  252. <if test="village != null">village,</if>
  253. <if test="villagerGroup != null">villager_group,</if>
  254. <if test="houseType != null">house_type,</if>
  255. <if test="domicile != null">domicile,</if>
  256. <if test="province != null">province,</if>
  257. <if test="city != null">city,</if>
  258. <if test="region != null and region != ''">region,</if>
  259. <if test="userName != null">user_name,</if>
  260. <if test="gender != null">gender,</if>
  261. <if test="idCard != null">id_card,</if>
  262. <if test="phoneNum != null">phone_num,</if>
  263. <if test="keyIndustries != null">key_industries,</if>
  264. <if test="isVaccination != null">is_vaccination,</if>
  265. <if test="vaccineName != null">vaccine_name,</if>
  266. <if test="jici != null">jici,</if>
  267. <if test="vaccinationTime != null">vaccination_time,</if>
  268. <if test="vaccinationPlace != null">vaccination_place,</if>
  269. <if test="contraindication != null">contraindication,</if>
  270. <if test="suspend != null">suspend,</if>
  271. <if test="shouldBe != null">should_be,</if>
  272. <if test="other != null">other,</if>
  273. <if test="progress != null">progress,</if>
  274. <if test="remark != null">remark,</if>
  275. <if test="status != null">status,</if>
  276. <if test="createBy != null">create_by,</if>
  277. <if test="updateBy != null">update_by,</if>
  278. <if test="updateTime != null">update_time,</if>
  279. <if test="isDel != null and isDel != ''">is_del,</if>
  280. <if test="code != null and code != ''">code,</if>
  281. <if test="birthday != null and birthday != ''">birthday,</if>
  282. <if test="workUnit != null and workUnit != ''">work_unit,</if>
  283. <if test="crowdClassification != null and crowdClassification != ''">crowd_classification,</if>
  284. <if test="manufacturer != null and manufacturer != ''">manufacturer,</if>
  285. <if test="nowIn != null and nowIn != ''">now_in,</if>
  286. <if test="url != null and url != ''">url,</if>
  287. <if test="shouldSlow != null and shouldSlow != ''">should_slow,</if>
  288. <if test="suspendUrl != null and suspendUrl != ''">suspend_url,</if>
  289. <if test="otherUrl != null and otherUrl != ''">other_url,</if>
  290. <if test="age != null and age != ''">age,</if>
  291. <if test="deptId != null">dept_id,</if>
  292. <if test="deleteReason != null">delete_reason,</if>
  293. create_time
  294. </trim>
  295. <trim prefix="values (" suffix=")" suffixOverrides=",">
  296. <if test="villageTowns != null">#{villageTowns},</if>
  297. <if test="village != null">#{village},</if>
  298. <if test="villagerGroup != null">#{villagerGroup},</if>
  299. <if test="houseType != null">#{houseType},</if>
  300. <if test="domicile != null">#{domicile},</if>
  301. <if test="province != null">#{province},</if>
  302. <if test="city != null">#{city},</if>
  303. <if test="region != null and region != ''">#{region},</if>
  304. <if test="userName != null">#{userName},</if>
  305. <if test="gender != null">#{gender},</if>
  306. <if test="idCard != null">#{idCard},</if>
  307. <if test="phoneNum != null">#{phoneNum},</if>
  308. <if test="keyIndustries != null">#{keyIndustries},</if>
  309. <if test="isVaccination != null">#{isVaccination},</if>
  310. <if test="vaccineName != null">#{vaccineName},</if>
  311. <if test="jici != null">#{jici},</if>
  312. <if test="vaccinationTime != null">#{vaccinationTime},</if>
  313. <if test="vaccinationPlace != null">#{vaccinationPlace},</if>
  314. <if test="contraindication != null">#{contraindication},</if>
  315. <if test="suspend != null">#{suspend},</if>
  316. <if test="shouldBe != null">#{shouldBe},</if>
  317. <if test="other != null">#{other},</if>
  318. <if test="progress != null">#{progress},</if>
  319. <if test="remark != null">#{remark},</if>
  320. <if test="status != null">#{status},</if>
  321. <if test="createBy != null">#{createBy},</if>
  322. <if test="updateBy != null">#{updateBy},</if>
  323. <if test="updateTime != null">#{updateTime},</if>
  324. <if test="isDel != null and isDel != ''">#{isDel},</if>
  325. <if test="code != null and code != ''">#{code},</if>
  326. <if test="birthday != null and birthday != ''">#{birthday},</if>
  327. <if test="workUnit != null and workUnit != ''">#{workUnit},</if>
  328. <if test="crowdClassification != null and crowdClassification != ''">#{crowdClassification},</if>
  329. <if test="manufacturer != null and manufacturer != ''">#{manufacturer},</if>
  330. <if test="nowIn != null and nowIn != ''">#{nowIn},</if>
  331. <if test="url != null and url != ''">#{url},</if>
  332. <if test="shouldSlow != null and shouldSlow != ''">#{shouldSlow},</if>
  333. <if test="suspendUrl != null and suspendUrl != ''">#{suspendUrl},</if>
  334. <if test="otherUrl != null and otherUrl != ''">#{otherUrl},</if>
  335. <if test="age != null and age != ''">#{age},</if>
  336. <if test="deptId != null">#{deptId},</if>
  337. <if test="deleteReason != null">#{deleteReason},</if>
  338. sysdate()
  339. </trim>
  340. </insert>
  341. <update id="updateVaccineInfo" >
  342. update vaccine_info
  343. <trim prefix="SET" suffixOverrides=",">
  344. <if test="villageTowns != null">village_towns = #{villageTowns},</if>
  345. <if test="village != null">village = #{village},</if>
  346. <if test="villagerGroup != null">villager_group = #{villagerGroup},</if>
  347. <if test="houseType != null">house_type = #{houseType},</if>
  348. <if test="domicile != null">domicile = #{domicile},</if>
  349. <if test="province != null">province = #{province},</if>
  350. <if test="city != null">city = #{city},</if>
  351. <if test="region != null and region != ''">region = #{region},</if>
  352. <if test="userName != null">user_name = #{userName},</if>
  353. <if test="gender != null">gender = #{gender},</if>
  354. <if test="idCard != null">id_card = #{idCard},</if>
  355. <if test="phoneNum != null">phone_num = #{phoneNum},</if>
  356. <if test="keyIndustries != null">key_industries = #{keyIndustries},</if>
  357. <if test="isVaccination != null">is_vaccination = #{isVaccination},</if>
  358. <if test="vaccineName != null">vaccine_name = #{vaccineName},</if>
  359. <if test="jici != null">jici = #{jici},</if>
  360. <if test="vaccinationTime != null">vaccination_time = #{vaccinationTime},</if>
  361. <if test="vaccinationPlace != null">vaccination_place = #{vaccinationPlace},</if>
  362. <if test="contraindication != null">contraindication = #{contraindication},</if>
  363. <if test="suspend != null">suspend = #{suspend},</if>
  364. <if test="shouldBe != null">should_be = #{shouldBe},</if>
  365. <if test="other != null">other = #{other},</if>
  366. <if test="progress != null">progress = #{progress},</if>
  367. <if test="remark != null">remark = #{remark},</if>
  368. <if test="status != null">status = #{status},</if>
  369. <if test="createBy != null">create_by = #{createBy},</if>
  370. <if test="createTime != null">create_time = #{createTime},</if>
  371. <if test="updateBy != null">update_by = #{updateBy},</if>
  372. <if test="updateTime != null">update_time = #{updateTime},</if>
  373. <if test="isDel != null and isDel != ''">is_del = #{isDel},</if>
  374. <if test="code != null and code != ''">code = #{code},</if>
  375. <if test="birthday != null and birthday != ''">birthday = #{birthday},</if>
  376. <if test="workUnit != null and workUnit != ''">work_unit = #{workUnit},</if>
  377. <if test="crowdClassification != null and crowdClassification != ''">crowd_classification = #{crowdClassification},</if>
  378. <if test="manufacturer != null and manufacturer != ''">manufacturer = #{manufacturer},</if>
  379. <if test="nowIn != null and nowIn != ''">now_in = #{nowIn},</if>
  380. <if test="url != null and url != ''">url = #{url},</if>
  381. <if test="shouldSlow != null and shouldSlow != ''">should_slow = #{shouldSlow},</if>
  382. <if test="suspendUrl != null and suspendUrl != ''">suspend_url = #{suspendUrl},</if>
  383. <if test="otherUrl != null and otherUrl != ''">other_url = #{otherUrl},</if>
  384. <if test="age != null and age != ''">age = #{age},</if>
  385. <if test="deptId != null">dept_id = #{deptId},</if>
  386. </trim>
  387. where id = #{id}
  388. </update>
  389. <update id="update" >
  390. update vaccine_info
  391. <trim prefix="SET" suffixOverrides=",">
  392. <if test="villageTowns != null">village_towns = #{villageTowns},</if>
  393. <if test="village != null">village = #{village},</if>
  394. <if test="villagerGroup != null">villager_group = #{villagerGroup},</if>
  395. <if test="houseType != null">house_type = #{houseType},</if>
  396. <if test="domicile != null">domicile = #{domicile},</if>
  397. <if test="province != null">province = #{province},</if>
  398. <if test="city != null">city = #{city},</if>
  399. <if test="region != null and region != ''">region = #{region},</if>
  400. <if test="userName != null">user_name = #{userName},</if>
  401. <if test="gender != null">gender = #{gender},</if>
  402. <!-- <if SysRegion="idCard != null">id_card = #{idCard},</if>-->
  403. <if test="phoneNum != null">phone_num = #{phoneNum},</if>
  404. <if test="keyIndustries != null">key_industries = #{keyIndustries},</if>
  405. <if test="isVaccination != null">is_vaccination = #{isVaccination},</if>
  406. <if test="vaccineName != null">vaccine_name = #{vaccineName},</if>
  407. <if test="jici != null">jici = #{jici},</if>
  408. <if test="vaccinationTime != null">vaccination_time = #{vaccinationTime},</if>
  409. <if test="vaccinationPlace != null">vaccination_place = #{vaccinationPlace},</if>
  410. <if test="contraindication != null">contraindication = #{contraindication},</if>
  411. <if test="suspend != null">suspend = #{suspend},</if>
  412. <if test="shouldBe != null">should_be = #{shouldBe},</if>
  413. <if test="other != null">other = #{other},</if>
  414. <if test="progress != null">progress = #{progress},</if>
  415. <if test="remark != null">remark = #{remark},</if>
  416. <if test="status != null">status = #{status},</if>
  417. <if test="createBy != null">create_by = #{createBy},</if>
  418. <if test="createTime != null">create_time = #{createTime},</if>
  419. <if test="updateBy != null">update_by = #{updateBy},</if>
  420. <if test="updateTime != null">update_time = #{updateTime},</if>
  421. <if test="isDel != null and isDel != ''">is_del = #{isDel},</if>
  422. <if test="code != null and code != ''">code = #{code},</if>
  423. <if test="birthday != null and birthday != ''">birthday = #{birthday},</if>
  424. <if test="workUnit != null and workUnit != ''">work_unit = #{workUnit},</if>
  425. <if test="crowdClassification != null and crowdClassification != ''">crowd_classification = #{crowdClassification},</if>
  426. <if test="manufacturer != null and manufacturer != ''">manufacturer = #{manufacturer},</if>
  427. <if test="nowIn != null and nowIn != ''">now_in = #{nowIn},</if>
  428. <if test="url != null and url != ''">url = #{url},</if>
  429. <if test="shouldSlow != null and shouldSlow != ''">should_slow = #{shouldSlow},</if>
  430. <if test="suspendUrl != null and suspendUrl != ''">suspend_url = #{suspendUrl},</if>
  431. <if test="otherUrl != null and otherUrl != ''">other_url = #{otherUrl},</if>
  432. <if test="age != null and age != ''">age = #{age},</if>
  433. <if test="deptId != null">dept_id = #{deptId},</if>
  434. </trim>
  435. where code = #{code} or (id_card like concat('%', #{idCard}, '%') and user_name like concat('%', #{userName}, '%'))
  436. </update>
  437. <delete id="deleteVaccineInfoById" parameterType="Long">
  438. update vaccine_info set is_del = 'Y' where id = #{id}
  439. </delete>
  440. <delete id="deleteVaccineInfoByIds" parameterType="String">
  441. update vaccine_info set is_del = 'Y' where id in
  442. <foreach item="id" collection="array" open="(" separator="," close=")">
  443. #{id}
  444. </foreach>
  445. </delete>
  446. <select id="findHjInfo" resultMap="VaccineInfoResult">
  447. select id, user_name ,gender, birthday,age,code from vaccine_info
  448. <where>
  449. is_del = 'N'
  450. <if test="idCard != null and idCard != '' "> and id_card = #{idCard}</if>
  451. </where>
  452. limit 1
  453. </select>
  454. <select id="selectSysDictDataByDictLabel" parameterType="string" resultType="String">
  455. select dict_value from sys_dict_data where dict_label = #{vaccineName} and status = '0'
  456. </select>
  457. <select id="listByTotalTaskCnt" resultMap="VaccineInfoResult">
  458. SELECT id_card, village_towns, vaccination_time, age, jici, vaccine_name
  459. FROM vaccine_info
  460. WHERE age > 18
  461. </select>
  462. <select id="getByIdCard" resultMap="VaccineInfoResult">
  463. select * from vaccine_info where id_card = #{idCard} limit 1;
  464. </select>
  465. <!-- AND (-->
  466. <!-- contraindication IS NULL-->
  467. <!-- OR suspend IS NULL-->
  468. <!-- OR other IS NULL-->
  469. <!-- );-->
  470. </mapper>