VaccineInfoMapper.xml 31 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533
  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="listByXzAndJs" resultMap="VaccineInfoResult">
  133. select vi.id, vi.village_towns, vi.village, vi.villager_group,vi.age, vi.house_type, vi.domicile, vi.province,
  134. vi.city,vi.should_slow,
  135. vi.region, vi.user_name, vi.gender, vi.id_card, vi.phone_num, vi.key_industries, vi.is_vaccination,
  136. vi.vaccine_name, vi.jici,
  137. vi.vaccination_time, vi.vaccination_place, vi.contraindication,
  138. vi.suspend,vi.suspend_url,vi.other_url,vi.vaccination_time,
  139. vi.should_be, vi.other, vi.progress, vi.remark, vi.status, vi.create_by, vi.create_time, vi.update_by,
  140. vi.update_time,
  141. vi.is_del,vi.code,vi.birthday,vi.work_unit,vi.crowd_classification,vi.manufacturer,vi.now_in,vi.url,vi.dept_id
  142. from vaccine_info vi
  143. where (vi.is_del = 'N' and vi.create_time &gt;= #{startTime} and vi.create_time &lt;= #{endTime}) or
  144. (vi.is_del = 'Y' and vi.update_time &gt;= #{startTime} and vi.update_time &lt;= #{endTime})
  145. <if test="deptIdList != null and deptIdList.size() > 0">
  146. and vi.dept_id in
  147. <foreach item="deptId" collection="deptIdList" open="(" separator="," close=")">
  148. #{deptId}
  149. </foreach>
  150. </if>
  151. </select>
  152. <select id="countCzrk" resultType="int">
  153. select count(vi.id)
  154. from vaccine_info vi
  155. where vi.is_del = 'N'
  156. <!-- 已认领 -->
  157. <if test="ryrl == true">and (vi.village_towns is not null or vi.village_towns != '')</if>
  158. <if test="deptIdList != null and deptIdList.size() > 0">
  159. and vi.dept_id in
  160. <foreach item="deptId" collection="deptIdList" open="(" separator="," close=")">
  161. #{deptId}
  162. </foreach>
  163. </if>
  164. </select>
  165. <select id="listByRlry" resultMap="VaccineInfoResult">
  166. select vi.id, vi.user_name, vi.phone_num, vi.id_card, vi.gender
  167. from vaccine_info vi
  168. <where>
  169. vi.is_del = 'N'
  170. <!-- 已认领 -->
  171. <if test="ryrl == true">and (vi.village_towns is not null or vi.village_towns != '')</if>
  172. <!-- 未认领 -->
  173. <if test="ryrl == false">and (vi.village_towns is null or vi.village_towns = '')</if>
  174. <if test="houseType != null and houseType != ''">and vi.house_type = #{houseType}</if>
  175. <if test="domicile != null and domicile != ''">and vi.domicile = #{domicile}</if>
  176. <if test="province != null and province != ''">and vi.province = #{province}</if>
  177. <if test="city != null and city != ''">and vi.city = #{city}</if>
  178. <if test="jici != null and jici != ''">and vi.jici &lt;= #{jici}</if>
  179. <if test="vaccineName != null and vaccineName != ''">and vi.vaccine_name like concat('%', #{vaccineName},
  180. '%')
  181. </if>
  182. <if test="vaccinationTime != null ">and DATE_FORMAT(vi.vaccination_time,'%Y-%m-%d') =
  183. DATE_FORMAT(#{vaccinationTime},'%Y-%m-%d')
  184. </if>
  185. <if test="region != null and region != ''">and vi.region = #{region}</if>
  186. <!--小程序,一个搜索框既可以搜索姓名,也可以搜索身份证-->
  187. <if test="userName != null and userName != ''">
  188. and (vi.user_name like concat('%', #{userName}, '%') or vi.id_card like concat('%', #{userName}, '%'))
  189. </if>
  190. <if test="gender != null and gender != ''">and vi.gender = #{gender}</if>
  191. <if test="idCard != null and idCard != ''">and vi.id_card like concat('%', #{idCard}, '%')</if>
  192. <if test="phoneNum != null and phoneNum != ''">and vi.phone_num = #{phoneNum}</if>
  193. <if test="keyIndustries != null and keyIndustries != ''">and vi.key_industries = #{keyIndustries}</if>
  194. <if test="isVaccination != null and isVaccination != ''">and vi.is_vaccination = #{isVaccination}</if>
  195. <if test="params.startAge != null and params.startAge != ''">and vi.age &gt;= #{params.startAge}</if>
  196. <if test="params.endAge != null and params.endAge != ''">and vi.age &lt;= #{params.endAge}</if>
  197. <if test="contraindication != null and contraindication != ''">and vi.contraindication = #{contraindication}</if>
  198. <if test="suspend != null and suspend != ''">and vi.suspend = #{suspend}</if>
  199. <if test="shouldBe != null and shouldBe != ''">and vi.should_be = #{shouldBe}</if>
  200. <if test="other != null and other != ''">and vi.other = #{other}</if>
  201. <if test="status != null and status != ''">and vi.status = #{status}</if>
  202. <if test="code != null and code != ''">and vi.code = #{code}</if>
  203. <if test="birthday != null and birthday != ''">and vi.birthday = #{birthday}</if>
  204. <if test="workUnit != null and workUnit != ''">and vi.work_unit = #{workUnit}</if>
  205. <if test="crowdClassification != null and crowdClassification != ''">and vi.crowd_classification =
  206. #{crowdClassification}
  207. </if>
  208. <if test="manufacturer != null and manufacturer != ''">and vi.manufacturer = #{manufacturer}</if>
  209. <if test="nowIn != null and nowIn != ''">and vi.now_in = #{nowIn}</if>
  210. <if test="shouldSlow != null and shouldSlow != ''">and vi.should_slow = #{shouldSlow}</if>
  211. <if test="idCardS != null and idCardS.size() > 0">
  212. and vi.id_card in
  213. <foreach item="idCard" collection="idCardS" open="(" separator="," close=")">
  214. #{idCard}
  215. </foreach>
  216. </if>
  217. <if test="deptIdList != null and deptIdList.size() > 0">
  218. and vi.dept_id in
  219. <foreach item="deptId" collection="deptIdList" open="(" separator="," close=")">
  220. #{deptId}
  221. </foreach>
  222. </if>
  223. </where>
  224. order by vi.create_time DESC ,vi.vaccination_time DESC
  225. </select>
  226. <select id="stsByYrl" resultType="int">
  227. select count(vi.id)
  228. from vaccine_info vi
  229. where vi.is_del = 'N'
  230. <!-- 已认领 -->
  231. and (vi.village_towns is not null or vi.village_towns != '')
  232. <if test="deptIdList != null and deptIdList.size() > 0">
  233. and vi.dept_id in
  234. <foreach item="deptId" collection="deptIdList" open="(" separator="," close=")">
  235. #{deptId}
  236. </foreach>
  237. </if>
  238. </select>
  239. <select id="stsByWrl" resultType="int">
  240. select count(vi.id)
  241. from vaccine_info vi
  242. where vi.is_del = 'N'
  243. <!-- 未认领 -->
  244. and (vi.village_towns is null or vi.village_towns = '')
  245. <if test="deptIdList != null and deptIdList.size() > 0">
  246. and vi.dept_id in
  247. <foreach item="deptId" collection="deptIdList" open="(" separator="," close=")">
  248. #{deptId}
  249. </foreach>
  250. </if>
  251. </select>
  252. <update id="deleteCzrk">
  253. update vaccine_info
  254. set is_del = 'Y'
  255. , delete_reason = #{deleteReason}
  256. , update_by = #{updateBy}
  257. , update_time = sysdate()
  258. where id = #{id}
  259. </update>
  260. <select id="selectVaccineInfoListByPage" parameterType="Integer" resultMap="VaccineInfoResult">
  261. select * from vaccine_info limit #{startNum}, #{endNum}
  262. </select>
  263. <select id="selectVaccineInfoById" parameterType="Long" resultMap="VaccineInfoResult">
  264. <include refid="selectVaccineInfoVo"/>
  265. where vi.id = #{id} and vi.is_del = 'N'
  266. order by viu.vaccination_time
  267. </select>
  268. <select id="selectVaccineInfoByIdCard" parameterType="String" resultMap="VaccineInfoResult">
  269. <include refid="selectVaccineInfoVo"/>
  270. where vi.id_card = #{idCard} and vi.is_del = 'N'
  271. order by viu.vaccination_time
  272. </select>
  273. <select id="selectVaccineInfoByIds" parameterType="Long" resultMap="VaccineInfoResult">
  274. <include refid="selectVaccineInfoVo"/>
  275. where vi.id in
  276. <foreach item="id" collection="array" open="(" separator="," close=")">
  277. #{id}
  278. </foreach>
  279. and vi.is_del = 'N'
  280. </select>
  281. <insert id="insertVaccineInfo" useGeneratedKeys="true" keyProperty="id">
  282. insert into vaccine_info
  283. <trim prefix="(" suffix=")" suffixOverrides=",">
  284. <if test="villageTowns != null">village_towns,</if>
  285. <if test="village != null">village,</if>
  286. <if test="villagerGroup != null">villager_group,</if>
  287. <if test="houseType != null">house_type,</if>
  288. <if test="domicile != null">domicile,</if>
  289. <if test="province != null">province,</if>
  290. <if test="city != null">city,</if>
  291. <if test="region != null and region != ''">region,</if>
  292. <if test="userName != null">user_name,</if>
  293. <if test="gender != null">gender,</if>
  294. <if test="idCard != null">id_card,</if>
  295. <if test="phoneNum != null">phone_num,</if>
  296. <if test="keyIndustries != null">key_industries,</if>
  297. <if test="isVaccination != null">is_vaccination,</if>
  298. <if test="vaccineName != null">vaccine_name,</if>
  299. <if test="jici != null">jici,</if>
  300. <if test="vaccinationTime != null">vaccination_time,</if>
  301. <if test="vaccinationPlace != null">vaccination_place,</if>
  302. <if test="contraindication != null">contraindication,</if>
  303. <if test="suspend != null">suspend,</if>
  304. <if test="shouldBe != null">should_be,</if>
  305. <if test="other != null">other,</if>
  306. <if test="progress != null">progress,</if>
  307. <if test="remark != null">remark,</if>
  308. <if test="status != null">status,</if>
  309. <if test="createBy != null">create_by,</if>
  310. <if test="updateBy != null">update_by,</if>
  311. <if test="updateTime != null">update_time,</if>
  312. <if test="isDel != null and isDel != ''">is_del,</if>
  313. <if test="code != null and code != ''">code,</if>
  314. <if test="birthday != null and birthday != ''">birthday,</if>
  315. <if test="workUnit != null and workUnit != ''">work_unit,</if>
  316. <if test="crowdClassification != null and crowdClassification != ''">crowd_classification,</if>
  317. <if test="manufacturer != null and manufacturer != ''">manufacturer,</if>
  318. <if test="nowIn != null and nowIn != ''">now_in,</if>
  319. <if test="url != null and url != ''">url,</if>
  320. <if test="shouldSlow != null and shouldSlow != ''">should_slow,</if>
  321. <if test="suspendUrl != null and suspendUrl != ''">suspend_url,</if>
  322. <if test="otherUrl != null and otherUrl != ''">other_url,</if>
  323. <if test="age != null and age != ''">age,</if>
  324. <if test="deptId != null">dept_id,</if>
  325. <if test="deleteReason != null">delete_reason,</if>
  326. create_time
  327. </trim>
  328. <trim prefix="values (" suffix=")" suffixOverrides=",">
  329. <if test="villageTowns != null">#{villageTowns},</if>
  330. <if test="village != null">#{village},</if>
  331. <if test="villagerGroup != null">#{villagerGroup},</if>
  332. <if test="houseType != null">#{houseType},</if>
  333. <if test="domicile != null">#{domicile},</if>
  334. <if test="province != null">#{province},</if>
  335. <if test="city != null">#{city},</if>
  336. <if test="region != null and region != ''">#{region},</if>
  337. <if test="userName != null">#{userName},</if>
  338. <if test="gender != null">#{gender},</if>
  339. <if test="idCard != null">#{idCard},</if>
  340. <if test="phoneNum != null">#{phoneNum},</if>
  341. <if test="keyIndustries != null">#{keyIndustries},</if>
  342. <if test="isVaccination != null">#{isVaccination},</if>
  343. <if test="vaccineName != null">#{vaccineName},</if>
  344. <if test="jici != null">#{jici},</if>
  345. <if test="vaccinationTime != null">#{vaccinationTime},</if>
  346. <if test="vaccinationPlace != null">#{vaccinationPlace},</if>
  347. <if test="contraindication != null">#{contraindication},</if>
  348. <if test="suspend != null">#{suspend},</if>
  349. <if test="shouldBe != null">#{shouldBe},</if>
  350. <if test="other != null">#{other},</if>
  351. <if test="progress != null">#{progress},</if>
  352. <if test="remark != null">#{remark},</if>
  353. <if test="status != null">#{status},</if>
  354. <if test="createBy != null">#{createBy},</if>
  355. <if test="updateBy != null">#{updateBy},</if>
  356. <if test="updateTime != null">#{updateTime},</if>
  357. <if test="isDel != null and isDel != ''">#{isDel},</if>
  358. <if test="code != null and code != ''">#{code},</if>
  359. <if test="birthday != null and birthday != ''">#{birthday},</if>
  360. <if test="workUnit != null and workUnit != ''">#{workUnit},</if>
  361. <if test="crowdClassification != null and crowdClassification != ''">#{crowdClassification},</if>
  362. <if test="manufacturer != null and manufacturer != ''">#{manufacturer},</if>
  363. <if test="nowIn != null and nowIn != ''">#{nowIn},</if>
  364. <if test="url != null and url != ''">#{url},</if>
  365. <if test="shouldSlow != null and shouldSlow != ''">#{shouldSlow},</if>
  366. <if test="suspendUrl != null and suspendUrl != ''">#{suspendUrl},</if>
  367. <if test="otherUrl != null and otherUrl != ''">#{otherUrl},</if>
  368. <if test="age != null and age != ''">#{age},</if>
  369. <if test="deptId != null">#{deptId},</if>
  370. <if test="deleteReason != null">#{deleteReason},</if>
  371. sysdate()
  372. </trim>
  373. </insert>
  374. <update id="updateVaccineInfo" >
  375. update vaccine_info
  376. <trim prefix="SET" suffixOverrides=",">
  377. <if test="villageTowns != null">village_towns = #{villageTowns},</if>
  378. <if test="village != null">village = #{village},</if>
  379. <if test="villagerGroup != null">villager_group = #{villagerGroup},</if>
  380. <if test="houseType != null">house_type = #{houseType},</if>
  381. <if test="domicile != null">domicile = #{domicile},</if>
  382. <if test="province != null">province = #{province},</if>
  383. <if test="city != null">city = #{city},</if>
  384. <if test="region != null and region != ''">region = #{region},</if>
  385. <if test="userName != null">user_name = #{userName},</if>
  386. <if test="gender != null">gender = #{gender},</if>
  387. <if test="idCard != null">id_card = #{idCard},</if>
  388. <if test="phoneNum != null">phone_num = #{phoneNum},</if>
  389. <if test="keyIndustries != null">key_industries = #{keyIndustries},</if>
  390. <if test="isVaccination != null">is_vaccination = #{isVaccination},</if>
  391. <if test="vaccineName != null">vaccine_name = #{vaccineName},</if>
  392. <if test="jici != null">jici = #{jici},</if>
  393. <if test="vaccinationTime != null">vaccination_time = #{vaccinationTime},</if>
  394. <if test="vaccinationPlace != null">vaccination_place = #{vaccinationPlace},</if>
  395. <if test="contraindication != null">contraindication = #{contraindication},</if>
  396. <if test="suspend != null">suspend = #{suspend},</if>
  397. <if test="shouldBe != null">should_be = #{shouldBe},</if>
  398. <if test="other != null">other = #{other},</if>
  399. <if test="progress != null">progress = #{progress},</if>
  400. <if test="remark != null">remark = #{remark},</if>
  401. <if test="status != null">status = #{status},</if>
  402. <if test="createBy != null">create_by = #{createBy},</if>
  403. <if test="createTime != null">create_time = #{createTime},</if>
  404. <if test="updateBy != null">update_by = #{updateBy},</if>
  405. <if test="updateTime != null">update_time = #{updateTime},</if>
  406. <if test="isDel != null and isDel != ''">is_del = #{isDel},</if>
  407. <if test="code != null and code != ''">code = #{code},</if>
  408. <if test="birthday != null and birthday != ''">birthday = #{birthday},</if>
  409. <if test="workUnit != null and workUnit != ''">work_unit = #{workUnit},</if>
  410. <if test="crowdClassification != null and crowdClassification != ''">crowd_classification = #{crowdClassification},</if>
  411. <if test="manufacturer != null and manufacturer != ''">manufacturer = #{manufacturer},</if>
  412. <if test="nowIn != null and nowIn != ''">now_in = #{nowIn},</if>
  413. <if test="url != null and url != ''">url = #{url},</if>
  414. <if test="shouldSlow != null and shouldSlow != ''">should_slow = #{shouldSlow},</if>
  415. <if test="suspendUrl != null and suspendUrl != ''">suspend_url = #{suspendUrl},</if>
  416. <if test="otherUrl != null and otherUrl != ''">other_url = #{otherUrl},</if>
  417. <if test="age != null and age != ''">age = #{age},</if>
  418. <if test="deptId != null">dept_id = #{deptId},</if>
  419. </trim>
  420. where id = #{id}
  421. </update>
  422. <update id="update" >
  423. update vaccine_info
  424. <trim prefix="SET" suffixOverrides=",">
  425. <if test="villageTowns != null">village_towns = #{villageTowns},</if>
  426. <if test="village != null">village = #{village},</if>
  427. <if test="villagerGroup != null">villager_group = #{villagerGroup},</if>
  428. <if test="houseType != null">house_type = #{houseType},</if>
  429. <if test="domicile != null">domicile = #{domicile},</if>
  430. <if test="province != null">province = #{province},</if>
  431. <if test="city != null">city = #{city},</if>
  432. <if test="region != null and region != ''">region = #{region},</if>
  433. <if test="userName != null">user_name = #{userName},</if>
  434. <if test="gender != null">gender = #{gender},</if>
  435. <!-- <if SysRegion="idCard != null">id_card = #{idCard},</if>-->
  436. <if test="phoneNum != null">phone_num = #{phoneNum},</if>
  437. <if test="keyIndustries != null">key_industries = #{keyIndustries},</if>
  438. <if test="isVaccination != null">is_vaccination = #{isVaccination},</if>
  439. <if test="vaccineName != null">vaccine_name = #{vaccineName},</if>
  440. <if test="jici != null">jici = #{jici},</if>
  441. <if test="vaccinationTime != null">vaccination_time = #{vaccinationTime},</if>
  442. <if test="vaccinationPlace != null">vaccination_place = #{vaccinationPlace},</if>
  443. <if test="contraindication != null">contraindication = #{contraindication},</if>
  444. <if test="suspend != null">suspend = #{suspend},</if>
  445. <if test="shouldBe != null">should_be = #{shouldBe},</if>
  446. <if test="other != null">other = #{other},</if>
  447. <if test="progress != null">progress = #{progress},</if>
  448. <if test="remark != null">remark = #{remark},</if>
  449. <if test="status != null">status = #{status},</if>
  450. <if test="createBy != null">create_by = #{createBy},</if>
  451. <if test="createTime != null">create_time = #{createTime},</if>
  452. <if test="updateBy != null">update_by = #{updateBy},</if>
  453. <if test="updateTime != null">update_time = #{updateTime},</if>
  454. <if test="isDel != null and isDel != ''">is_del = #{isDel},</if>
  455. <if test="code != null and code != ''">code = #{code},</if>
  456. <if test="birthday != null and birthday != ''">birthday = #{birthday},</if>
  457. <if test="workUnit != null and workUnit != ''">work_unit = #{workUnit},</if>
  458. <if test="crowdClassification != null and crowdClassification != ''">crowd_classification = #{crowdClassification},</if>
  459. <if test="manufacturer != null and manufacturer != ''">manufacturer = #{manufacturer},</if>
  460. <if test="nowIn != null and nowIn != ''">now_in = #{nowIn},</if>
  461. <if test="url != null and url != ''">url = #{url},</if>
  462. <if test="shouldSlow != null and shouldSlow != ''">should_slow = #{shouldSlow},</if>
  463. <if test="suspendUrl != null and suspendUrl != ''">suspend_url = #{suspendUrl},</if>
  464. <if test="otherUrl != null and otherUrl != ''">other_url = #{otherUrl},</if>
  465. <if test="age != null and age != ''">age = #{age},</if>
  466. <if test="deptId != null">dept_id = #{deptId},</if>
  467. </trim>
  468. where code = #{code} or (id_card like concat('%', #{idCard}, '%') and user_name like concat('%', #{userName}, '%'))
  469. </update>
  470. <delete id="deleteVaccineInfoById" parameterType="Long">
  471. update vaccine_info set is_del = 'Y' where id = #{id}
  472. </delete>
  473. <delete id="deleteVaccineInfoByIds" parameterType="String">
  474. update vaccine_info set is_del = 'Y' where id in
  475. <foreach item="id" collection="array" open="(" separator="," close=")">
  476. #{id}
  477. </foreach>
  478. </delete>
  479. <select id="findHjInfo" resultMap="VaccineInfoResult">
  480. select id, user_name ,gender, birthday,age,code from vaccine_info
  481. <where>
  482. is_del = 'N'
  483. <if test="idCard != null and idCard != '' "> and id_card = #{idCard}</if>
  484. </where>
  485. limit 1
  486. </select>
  487. <select id="selectSysDictDataByDictLabel" parameterType="string" resultType="String">
  488. select dict_value from sys_dict_data where dict_label = #{vaccineName} and status = '0'
  489. </select>
  490. <select id="listByTotalTaskCnt" resultMap="VaccineInfoResult">
  491. SELECT id_card, village_towns, vaccination_time, age, jici, vaccine_name
  492. FROM vaccine_info
  493. WHERE age > 18
  494. </select>
  495. <select id="getByIdCard" resultMap="VaccineInfoResult">
  496. select * from vaccine_info where id_card = #{idCard} limit 1;
  497. </select>
  498. <!-- AND (-->
  499. <!-- contraindication IS NULL-->
  500. <!-- OR suspend IS NULL-->
  501. <!-- OR other IS NULL-->
  502. <!-- );-->
  503. </mapper>