QwExternalContactInfoMapper.xml 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267
  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.fs.qw.mapper.QwExternalContactInfoMapper">
  6. <resultMap type="QwExternalContactInfo" id="QwExternalContactInfoResult">
  7. <result property="id" column="id" />
  8. <result property="externalContactId" column="external_contact_id" />
  9. <result property="name" column="name" />
  10. <result property="sex" column="sex" />
  11. <result property="age" column="age" />
  12. <result property="address" column="address" />
  13. <result property="habits" column="habits" />
  14. <result property="illnessTime" column="illness_time" />
  15. <result property="body" column="body" />
  16. <result property="study" column="study" />
  17. <result property="courseStatus" column="course_status" />
  18. <result property="family" column="family" />
  19. <result property="familyDisease" column="family_disease" />
  20. <result property="talk" column="talk" />
  21. <result property="userType" column="user_type" />
  22. <result property="isSelf" column="is_self" />
  23. <result property="intensify" column="intensify" />
  24. <result property="isCold" column="is_cold" />
  25. <result property="coldBody" column="cold_body" />
  26. <result property="sweat" column="sweat" />
  27. <result property="other" column="other" />
  28. <result property="toilet" column="toilet" />
  29. <result property="eat" column="eat" />
  30. <result property="menses" column="menses" />
  31. <result property="medicine" column="medicine" />
  32. <result property="constitution" column="constitution" />
  33. <result property="recommendMedicine" column="recommend_medicine" />
  34. <result property="consultProduct" column="consult_product" />
  35. <result property="isBuy" column="is_buy" />
  36. <result property="buyProduct" column="buy_product" />
  37. <result property="createTime" column="create_time" />
  38. <result property="updateTime" column="update_time" />
  39. <result property="disease" column="disease" />
  40. <result property="isLine" column="is_line" />
  41. <result property="course" column="course" />
  42. <result property="productTalk" column="product_talk" />
  43. <result property="diseaseTalk" column="disease_talk" />
  44. </resultMap>
  45. <sql id="selectQwExternalContactInfoVo">
  46. select id, external_contact_id,course,product_talk,disease_talk, name,disease,is_line, sex, age, address, habits, illness_time, body, study, course_status, family, family_disease, talk, user_type, is_self, intensify, is_cold, cold_body, sweat, other, toilet, eat, menses, medicine, constitution, recommend_medicine, consult_product, is_buy, buy_product, create_time, update_time from qw_external_contact_info
  47. </sql>
  48. <select id="selectQwExternalContactInfoList" parameterType="QwExternalContactInfo" resultMap="QwExternalContactInfoResult">
  49. <include refid="selectQwExternalContactInfoVo"/>
  50. <where>
  51. <if test="externalContactId != null "> and external_contact_id = #{externalContactId}</if>
  52. <if test="name != null and name != ''"> and name like concat('%', #{name}, '%')</if>
  53. <if test="sex != null and sex != ''"> and sex = #{sex}</if>
  54. <if test="age != null and age != ''"> and age = #{age}</if>
  55. <if test="address != null and address != ''"> and address = #{address}</if>
  56. <if test="habits != null and habits != ''"> and habits = #{habits}</if>
  57. <if test="illnessTime != null and illnessTime != ''"> and illness_time = #{illnessTime}</if>
  58. <if test="body != null and body != ''"> and body = #{body}</if>
  59. <if test="study != null and study != ''"> and study = #{study}</if>
  60. <if test="courseStatus != null and courseStatus != ''"> and course_status = #{courseStatus}</if>
  61. <if test="family != null and family != ''"> and family = #{family}</if>
  62. <if test="familyDisease != null and familyDisease != ''"> and family_disease = #{familyDisease}</if>
  63. <if test="talk != null and talk != ''"> and talk = #{talk}</if>
  64. <if test="userType != null and userType != ''"> and user_type = #{userType}</if>
  65. <if test="isSelf != null and isSelf != ''"> and is_self = #{isSelf}</if>
  66. <if test="intensify != null and intensify != ''"> and intensify = #{intensify}</if>
  67. <if test="isCold != null and isCold != ''"> and is_cold = #{isCold}</if>
  68. <if test="coldBody != null and coldBody != ''"> and cold_body = #{coldBody}</if>
  69. <if test="sweat != null and sweat != ''"> and sweat = #{sweat}</if>
  70. <if test="other != null and other != ''"> and other = #{other}</if>
  71. <if test="toilet != null and toilet != ''"> and toilet = #{toilet}</if>
  72. <if test="eat != null and eat != ''"> and eat = #{eat}</if>
  73. <if test="menses != null and menses != ''"> and menses = #{menses}</if>
  74. <if test="medicine != null and medicine != ''"> and medicine = #{medicine}</if>
  75. <if test="constitution != null and constitution != ''"> and constitution = #{constitution}</if>
  76. <if test="recommendMedicine != null and recommendMedicine != ''"> and recommend_medicine = #{recommendMedicine}</if>
  77. <if test="consultProduct != null and consultProduct != ''"> and consult_product = #{consultProduct}</if>
  78. <if test="isBuy != null and isBuy != ''"> and is_buy = #{isBuy}</if>
  79. <if test="buyProduct != null and buyProduct != ''"> and buy_product = #{buyProduct}</if>
  80. </where>
  81. </select>
  82. <select id="selectQwExternalContactInfoById" parameterType="Long" resultMap="QwExternalContactInfoResult">
  83. <include refid="selectQwExternalContactInfoVo"/>
  84. where id = #{id}
  85. </select>
  86. <insert id="insertQwExternalContactInfo" parameterType="QwExternalContactInfo" useGeneratedKeys="true" keyProperty="id">
  87. insert into qw_external_contact_info
  88. <trim prefix="(" suffix=")" suffixOverrides=",">
  89. <if test="externalContactId != null">external_contact_id,</if>
  90. <if test="name != null">name,</if>
  91. <if test="sex != null">sex,</if>
  92. <if test="age != null">age,</if>
  93. <if test="address != null">address,</if>
  94. <if test="habits != null">habits,</if>
  95. <if test="illnessTime != null">illness_time,</if>
  96. <if test="body != null">body,</if>
  97. <if test="study != null">study,</if>
  98. <if test="courseStatus != null">course_status,</if>
  99. <if test="family != null">family,</if>
  100. <if test="familyDisease != null">family_disease,</if>
  101. <if test="talk != null">talk,</if>
  102. <if test="userType != null">user_type,</if>
  103. <if test="isSelf != null">is_self,</if>
  104. <if test="intensify != null">intensify,</if>
  105. <if test="isCold != null">is_cold,</if>
  106. <if test="coldBody != null">cold_body,</if>
  107. <if test="sweat != null">sweat,</if>
  108. <if test="other != null">other,</if>
  109. <if test="toilet != null">toilet,</if>
  110. <if test="eat != null">eat,</if>
  111. <if test="menses != null">menses,</if>
  112. <if test="medicine != null">medicine,</if>
  113. <if test="constitution != null">constitution,</if>
  114. <if test="recommendMedicine != null">recommend_medicine,</if>
  115. <if test="consultProduct != null">consult_product,</if>
  116. <if test="isBuy != null">is_buy,</if>
  117. <if test="buyProduct != null">buy_product,</if>
  118. <if test="createTime != null">create_time,</if>
  119. <if test="updateTime != null">update_time,</if>
  120. <if test="disease != null">disease,</if>
  121. <if test="isLine != null">is_line,</if>
  122. <if test="course != null">course,</if>
  123. <if test="productTalk != null">product_talk,</if>
  124. <if test="diseaseTalk != null">disease_talk,</if>
  125. </trim>
  126. <trim prefix="values (" suffix=")" suffixOverrides=",">
  127. <if test="externalContactId != null">#{externalContactId},</if>
  128. <if test="name != null">#{name},</if>
  129. <if test="sex != null">#{sex},</if>
  130. <if test="age != null">#{age},</if>
  131. <if test="address != null">#{address},</if>
  132. <if test="habits != null">#{habits},</if>
  133. <if test="illnessTime != null">#{illnessTime},</if>
  134. <if test="body != null">#{body},</if>
  135. <if test="study != null">#{study},</if>
  136. <if test="courseStatus != null">#{courseStatus},</if>
  137. <if test="family != null">#{family},</if>
  138. <if test="familyDisease != null">#{familyDisease},</if>
  139. <if test="talk != null">#{talk},</if>
  140. <if test="userType != null">#{userType},</if>
  141. <if test="isSelf != null">#{isSelf},</if>
  142. <if test="intensify != null">#{intensify},</if>
  143. <if test="isCold != null">#{isCold},</if>
  144. <if test="coldBody != null">#{coldBody},</if>
  145. <if test="sweat != null">#{sweat},</if>
  146. <if test="other != null">#{other},</if>
  147. <if test="toilet != null">#{toilet},</if>
  148. <if test="eat != null">#{eat},</if>
  149. <if test="menses != null">#{menses},</if>
  150. <if test="medicine != null">#{medicine},</if>
  151. <if test="constitution != null">#{constitution},</if>
  152. <if test="recommendMedicine != null">#{recommendMedicine},</if>
  153. <if test="consultProduct != null">#{consultProduct},</if>
  154. <if test="isBuy != null">#{isBuy},</if>
  155. <if test="buyProduct != null">#{buyProduct},</if>
  156. <if test="createTime != null">#{createTime},</if>
  157. <if test="updateTime != null">#{updateTime},</if>
  158. <if test="disease != null">#{disease},</if>
  159. <if test="isLine != null">#{isLine},</if>
  160. <if test="course != null">#{course},</if>
  161. <if test="productTalk != null">#{productTalk},</if>
  162. <if test="diseaseTalk != null">#{diseaseTalk},</if>
  163. </trim>
  164. </insert>
  165. <update id="updateQwExternalContactInfo" parameterType="QwExternalContactInfo">
  166. update qw_external_contact_info
  167. <trim prefix="SET" suffixOverrides=",">
  168. <if test="externalContactId != null">external_contact_id = #{externalContactId},</if>
  169. <if test="name != null">name = #{name},</if>
  170. <if test="sex != null">sex = #{sex},</if>
  171. <if test="age != null">age = #{age},</if>
  172. <if test="address != null">address = #{address},</if>
  173. <if test="habits != null">habits = #{habits},</if>
  174. <if test="illnessTime != null">illness_time = #{illnessTime},</if>
  175. <if test="body != null">body = #{body},</if>
  176. <if test="study != null">study = #{study},</if>
  177. <if test="courseStatus != null">course_status = #{courseStatus},</if>
  178. <if test="family != null">family = #{family},</if>
  179. <if test="familyDisease != null">family_disease = #{familyDisease},</if>
  180. <if test="talk != null">talk = #{talk},</if>
  181. <if test="userType != null">user_type = #{userType},</if>
  182. <if test="isSelf != null">is_self = #{isSelf},</if>
  183. <if test="intensify != null">intensify = #{intensify},</if>
  184. <if test="isCold != null">is_cold = #{isCold},</if>
  185. <if test="coldBody != null">cold_body = #{coldBody},</if>
  186. <if test="sweat != null">sweat = #{sweat},</if>
  187. <if test="other != null">other = #{other},</if>
  188. <if test="toilet != null">toilet = #{toilet},</if>
  189. <if test="eat != null">eat = #{eat},</if>
  190. <if test="menses != null">menses = #{menses},</if>
  191. <if test="medicine != null">medicine = #{medicine},</if>
  192. <if test="constitution != null">constitution = #{constitution},</if>
  193. <if test="recommendMedicine != null">recommend_medicine = #{recommendMedicine},</if>
  194. <if test="consultProduct != null">consult_product = #{consultProduct},</if>
  195. <if test="isBuy != null">is_buy = #{isBuy},</if>
  196. <if test="buyProduct != null">buy_product = #{buyProduct},</if>
  197. <if test="createTime != null">create_time = #{createTime},</if>
  198. <if test="updateTime != null">update_time = #{updateTime},</if>
  199. <if test="disease != null">disease = #{disease},</if>
  200. <if test="isLine != null">is_line = #{isLine},</if>
  201. <if test="course != null">course = #{course},</if>
  202. <if test="productTalk != null">product_talk = #{productTalk},</if>
  203. <if test="diseaseTalk != null">disease_talk = #{diseaseTalk},</if>
  204. </trim>
  205. where id = #{id}
  206. </update>
  207. <update id="updateQwExternalContactInfoByExternalContactId">
  208. update qw_external_contact_info
  209. <trim prefix="SET" suffixOverrides=",">
  210. <if test="externalContactId != null">external_contact_id = #{externalContactId},</if>
  211. <if test="name != null">name = #{name},</if>
  212. <if test="sex != null">sex = #{sex},</if>
  213. <if test="age != null">age = #{age},</if>
  214. <if test="address != null">address = #{address},</if>
  215. <if test="habits != null">habits = #{habits},</if>
  216. <if test="illnessTime != null">illness_time = #{illnessTime},</if>
  217. <if test="body != null">body = #{body},</if>
  218. <if test="study != null">study = #{study},</if>
  219. <if test="courseStatus != null">course_status = #{courseStatus},</if>
  220. <if test="family != null">family = #{family},</if>
  221. <if test="familyDisease != null">family_disease = #{familyDisease},</if>
  222. <if test="talk != null">talk = #{talk},</if>
  223. <if test="userType != null">user_type = #{userType},</if>
  224. <if test="isSelf != null">is_self = #{isSelf},</if>
  225. <if test="intensify != null">intensify = #{intensify},</if>
  226. <if test="isCold != null">is_cold = #{isCold},</if>
  227. <if test="coldBody != null">cold_body = #{coldBody},</if>
  228. <if test="sweat != null">sweat = #{sweat},</if>
  229. <if test="other != null">other = #{other},</if>
  230. <if test="toilet != null">toilet = #{toilet},</if>
  231. <if test="eat != null">eat = #{eat},</if>
  232. <if test="menses != null">menses = #{menses},</if>
  233. <if test="medicine != null">medicine = #{medicine},</if>
  234. <if test="constitution != null">constitution = #{constitution},</if>
  235. <if test="recommendMedicine != null">recommend_medicine = #{recommendMedicine},</if>
  236. <if test="consultProduct != null">consult_product = #{consultProduct},</if>
  237. <if test="isBuy != null">is_buy = #{isBuy},</if>
  238. <if test="buyProduct != null">buy_product = #{buyProduct},</if>
  239. <if test="createTime != null">create_time = #{createTime},</if>
  240. <if test="updateTime != null">update_time = #{updateTime},</if>
  241. <if test="disease != null">disease = #{disease},</if>
  242. <if test="isLine != null">is_line = #{isLine},</if>
  243. <if test="course != null">course = #{course},</if>
  244. <if test="productTalk != null">product_talk = #{productTalk},</if>
  245. <if test="diseaseTalk != null">disease_talk = #{diseaseTalk},</if>
  246. </trim>
  247. where external_contact_id = #{externalContactId}
  248. </update>
  249. <delete id="deleteQwExternalContactInfoById" parameterType="Long">
  250. delete from qw_external_contact_info where id = #{id}
  251. </delete>
  252. <delete id="deleteQwExternalContactInfoByIds" parameterType="String">
  253. delete from qw_external_contact_info where id in
  254. <foreach item="id" collection="array" open="(" separator="," close=")">
  255. #{id}
  256. </foreach>
  257. </delete>
  258. </mapper>