VaccineInfoMapper.xml 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296
  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="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="userName" column="user_name" />
  18. <result property="gender" column="gender" />
  19. <result property="idCard" column="id_card" />
  20. <result property="phoneNum" column="phone_num" />
  21. <result property="keyIndustries" column="key_industries" />
  22. <result property="isVaccination" column="is_vaccination" />
  23. <result property="contraindication" column="contraindication" />
  24. <result property="suspend" column="suspend" />
  25. <result property="shouldBe" column="should_be" />
  26. <result property="other" column="other" />
  27. <result property="remark" column="remark" />
  28. <result property="status" column="status" />
  29. <result property="createBy" column="create_by" />
  30. <result property="createTime" column="create_time" />
  31. <result property="updateBy" column="update_by" />
  32. <result property="updateTime" column="update_time" />
  33. <result property="isDel" column="is_del" />
  34. <result property="code" column="code" />
  35. <result property="birthday" column="birthday" />
  36. <result property="workUnit" column="work_unit" />
  37. <result property="crowdClassification" column="crowd_classification" />
  38. <result property="manufacturer" column="manufacturer" />
  39. <result property="nowIn" column="now_in" />
  40. <result property="url" column="url" />
  41. <result property="suspendUrl" column="suspend_url" />
  42. <result property="otherUrl" column="other_url" />
  43. <result property="shouldSlow" column="should_slow" />
  44. <result property="vaccinationTime" column="vaccination_time" />
  45. <result property="progress" column="progress" />
  46. <collection property="vaccineInfoUserList" javaType="java.util.List" resultMap="VaccineInfoUser" />
  47. </resultMap>
  48. <resultMap id="VaccineInfoUser" type="com.boman.web.core.domain.VaccineInfoUser">
  49. <id property="id" column="id_user" />
  50. <result property="idCard" column="id_card_user" />
  51. <result property="vaccineName" column="vaccine_name_user" />
  52. <result property="jici" column="jici_user" />
  53. <result property="vaccinationTime" column="vaccination_time_user" />
  54. <result property="vaccinationPlace" column="vaccination_place_user" />
  55. <result property="progress" column="progress_user" />
  56. <result property="status" column="status_user" />
  57. </resultMap>
  58. <sql id="selectVaccineInfoVo">
  59. select vi.id, vi.village_towns, vi.village, vi.villager_group,vi.age, vi.house_type, vi.domicile, vi.province, vi.city,
  60. vi.region, vi.user_name, vi.gender, vi.id_card, vi.phone_num, vi.key_industries, vi.is_vaccination, vi.vaccine_name, vi.jici,
  61. vi.vaccination_time, vi.vaccination_place, vi.contraindication, vi.suspend,vi.suspend_url,vi.other_url,vi.vaccination_time,
  62. vi.should_be, vi.other, vi.progress, vi.remark, vi.status, vi.create_by, vi.create_time, vi.update_by, vi.update_time,
  63. vi.is_del,vi.code,vi.birthday,vi.work_unit,vi.crowd_classification,vi.manufacturer,vi.now_in,vi.url,
  64. 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,
  65. viu.vaccination_place as vaccination_place_user,viu.progress as progress_user,viu.status as status_user
  66. from vaccine_info vi left join vaccine_info_user viu
  67. on vi.id_card = viu.id_card and viu.is_del = 'N'
  68. </sql>
  69. <select id="selectVaccineInfoList" parameterType="VaccineInfoOperation" resultMap="VaccineInfoResult">
  70. 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,
  71. vi.region, vi.user_name, vi.gender, vi.id_card, vi.phone_num, vi.key_industries, vi.is_vaccination, vi.vaccine_name, vi.jici,
  72. vi.vaccination_time, vi.vaccination_place, vi.contraindication, vi.suspend,vi.suspend_url,vi.other_url,vi.vaccination_time,
  73. vi.should_be, vi.other, vi.progress, vi.remark, vi.status, vi.create_by, vi.create_time, vi.update_by, vi.update_time,
  74. vi.is_del,vi.code,vi.birthday,vi.work_unit,vi.crowd_classification,vi.manufacturer,vi.now_in,vi.url from vaccine_info vi
  75. <where>
  76. vi.is_del = 'N'
  77. <if test="villageTowns != null and villageTowns != ''"> and vi.village_towns = #{villageTowns}</if>
  78. <if test="village != null and village != ''"> and vi.village = #{village}</if>
  79. <if test="villagerGroup != null and villagerGroup != ''"> and vi.villager_group = #{villagerGroup}</if>
  80. <if test="houseType != null and houseType != ''"> and vi.house_type = #{houseType}</if>
  81. <if test="domicile != null and domicile != ''"> and vi.domicile = #{domicile}</if>
  82. <if test="province != null and province != ''"> and vi.province = #{province}</if>
  83. <if test="city != null and city != ''"> and vi.city = #{city}</if>
  84. <if test="region != null and region != ''"> and vi.region = #{region}</if>
  85. <if test="userName != null and userName != ''"> and vi.user_name like concat('%', #{userName}, '%')</if>
  86. <if test="gender != null and gender != ''"> and vi.gender = #{gender}</if>
  87. <if test="idCard != null and idCard != ''"> and vi.id_card like concat('%', #{idCard}, '%')</if>
  88. <if test="phoneNum != null and phoneNum != ''"> and vi.phone_num = #{phoneNum}</if>
  89. <if test="keyIndustries != null and keyIndustries != ''"> and vi.key_industries = #{keyIndustries}</if>
  90. <if test="isVaccination != null and isVaccination != ''"> and vi.is_vaccination = #{isVaccination}</if>
  91. <if test="params.startAge != null and params.startAge != ''"> and vi.age &gt;= #{params.startAge}</if>
  92. <if test="params.endAge != null and params.endAge != ''"> and vi.age &lt;= #{params.endAge}</if>
  93. <if test="contraindication != null and contraindication != ''"> and vi.contraindication = #{contraindication}</if>
  94. <if test="suspend != null and suspend != ''"> and vi.suspend = #{suspend}</if>
  95. <if test="shouldBe != null and shouldBe != ''"> and vi.should_be = #{shouldBe}</if>
  96. <if test="other != null and other != ''"> and vi.other = #{other}</if>
  97. <if test="status != null and status != ''"> and vi.status = #{status}</if>
  98. <if test="code != null and code != ''"> and vi.code = #{code}</if>
  99. <if test="birthday != null and birthday != ''"> and vi.birthday = #{birthday}</if>
  100. <if test="workUnit != null and workUnit != ''"> and vi.work_unit = #{workUnit}</if>
  101. <if test="crowdClassification != null and crowdClassification != ''"> and vi.crowd_classification = #{crowdClassification}</if>
  102. <if test="manufacturer != null and manufacturer != ''"> and vi.manufacturer = #{manufacturer}</if>
  103. <if test="nowIn != null and nowIn != ''"> and vi.now_in = #{nowIn}</if>
  104. <if test="idCardS != null and idCardS.size() > 0">
  105. and vi.id_card in
  106. <foreach item="idCard" collection="idCardS" open="(" separator="," close=")">
  107. #{idCard}
  108. </foreach>
  109. </if>
  110. </where>
  111. order by vi.create_time DESC
  112. </select>
  113. <select id="selectVaccineInfoListByPage" parameterType="Integer" resultMap="VaccineInfoResult">
  114. select * from vaccine_info limit #{startNum}, #{endNum}
  115. </select>
  116. <select id="selectVaccineInfoById" parameterType="Long" resultMap="VaccineInfoResult">
  117. <include refid="selectVaccineInfoVo"/>
  118. where vi.id = #{id} and vi.is_del = 'N'
  119. order by viu.vaccination_time
  120. </select>
  121. <select id="selectVaccineInfoByIds" parameterType="Long" resultMap="VaccineInfoResult">
  122. <include refid="selectVaccineInfoVo"/>
  123. where vi.id in
  124. <foreach item="id" collection="array" open="(" separator="," close=")">
  125. #{id}
  126. </foreach>
  127. and vi.is_del = 'N'
  128. </select>
  129. <insert id="insertVaccineInfo" parameterType="VaccineInfoOperation" useGeneratedKeys="true" keyProperty="id">
  130. insert into vaccine_info
  131. <trim prefix="(" suffix=")" suffixOverrides=",">
  132. <if test="villageTowns != null">village_towns,</if>
  133. <if test="village != null">village,</if>
  134. <if test="villagerGroup != null">villager_group,</if>
  135. <if test="houseType != null">house_type,</if>
  136. <if test="domicile != null">domicile,</if>
  137. <if test="province != null">province,</if>
  138. <if test="city != null">city,</if>
  139. <if test="region != null and region != ''">region,</if>
  140. <if test="userName != null">user_name,</if>
  141. <if test="gender != null">gender,</if>
  142. <if test="idCard != null">id_card,</if>
  143. <if test="phoneNum != null">phone_num,</if>
  144. <if test="keyIndustries != null">key_industries,</if>
  145. <if test="isVaccination != null">is_vaccination,</if>
  146. <if test="vaccineName != null">vaccine_name,</if>
  147. <if test="jici != null">jici,</if>
  148. <if test="vaccinationTime != null">vaccination_time,</if>
  149. <if test="vaccinationPlace != null">vaccination_place,</if>
  150. <if test="contraindication != null">contraindication,</if>
  151. <if test="suspend != null">suspend,</if>
  152. <if test="shouldBe != null">should_be,</if>
  153. <if test="other != null">other,</if>
  154. <if test="progress != null">progress,</if>
  155. <if test="remark != null">remark,</if>
  156. <if test="status != null">status,</if>
  157. <if test="createBy != null">create_by,</if>
  158. <if test="updateBy != null">update_by,</if>
  159. <if test="updateTime != null">update_time,</if>
  160. <if test="isDel != null and isDel != ''">is_del,</if>
  161. <if test="code != null and code != ''">code,</if>
  162. <if test="birthday != null and birthday != ''">birthday,</if>
  163. <if test="workUnit != null and workUnit != ''">work_unit,</if>
  164. <if test="crowdClassification != null and crowdClassification != ''">crowd_classification,</if>
  165. <if test="manufacturer != null and manufacturer != ''">manufacturer,</if>
  166. <if test="nowIn != null and nowIn != ''">now_in,</if>
  167. <if test="url != null and url != ''">url,</if>
  168. <if test="shouldSlow != null and shouldSlow != ''">should_slow,</if>
  169. <if test="suspendUrl != null and suspendUrl != ''">suspend_url,</if>
  170. <if test="otherUrl != null and otherUrl != ''">suspend_url,</if>
  171. create_time
  172. </trim>
  173. <trim prefix="values (" suffix=")" suffixOverrides=",">
  174. <if test="villageTowns != null">#{villageTowns},</if>
  175. <if test="village != null">#{village},</if>
  176. <if test="villagerGroup != null">#{villagerGroup},</if>
  177. <if test="houseType != null">#{houseType},</if>
  178. <if test="domicile != null">#{domicile},</if>
  179. <if test="province != null">#{province},</if>
  180. <if test="city != null">#{city},</if>
  181. <if test="region != null and region != ''">#{region},</if>
  182. <if test="userName != null">#{userName},</if>
  183. <if test="gender != null">#{gender},</if>
  184. <if test="idCard != null">#{idCard},</if>
  185. <if test="phoneNum != null">#{phoneNum},</if>
  186. <if test="keyIndustries != null">#{keyIndustries},</if>
  187. <if test="isVaccination != null">#{isVaccination},</if>
  188. <if test="vaccineName != null">#{vaccineName},</if>
  189. <if test="jici != null">#{jici},</if>
  190. <if test="vaccinationTime != null">#{vaccinationTime},</if>
  191. <if test="vaccinationPlace != null">#{vaccinationPlace},</if>
  192. <if test="contraindication != null">#{contraindication},</if>
  193. <if test="suspend != null">#{suspend},</if>
  194. <if test="shouldBe != null">#{shouldBe},</if>
  195. <if test="other != null">#{other},</if>
  196. <if test="progress != null">#{progress},</if>
  197. <if test="remark != null">#{remark},</if>
  198. <if test="status != null">#{status},</if>
  199. <if test="createBy != null">#{createBy},</if>
  200. <if test="updateBy != null">#{updateBy},</if>
  201. <if test="updateTime != null">#{updateTime},</if>
  202. <if test="isDel != null and isDel != ''">#{isDel},</if>
  203. <if test="code != null and code != ''">#{code},</if>
  204. <if test="birthday != null and birthday != ''">#{birthday},</if>
  205. <if test="workUnit != null and workUnit != ''">#{workUnit},</if>
  206. <if test="crowdClassification != null and crowdClassification != ''">#{crowdClassification},</if>
  207. <if test="manufacturer != null and manufacturer != ''">#{manufacturer},</if>
  208. <if test="nowIn != null and nowIn != ''">#{nowIn},</if>
  209. <if test="url != null and url != ''">#{url},</if>
  210. <if test="shouldSlow != null and shouldSlow != ''">#{shouldSlow},</if>
  211. <if test="suspendUrl != null and suspendUrl != ''">#{suspendUrl},</if>
  212. <if test="otherUrl != null and otherUrl != ''">#{otherUrl},</if>
  213. sysdate()
  214. </trim>
  215. </insert>
  216. <update id="updateVaccineInfo" parameterType="VaccineInfoOperation">
  217. update vaccine_info
  218. <trim prefix="SET" suffixOverrides=",">
  219. <if test="villageTowns != null">village_towns = #{villageTowns},</if>
  220. <if test="village != null">village = #{village},</if>
  221. <if test="villagerGroup != null">villager_group = #{villagerGroup},</if>
  222. <if test="houseType != null">house_type = #{houseType},</if>
  223. <if test="domicile != null">domicile = #{domicile},</if>
  224. <if test="province != null">province = #{province},</if>
  225. <if test="city != null">city = #{city},</if>
  226. <if test="region != null and region != ''">region = #{region},</if>
  227. <if test="userName != null">user_name = #{userName},</if>
  228. <if test="gender != null">gender = #{gender},</if>
  229. <if test="idCard != null">id_card = #{idCard},</if>
  230. <if test="phoneNum != null">phone_num = #{phoneNum},</if>
  231. <if test="keyIndustries != null">key_industries = #{keyIndustries},</if>
  232. <if test="isVaccination != null">is_vaccination = #{isVaccination},</if>
  233. <if test="vaccineName != null">vaccine_name = #{vaccineName},</if>
  234. <if test="jici != null">jici = #{jici},</if>
  235. <if test="vaccinationTime != null">vaccination_time = #{vaccinationTime},</if>
  236. <if test="vaccinationPlace != null">vaccination_place = #{vaccinationPlace},</if>
  237. <if test="contraindication != null">contraindication = #{contraindication},</if>
  238. <if test="suspend != null">suspend = #{suspend},</if>
  239. <if test="shouldBe != null">should_be = #{shouldBe},</if>
  240. <if test="other != null">other = #{other},</if>
  241. <if test="progress != null">progress = #{progress},</if>
  242. <if test="remark != null">remark = #{remark},</if>
  243. <if test="status != null">status = #{status},</if>
  244. <if test="createBy != null">create_by = #{createBy},</if>
  245. <if test="createTime != null">create_time = #{createTime},</if>
  246. <if test="updateBy != null">update_by = #{updateBy},</if>
  247. <if test="updateTime != null">update_time = #{updateTime},</if>
  248. <if test="isDel != null and isDel != ''">is_del = #{isDel},</if>
  249. <if test="code != null and code != ''">code = #{code},</if>
  250. <if test="birthday != null and birthday != ''">birthday = #{birthday},</if>
  251. <if test="workUnit != null and workUnit != ''">work_unit = #{workUnit},</if>
  252. <if test="crowdClassification != null and crowdClassification != ''">crowd_classification = #{crowdClassification},</if>
  253. <if test="manufacturer != null and manufacturer != ''">manufacturer = #{manufacturer},</if>
  254. <if test="nowIn != null and nowIn != ''">now_in = #{nowIn},</if>
  255. <if test="url != null and url != ''">url = #{url},</if>
  256. <if test="shouldSlow != null and shouldSlow != ''">should_slow = #{shouldSlow},</if>
  257. <if test="suspendUrl != null and suspendUrl != ''">suspend_url = #{suspendUrl},</if>
  258. <if test="otherUrl != null and otherUrl != ''">other_url = #{otherUrl},</if>
  259. </trim>
  260. where id = #{id}
  261. </update>
  262. <delete id="deleteVaccineInfoById" parameterType="Long">
  263. update vaccine_info set is_del = 'Y' where id = #{id}
  264. </delete>
  265. <delete id="deleteVaccineInfoByIds" parameterType="String">
  266. update vaccine_info set is_del = 'Y' where id in
  267. <foreach item="id" collection="array" open="(" separator="," close=")">
  268. #{id}
  269. </foreach>
  270. </delete>
  271. <select id="findHjInfo" parameterType="VaccineInfoOperation" resultMap="VaccineInfoResult">
  272. select xm as user_name,xb as gender,csrq as birthday from hj
  273. <where>
  274. <if test="idCard != null and idCard != '' ">zjhm = #{idCard}</if>
  275. </where>
  276. limit 1
  277. </select>
  278. <select id="selectSysDictDataByDictLabel" parameterType="string" resultType="String">
  279. select dict_value from sys_dict_data where dict_label = #{vaccineName} and status = '0'
  280. </select>
  281. </mapper>