VaccineInfoMapper.xml 18 KB

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