SysHospitalInfoMapper.xml 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297
  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
  3. <mapper namespace="com.xinxin.topro.sysservice.dao.mysqlmapper.SysHospitalInfooMapper" >
  4. <resultMap id="BaseResultMap" type="com.xinxin.topro.sysservice.dao.mysqlmodel.SysHospitalInfo" >
  5. <id column="HI_ID" property="hiId" jdbcType="INTEGER" />
  6. <result column="HI_Name" property="hiName" jdbcType="VARCHAR" />
  7. <result column="HI_ShortName" property="hiShortname" jdbcType="VARCHAR" />
  8. <result column="HI_FullName" property="hiFullname" jdbcType="VARCHAR" />
  9. <result column="HI_Address" property="hiAddress" jdbcType="VARCHAR" />
  10. <result column="HI_Tel" property="hiTel" jdbcType="VARCHAR" />
  11. <result column="HI_Intro" property="hiIntro" jdbcType="VARCHAR" />
  12. <result column="HI_PinyinCode" property="hiPinyincode" jdbcType="VARCHAR" />
  13. <result column="HI_WubiCode" property="hiWubicode" jdbcType="VARCHAR" />
  14. <result column="HI_OtherCode" property="hiOthercode" jdbcType="VARCHAR" />
  15. <result column="HI_ISDel" property="hiIsdel" jdbcType="INTEGER" />
  16. <result column="HI_SupID" property="hiSupid" jdbcType="INTEGER" />
  17. <result column="HI_Auth_Code" property="hiAuthCode" jdbcType="VARCHAR" />
  18. <result column="HI_Active_Time" property="hiActiveTime" jdbcType="TIMESTAMP" />
  19. <result column="HI_Aging_Time" property="hiAgingTime" jdbcType="TIMESTAMP" />
  20. <result column="HI_Login_Code" property="hiLoginCode" jdbcType="VARCHAR" />
  21. </resultMap>
  22. <resultMap id="ExtendsMap" type="com.xinxin.topro.sysservice.vo.SysHospitalInfoVO" extends="BaseResultMap">
  23. <result column="hiSupName" property="hiSupName" jdbcType="VARCHAR" />
  24. </resultMap>
  25. <sql id="Base_Column_List" >
  26. HI_ID, HI_Name, HI_ShortName, HI_FullName, HI_Address, HI_Tel, HI_Intro, HI_PinyinCode,
  27. HI_WubiCode, HI_OtherCode, HI_ISDel, HI_SupID, HI_Auth_Code, HI_Active_Time, HI_Aging_Time,
  28. HI_Login_Code
  29. </sql>
  30. <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
  31. select
  32. <include refid="Base_Column_List" />
  33. from sys_hospitalinfo
  34. where HI_ID = #{hiId,jdbcType=INTEGER}
  35. </select>
  36. <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer" >
  37. delete from sys_hospitalinfo
  38. where HI_ID = #{hiId,jdbcType=INTEGER}
  39. </delete>
  40. <insert id="insert" parameterType="com.xinxin.topro.sysservice.dao.mysqlmodel.SysHospitalInfo" >
  41. insert into sys_hospitalinfo (HI_ID, HI_Name, HI_ShortName,
  42. HI_FullName, HI_Address, HI_Tel,
  43. HI_Intro, HI_PinyinCode, HI_WubiCode,
  44. HI_OtherCode, HI_ISDel, HI_SupID,
  45. HI_Auth_Code, HI_Active_Time, HI_Aging_Time,
  46. HI_Login_Code
  47. )
  48. values (#{hiId,jdbcType=INTEGER}, #{hiName,jdbcType=VARCHAR}, #{hiShortname,jdbcType=VARCHAR},
  49. #{hiFullname,jdbcType=VARCHAR}, #{hiAddress,jdbcType=VARCHAR}, #{hiTel,jdbcType=VARCHAR},
  50. #{hiIntro,jdbcType=VARCHAR}, #{hiPinyincode,jdbcType=VARCHAR}, #{hiWubicode,jdbcType=VARCHAR},
  51. #{hiOthercode,jdbcType=VARCHAR}, #{hiIsdel,jdbcType=INTEGER}, #{hiSupid,jdbcType=INTEGER},
  52. #{hiAuthCode,jdbcType=VARCHAR}, #{hiActiveTime,jdbcType=TIMESTAMP}, #{hiAgingTime,jdbcType=TIMESTAMP},
  53. #{hiLoginCode,jdbcType=VARCHAR}
  54. )
  55. </insert>
  56. <insert id="insertSelective" parameterType="com.xinxin.topro.sysservice.dao.mysqlmodel.SysHospitalInfo" >
  57. insert into sys_hospitalinfo
  58. <trim prefix="(" suffix=")" suffixOverrides="," >
  59. <if test="hiId != null" >
  60. HI_ID,
  61. </if>
  62. <if test="hiName != null" >
  63. HI_Name,
  64. </if>
  65. <if test="hiShortname != null" >
  66. HI_ShortName,
  67. </if>
  68. <if test="hiFullname != null" >
  69. HI_FullName,
  70. </if>
  71. <if test="hiAddress != null" >
  72. HI_Address,
  73. </if>
  74. <if test="hiTel != null" >
  75. HI_Tel,
  76. </if>
  77. <if test="hiIntro != null" >
  78. HI_Intro,
  79. </if>
  80. <if test="hiPinyincode != null" >
  81. HI_PinyinCode,
  82. </if>
  83. <if test="hiWubicode != null" >
  84. HI_WubiCode,
  85. </if>
  86. <if test="hiOthercode != null" >
  87. HI_OtherCode,
  88. </if>
  89. <if test="hiIsdel != null" >
  90. HI_ISDel,
  91. </if>
  92. <if test="hiSupid != null" >
  93. HI_SupID,
  94. </if>
  95. <if test="hiAuthCode != null" >
  96. HI_Auth_Code,
  97. </if>
  98. <if test="hiActiveTime != null" >
  99. HI_Active_Time,
  100. </if>
  101. <if test="hiAgingTime != null" >
  102. HI_Aging_Time,
  103. </if>
  104. <if test="hiLoginCode != null" >
  105. HI_Login_Code,
  106. </if>
  107. </trim>
  108. <trim prefix="values (" suffix=")" suffixOverrides="," >
  109. <if test="hiId != null" >
  110. #{hiId,jdbcType=INTEGER},
  111. </if>
  112. <if test="hiName != null" >
  113. #{hiName,jdbcType=VARCHAR},
  114. </if>
  115. <if test="hiShortname != null" >
  116. #{hiShortname,jdbcType=VARCHAR},
  117. </if>
  118. <if test="hiFullname != null" >
  119. #{hiFullname,jdbcType=VARCHAR},
  120. </if>
  121. <if test="hiAddress != null" >
  122. #{hiAddress,jdbcType=VARCHAR},
  123. </if>
  124. <if test="hiTel != null" >
  125. #{hiTel,jdbcType=VARCHAR},
  126. </if>
  127. <if test="hiIntro != null" >
  128. #{hiIntro,jdbcType=VARCHAR},
  129. </if>
  130. <if test="hiPinyincode != null" >
  131. #{hiPinyincode,jdbcType=VARCHAR},
  132. </if>
  133. <if test="hiWubicode != null" >
  134. #{hiWubicode,jdbcType=VARCHAR},
  135. </if>
  136. <if test="hiOthercode != null" >
  137. #{hiOthercode,jdbcType=VARCHAR},
  138. </if>
  139. <if test="hiIsdel != null" >
  140. #{hiIsdel,jdbcType=INTEGER},
  141. </if>
  142. <if test="hiSupid != null" >
  143. #{hiSupid,jdbcType=INTEGER},
  144. </if>
  145. <if test="hiAuthCode != null" >
  146. #{hiAuthCode,jdbcType=VARCHAR},
  147. </if>
  148. <if test="hiActiveTime != null" >
  149. #{hiActiveTime,jdbcType=TIMESTAMP},
  150. </if>
  151. <if test="hiAgingTime != null" >
  152. #{hiAgingTime,jdbcType=TIMESTAMP},
  153. </if>
  154. <if test="hiLoginCode != null" >
  155. #{hiLoginCode,jdbcType=VARCHAR},
  156. </if>
  157. </trim>
  158. </insert>
  159. <update id="updateByPrimaryKeySelective" parameterType="com.xinxin.topro.sysservice.dao.mysqlmodel.SysHospitalInfo" >
  160. update sys_hospitalinfo
  161. <set >
  162. <if test="hiName != null" >
  163. HI_Name = #{hiName,jdbcType=VARCHAR},
  164. </if>
  165. <if test="hiShortname != null" >
  166. HI_ShortName = #{hiShortname,jdbcType=VARCHAR},
  167. </if>
  168. <if test="hiFullname != null" >
  169. HI_FullName = #{hiFullname,jdbcType=VARCHAR},
  170. </if>
  171. <if test="hiAddress != null" >
  172. HI_Address = #{hiAddress,jdbcType=VARCHAR},
  173. </if>
  174. <if test="hiTel != null" >
  175. HI_Tel = #{hiTel,jdbcType=VARCHAR},
  176. </if>
  177. <if test="hiIntro != null" >
  178. HI_Intro = #{hiIntro,jdbcType=VARCHAR},
  179. </if>
  180. <if test="hiPinyincode != null" >
  181. HI_PinyinCode = #{hiPinyincode,jdbcType=VARCHAR},
  182. </if>
  183. <if test="hiWubicode != null" >
  184. HI_WubiCode = #{hiWubicode,jdbcType=VARCHAR},
  185. </if>
  186. <if test="hiOthercode != null" >
  187. HI_OtherCode = #{hiOthercode,jdbcType=VARCHAR},
  188. </if>
  189. <if test="hiIsdel != null" >
  190. HI_ISDel = #{hiIsdel,jdbcType=INTEGER},
  191. </if>
  192. <if test="hiSupid != null" >
  193. HI_SupID = #{hiSupid,jdbcType=INTEGER},
  194. </if>
  195. <if test="hiAuthCode != null" >
  196. HI_Auth_Code = #{hiAuthCode,jdbcType=VARCHAR},
  197. </if>
  198. <if test="hiActiveTime != null" >
  199. HI_Active_Time = #{hiActiveTime,jdbcType=TIMESTAMP},
  200. </if>
  201. <if test="hiAgingTime != null" >
  202. HI_Aging_Time = #{hiAgingTime,jdbcType=TIMESTAMP},
  203. </if>
  204. <if test="hiLoginCode != null" >
  205. HI_Login_Code = #{hiLoginCode,jdbcType=VARCHAR},
  206. </if>
  207. </set>
  208. where HI_ID = #{hiId,jdbcType=INTEGER}
  209. </update>
  210. <update id="updateByPrimaryKey" parameterType="com.xinxin.topro.sysservice.dao.mysqlmodel.SysHospitalInfo" >
  211. update sys_hospitalinfo
  212. set HI_Name = #{hiName,jdbcType=VARCHAR},
  213. HI_ShortName = #{hiShortname,jdbcType=VARCHAR},
  214. HI_FullName = #{hiFullname,jdbcType=VARCHAR},
  215. HI_Address = #{hiAddress,jdbcType=VARCHAR},
  216. HI_Tel = #{hiTel,jdbcType=VARCHAR},
  217. HI_Intro = #{hiIntro,jdbcType=VARCHAR},
  218. HI_PinyinCode = #{hiPinyincode,jdbcType=VARCHAR},
  219. HI_WubiCode = #{hiWubicode,jdbcType=VARCHAR},
  220. HI_OtherCode = #{hiOthercode,jdbcType=VARCHAR},
  221. HI_SupID = #{hiSupid,jdbcType=INTEGER},
  222. HI_Auth_Code = #{hiAuthCode,jdbcType=VARCHAR},
  223. HI_Active_Time = #{hiActiveTime,jdbcType=TIMESTAMP},
  224. HI_Aging_Time = #{hiAgingTime,jdbcType=TIMESTAMP},
  225. HI_Login_Code = #{hiLoginCode,jdbcType=VARCHAR}
  226. where HI_ID = #{hiId,jdbcType=INTEGER}
  227. </update>
  228. <select id="selectHospitalPage" resultMap="BaseResultMap" >
  229. SELECT
  230. <include refid="Base_Column_List" />
  231. FROM
  232. sys_hospitalinfo
  233. <where>
  234. HI_ISDel = 0
  235. <if test="hiName != null and hiName != '' ">
  236. and (
  237. or HI_Name like CONCAT('%',#{hiName,jdbcType=VARCHAR},'%')
  238. or HI_PinyinCode like CONCAT('%',#{hiName,jdbcType=VARCHAR},'%')
  239. or HI_WubiCode like CONCAT('%',#{hiName,jdbcType=VARCHAR},'%')
  240. or HI_OtherCode like CONCAT('%',#{hiName,jdbcType=VARCHAR},'%'))
  241. </if>
  242. </where>
  243. </select>
  244. <update id="updateDel" parameterType="com.xinxin.topro.sysservice.dao.mysqlmodel.SysHospitalInfo" >
  245. update sys_hospitalinfo
  246. set
  247. HI_ISDel = #{hiIsdel,jdbcType=INTEGER}
  248. where HI_ID = #{hiId,jdbcType=INTEGER}
  249. </update>
  250. <select id="getAllList" resultMap="BaseResultMap">
  251. select
  252. <include refid="Base_Column_List" />
  253. from sys_hospitalinfo
  254. where HI_ISDel = 0
  255. </select>
  256. <insert id="insertHospital" parameterType="com.xinxin.topro.sysservice.dao.mysqlmodel.SysHospitalInfo" >
  257. insert into sys_hospitalinfo (HI_Name, HI_ShortName,
  258. HI_FullName, HI_Address, HI_Tel,
  259. HI_Intro, HI_PinyinCode, HI_WubiCode,
  260. HI_OtherCode, HI_ISDel, HI_SupID,
  261. HI_Auth_Code, HI_Active_Time, HI_Aging_Time
  262. )
  263. values (#{hiName,jdbcType=VARCHAR}, #{hiShortname,jdbcType=VARCHAR},
  264. #{hiFullname,jdbcType=VARCHAR}, #{hiAddress,jdbcType=VARCHAR}, #{hiTel,jdbcType=VARCHAR},
  265. #{hiIntro,jdbcType=VARCHAR}, #{hiPinyincode,jdbcType=VARCHAR}, #{hiWubicode,jdbcType=VARCHAR},
  266. #{hiOthercode,jdbcType=VARCHAR}, #{hiIsdel,jdbcType=INTEGER}, #{hiSupid,jdbcType=INTEGER},
  267. #{hiAuthCode,jdbcType=VARCHAR}, #{hiActiveTime,jdbcType=TIMESTAMP}, #{hiAgingTime,jdbcType=TIMESTAMP}
  268. )
  269. </insert>
  270. <update id="delHospitals" parameterType="java.lang.Integer">
  271. update sys_hospitalinfo set HI_ISDel =-1 where HI_ID =#{hiId,jdbcType=INTEGER}
  272. </update>
  273. <select id="selectHospitals" resultMap="ExtendsMap" >
  274. SELECT
  275. <include refid="Base_Column_List" />,
  276. (select b.HI_Name from sys_hospitalinfo b where b.HI_ID = a.HI_SupID and a.HI_SupID!=0) hiSupName
  277. FROM
  278. sys_hospitalinfo a
  279. where
  280. HI_ISDel = 0
  281. </select>
  282. <select id="selectByKeyName" resultMap="ExtendsMap">
  283. select <include refid="Base_Column_List"/>,
  284. (select b.HI_Name from sys_hospitalinfo b where b.HI_ID = a.HI_SupID and a.HI_SupID!=0) hiSupName
  285. from sys_hospitalinfo a where HI_ISDel = 0 and (
  286. HI_Name like CONCAT('%',#{hiName,jdbcType=VARCHAR},'%')
  287. or HI_PinyinCode like CONCAT('%',#{hiName,jdbcType=VARCHAR},'%')
  288. or HI_WubiCode like CONCAT('%',#{hiName,jdbcType=VARCHAR},'%')
  289. or HI_OtherCode like CONCAT('%',#{hiName,jdbcType=VARCHAR},'%'))
  290. </select>
  291. </mapper>