SysUserInfoMapper.xml 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435
  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.inpnurseservice.mysqlmapper.SysUserInfoMapper" >
  4. <resultMap id="BaseResultMap" type="com.xinxin.topro.inpnurseservice.mysqlmodel.SysUserInfo" >
  5. <id column="UI_ID" property="uiId" jdbcType="INTEGER" />
  6. <result column="UI_Code" property="uiCode" jdbcType="VARCHAR" />
  7. <result column="SS_Password" property="ssPassword" jdbcType="VARCHAR" />
  8. <result column="UI_Name" property="uiName" jdbcType="VARCHAR" />
  9. <result column="UI_Phone" property="uiPhone" jdbcType="VARCHAR" />
  10. <result column="UI_IDNumber" property="uiIdnumber" jdbcType="VARCHAR" />
  11. <result column="UI_Sex" property="uiSex" jdbcType="INTEGER" />
  12. <result column="UI_Birthday" property="uiBirthday" jdbcType="DATE" />
  13. <result column="UI_Email" property="uiEmail" jdbcType="VARCHAR" />
  14. <result column="UI_EntryData" property="uiEntrydata" jdbcType="DATE" />
  15. <result column="SS_DepartmentID" property="ssDepartmentid" jdbcType="INTEGER" />
  16. <result column="SS_WardID" property="ssWardid" jdbcType="INTEGER" />
  17. <result column="SS_Type" property="ssType" jdbcType="INTEGER" />
  18. <result column="SS_Nature" property="ssNature" jdbcType="INTEGER" />
  19. <result column="SS_PessoalDate" property="ssPessoaldate" jdbcType="DATE" />
  20. <result column="SS_Nativeplace" property="ssNativeplace" jdbcType="VARCHAR" />
  21. <result column="SS_Politics" property="ssPolitics" jdbcType="VARCHAR" />
  22. <result column="SS_WorkDate" property="ssWorkdate" jdbcType="DATE" />
  23. <result column="SS_Degree" property="ssDegree" jdbcType="VARCHAR" />
  24. <result column="SS_MaritalStatus" property="ssMaritalstatus" jdbcType="INTEGER" />
  25. <result column="SS_Nation" property="ssNation" jdbcType="VARCHAR" />
  26. <result column="SS_Level" property="ssLevel" jdbcType="VARCHAR" />
  27. <result column="SS_PinyinCode" property="ssPinyincode" jdbcType="VARCHAR" />
  28. <result column="SS_WubiCode" property="ssWubicode" jdbcType="VARCHAR" />
  29. <result column="SS_OtherCode" property="ssOthercode" jdbcType="VARCHAR" />
  30. <result column="SS_ISDel" property="ssIsdel" jdbcType="INTEGER" />
  31. <result column="HI_ID" property="hiId" jdbcType="INTEGER" />
  32. <result column="SU_Sign_Img" property="suSignImg" jdbcType="VARCHAR" />
  33. </resultMap>
  34. <sql id="Base_Column_List" >
  35. UI_ID, UI_Code, SS_Password, UI_Name, UI_Phone, UI_IDNumber, UI_Sex, UI_Birthday,
  36. UI_Email, UI_EntryData, SS_DepartmentID, SS_WardID, SS_Type, SS_Nature, SS_PessoalDate,
  37. SS_Nativeplace, SS_Politics, SS_WorkDate, SS_Degree, SS_MaritalStatus, SS_Nation,
  38. SS_Level, SS_PinyinCode, SS_WubiCode, SS_OtherCode, SS_ISDel, HI_ID, SU_Sign_Img
  39. </sql>
  40. <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
  41. select
  42. <include refid="Base_Column_List" />
  43. from sys_userinfo
  44. where SS_ISDel = 0 and UI_ID = #{uiId,jdbcType=INTEGER}
  45. </select>
  46. <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer" >
  47. delete from sys_userinfo
  48. where UI_ID = #{uiId,jdbcType=INTEGER}
  49. </delete>
  50. <insert id="insert" parameterType="com.xinxin.topro.inpnurseservice.mysqlmodel.SysUserInfo" >
  51. insert into sys_userinfo (UI_ID, UI_Code, SS_Password,
  52. UI_Name, UI_Phone, UI_IDNumber,
  53. UI_Sex, UI_Birthday, UI_Email,
  54. UI_EntryData, SS_DepartmentID, SS_WardID,
  55. SS_Type, SS_Nature, SS_PessoalDate,
  56. SS_Nativeplace, SS_Politics, SS_WorkDate,
  57. SS_Degree, SS_MaritalStatus, SS_Nation,
  58. SS_Level, SS_PinyinCode, SS_WubiCode,
  59. SS_OtherCode, SS_ISDel, HI_ID, SU_Sign_Img
  60. )
  61. values (#{uiId,jdbcType=INTEGER}, #{uiCode,jdbcType=VARCHAR}, #{ssPassword,jdbcType=VARCHAR},
  62. #{uiName,jdbcType=VARCHAR}, #{uiPhone,jdbcType=VARCHAR}, #{uiIdnumber,jdbcType=VARCHAR},
  63. #{uiSex,jdbcType=INTEGER}, #{uiBirthday,jdbcType=DATE}, #{uiEmail,jdbcType=VARCHAR},
  64. #{uiEntrydata,jdbcType=DATE}, #{ssDepartmentid,jdbcType=INTEGER}, #{ssWardid,jdbcType=INTEGER},
  65. #{ssType,jdbcType=INTEGER}, #{ssNature,jdbcType=INTEGER}, #{ssPessoaldate,jdbcType=DATE},
  66. #{ssNativeplace,jdbcType=VARCHAR}, #{ssPolitics,jdbcType=VARCHAR}, #{ssWorkdate,jdbcType=DATE},
  67. #{ssDegree,jdbcType=VARCHAR}, #{ssMaritalstatus,jdbcType=INTEGER}, #{ssNation,jdbcType=VARCHAR},
  68. #{ssLevel,jdbcType=VARCHAR}, #{ssPinyincode,jdbcType=VARCHAR}, #{ssWubicode,jdbcType=VARCHAR},
  69. #{ssOthercode,jdbcType=VARCHAR}, #{ssIsdel,jdbcType=INTEGER}, #{hiId,jdbcType=INTEGER},
  70. #{suSignImg,jdbcType=VARCHAR}
  71. )
  72. </insert>
  73. <insert id="insertSelective" parameterType="com.xinxin.topro.inpnurseservice.mysqlmodel.SysUserInfo" >
  74. insert into sys_userinfo
  75. <trim prefix="(" suffix=")" suffixOverrides="," >
  76. <if test="uiId != null" >
  77. UI_ID,
  78. </if>
  79. <if test="uiCode != null" >
  80. UI_Code,
  81. </if>
  82. <if test="ssPassword != null" >
  83. SS_Password,
  84. </if>
  85. <if test="uiName != null" >
  86. UI_Name,
  87. </if>
  88. <if test="uiPhone != null" >
  89. UI_Phone,
  90. </if>
  91. <if test="uiIdnumber != null" >
  92. UI_IDNumber,
  93. </if>
  94. <if test="uiSex != null" >
  95. UI_Sex,
  96. </if>
  97. <if test="uiBirthday != null" >
  98. UI_Birthday,
  99. </if>
  100. <if test="uiEmail != null" >
  101. UI_Email,
  102. </if>
  103. <if test="uiEntrydata != null" >
  104. UI_EntryData,
  105. </if>
  106. <if test="ssDepartmentid != null" >
  107. SS_DepartmentID,
  108. </if>
  109. <if test="ssWardid != null" >
  110. SS_WardID,
  111. </if>
  112. <if test="ssType != null" >
  113. SS_Type,
  114. </if>
  115. <if test="ssNature != null" >
  116. SS_Nature,
  117. </if>
  118. <if test="ssPessoaldate != null" >
  119. SS_PessoalDate,
  120. </if>
  121. <if test="ssNativeplace != null" >
  122. SS_Nativeplace,
  123. </if>
  124. <if test="ssPolitics != null" >
  125. SS_Politics,
  126. </if>
  127. <if test="ssWorkdate != null" >
  128. SS_WorkDate,
  129. </if>
  130. <if test="ssDegree != null" >
  131. SS_Degree,
  132. </if>
  133. <if test="ssMaritalstatus != null" >
  134. SS_MaritalStatus,
  135. </if>
  136. <if test="ssNation != null" >
  137. SS_Nation,
  138. </if>
  139. <if test="ssLevel != null" >
  140. SS_Level,
  141. </if>
  142. <if test="ssPinyincode != null" >
  143. SS_PinyinCode,
  144. </if>
  145. <if test="ssWubicode != null" >
  146. SS_WubiCode,
  147. </if>
  148. <if test="ssOthercode != null" >
  149. SS_OtherCode,
  150. </if>
  151. <if test="ssIsdel != null" >
  152. SS_ISDel,
  153. </if>
  154. <if test="hiId != null" >
  155. HI_ID,
  156. </if>
  157. <if test="suSignImg != null" >
  158. SU_Sign_Img,
  159. </if>
  160. </trim>
  161. <trim prefix="values (" suffix=")" suffixOverrides="," >
  162. <if test="uiId != null" >
  163. #{uiId,jdbcType=INTEGER},
  164. </if>
  165. <if test="uiCode != null" >
  166. #{uiCode,jdbcType=VARCHAR},
  167. </if>
  168. <if test="ssPassword != null" >
  169. #{ssPassword,jdbcType=VARCHAR},
  170. </if>
  171. <if test="uiName != null" >
  172. #{uiName,jdbcType=VARCHAR},
  173. </if>
  174. <if test="uiPhone != null" >
  175. #{uiPhone,jdbcType=VARCHAR},
  176. </if>
  177. <if test="uiIdnumber != null" >
  178. #{uiIdnumber,jdbcType=VARCHAR},
  179. </if>
  180. <if test="uiSex != null" >
  181. #{uiSex,jdbcType=INTEGER},
  182. </if>
  183. <if test="uiBirthday != null" >
  184. #{uiBirthday,jdbcType=DATE},
  185. </if>
  186. <if test="uiEmail != null" >
  187. #{uiEmail,jdbcType=VARCHAR},
  188. </if>
  189. <if test="uiEntrydata != null" >
  190. #{uiEntrydata,jdbcType=DATE},
  191. </if>
  192. <if test="ssDepartmentid != null" >
  193. #{ssDepartmentid,jdbcType=INTEGER},
  194. </if>
  195. <if test="ssWardid != null" >
  196. #{ssWardid,jdbcType=INTEGER},
  197. </if>
  198. <if test="ssType != null" >
  199. #{ssType,jdbcType=INTEGER},
  200. </if>
  201. <if test="ssNature != null" >
  202. #{ssNature,jdbcType=INTEGER},
  203. </if>
  204. <if test="ssPessoaldate != null" >
  205. #{ssPessoaldate,jdbcType=DATE},
  206. </if>
  207. <if test="ssNativeplace != null" >
  208. #{ssNativeplace,jdbcType=VARCHAR},
  209. </if>
  210. <if test="ssPolitics != null" >
  211. #{ssPolitics,jdbcType=VARCHAR},
  212. </if>
  213. <if test="ssWorkdate != null" >
  214. #{ssWorkdate,jdbcType=DATE},
  215. </if>
  216. <if test="ssDegree != null" >
  217. #{ssDegree,jdbcType=VARCHAR},
  218. </if>
  219. <if test="ssMaritalstatus != null" >
  220. #{ssMaritalstatus,jdbcType=INTEGER},
  221. </if>
  222. <if test="ssNation != null" >
  223. #{ssNation,jdbcType=VARCHAR},
  224. </if>
  225. <if test="ssLevel != null" >
  226. #{ssLevel,jdbcType=VARCHAR},
  227. </if>
  228. <if test="ssPinyincode != null" >
  229. #{ssPinyincode,jdbcType=VARCHAR},
  230. </if>
  231. <if test="ssWubicode != null" >
  232. #{ssWubicode,jdbcType=VARCHAR},
  233. </if>
  234. <if test="ssOthercode != null" >
  235. #{ssOthercode,jdbcType=VARCHAR},
  236. </if>
  237. <if test="ssIsdel != null" >
  238. #{ssIsdel,jdbcType=INTEGER},
  239. </if>
  240. <if test="hiId != null" >
  241. #{hiId,jdbcType=INTEGER},
  242. </if>
  243. <if test="suSignImg != null" >
  244. #{suSignImg,jdbcType=VARCHAR},
  245. </if>
  246. </trim>
  247. </insert>
  248. <update id="updateByPrimaryKeySelective" parameterType="com.xinxin.topro.inpnurseservice.mysqlmodel.SysUserInfo" >
  249. update sys_userinfo
  250. <set >
  251. <if test="uiCode != null" >
  252. UI_Code = #{uiCode,jdbcType=VARCHAR},
  253. </if>
  254. <if test="ssPassword != null" >
  255. SS_Password = #{ssPassword,jdbcType=VARCHAR},
  256. </if>
  257. <if test="uiName != null" >
  258. UI_Name = #{uiName,jdbcType=VARCHAR},
  259. </if>
  260. <if test="uiPhone != null" >
  261. UI_Phone = #{uiPhone,jdbcType=VARCHAR},
  262. </if>
  263. <if test="uiIdnumber != null" >
  264. UI_IDNumber = #{uiIdnumber,jdbcType=VARCHAR},
  265. </if>
  266. <if test="uiSex != null" >
  267. UI_Sex = #{uiSex,jdbcType=INTEGER},
  268. </if>
  269. <if test="uiBirthday != null" >
  270. UI_Birthday = #{uiBirthday,jdbcType=DATE},
  271. </if>
  272. <if test="uiEmail != null" >
  273. UI_Email = #{uiEmail,jdbcType=VARCHAR},
  274. </if>
  275. <if test="uiEntrydata != null" >
  276. UI_EntryData = #{uiEntrydata,jdbcType=DATE},
  277. </if>
  278. <if test="ssDepartmentid != null" >
  279. SS_DepartmentID = #{ssDepartmentid,jdbcType=INTEGER},
  280. </if>
  281. <if test="ssWardid != null" >
  282. SS_WardID = #{ssWardid,jdbcType=INTEGER},
  283. </if>
  284. <if test="ssType != null" >
  285. SS_Type = #{ssType,jdbcType=INTEGER},
  286. </if>
  287. <if test="ssNature != null" >
  288. SS_Nature = #{ssNature,jdbcType=INTEGER},
  289. </if>
  290. <if test="ssPessoaldate != null" >
  291. SS_PessoalDate = #{ssPessoaldate,jdbcType=DATE},
  292. </if>
  293. <if test="ssNativeplace != null" >
  294. SS_Nativeplace = #{ssNativeplace,jdbcType=VARCHAR},
  295. </if>
  296. <if test="ssPolitics != null" >
  297. SS_Politics = #{ssPolitics,jdbcType=VARCHAR},
  298. </if>
  299. <if test="ssWorkdate != null" >
  300. SS_WorkDate = #{ssWorkdate,jdbcType=DATE},
  301. </if>
  302. <if test="ssDegree != null" >
  303. SS_Degree = #{ssDegree,jdbcType=VARCHAR},
  304. </if>
  305. <if test="ssMaritalstatus != null" >
  306. SS_MaritalStatus = #{ssMaritalstatus,jdbcType=INTEGER},
  307. </if>
  308. <if test="ssNation != null" >
  309. SS_Nation = #{ssNation,jdbcType=VARCHAR},
  310. </if>
  311. <if test="ssLevel != null" >
  312. SS_Level = #{ssLevel,jdbcType=VARCHAR},
  313. </if>
  314. <if test="ssPinyincode != null" >
  315. SS_PinyinCode = #{ssPinyincode,jdbcType=VARCHAR},
  316. </if>
  317. <if test="ssWubicode != null" >
  318. SS_WubiCode = #{ssWubicode,jdbcType=VARCHAR},
  319. </if>
  320. <if test="ssOthercode != null" >
  321. SS_OtherCode = #{ssOthercode,jdbcType=VARCHAR},
  322. </if>
  323. <if test="ssIsdel != null" >
  324. SS_ISDel = #{ssIsdel,jdbcType=INTEGER},
  325. </if>
  326. <if test="hiId != null" >
  327. HI_ID = #{hiId,jdbcType=INTEGER},
  328. </if>
  329. <if test="suSignImg != null" >
  330. SU_Sign_Img = #{suSignImg,jdbcType=VARCHAR},
  331. </if>
  332. </set>
  333. where UI_ID = #{uiId,jdbcType=INTEGER}
  334. </update>
  335. <update id="updateByPrimaryKey" parameterType="com.xinxin.topro.inpnurseservice.mysqlmodel.SysUserInfo" >
  336. update sys_userinfo
  337. set UI_Code = #{uiCode,jdbcType=VARCHAR},
  338. SS_Password = #{ssPassword,jdbcType=VARCHAR},
  339. UI_Name = #{uiName,jdbcType=VARCHAR},
  340. UI_Phone = #{uiPhone,jdbcType=VARCHAR},
  341. UI_IDNumber = #{uiIdnumber,jdbcType=VARCHAR},
  342. UI_Sex = #{uiSex,jdbcType=INTEGER},
  343. UI_Birthday = #{uiBirthday,jdbcType=DATE},
  344. UI_Email = #{uiEmail,jdbcType=VARCHAR},
  345. UI_EntryData = #{uiEntrydata,jdbcType=DATE},
  346. SS_DepartmentID = #{ssDepartmentid,jdbcType=INTEGER},
  347. SS_WardID = #{ssWardid,jdbcType=INTEGER},
  348. SS_Type = #{ssType,jdbcType=INTEGER},
  349. SS_Nature = #{ssNature,jdbcType=INTEGER},
  350. SS_PessoalDate = #{ssPessoaldate,jdbcType=DATE},
  351. SS_Nativeplace = #{ssNativeplace,jdbcType=VARCHAR},
  352. SS_Politics = #{ssPolitics,jdbcType=VARCHAR},
  353. SS_WorkDate = #{ssWorkdate,jdbcType=DATE},
  354. SS_Degree = #{ssDegree,jdbcType=VARCHAR},
  355. SS_MaritalStatus = #{ssMaritalstatus,jdbcType=INTEGER},
  356. SS_Nation = #{ssNation,jdbcType=VARCHAR},
  357. SS_Level = #{ssLevel,jdbcType=VARCHAR},
  358. SS_PinyinCode = #{ssPinyincode,jdbcType=VARCHAR},
  359. SS_WubiCode = #{ssWubicode,jdbcType=VARCHAR},
  360. SS_OtherCode = #{ssOthercode,jdbcType=VARCHAR},
  361. SS_ISDel = #{ssIsdel,jdbcType=INTEGER},
  362. HI_ID = #{hiId,jdbcType=INTEGER},
  363. SU_Sign_Img = #{suSignImg,jdbcType=VARCHAR}
  364. where UI_ID = #{uiId,jdbcType=INTEGER}
  365. </update>
  366. <select id="selectNameByCode" resultType="java.lang.String">
  367. select UI_Name from sys_userinfo where UI_Code= #{uiCode,jdbcType=VARCHAR}
  368. </select>
  369. <select id="selectByHiId" resultMap="BaseResultMap">
  370. select
  371. <include refid="Base_Column_List" />
  372. from sys_userinfo
  373. where SS_ISDel = 0 AND
  374. HI_ID = #{hiId,jdbcType=INTEGER}
  375. </select>
  376. <select id="selectNameCodeByHiId" resultMap="BaseResultMap">
  377. select
  378. UI_Code,UI_Name,SS_PinyinCode,SS_WubiCode,SS_OtherCode
  379. from sys_userinfo
  380. where SS_ISDel = 0 AND
  381. HI_ID = #{hiId,jdbcType=INTEGER}
  382. order by UI_Code
  383. </select>
  384. <select id="selectByWardID" resultMap="BaseResultMap">
  385. SELECT * from sys_ward_permission a
  386. INNER JOIN sys_userinfo b on a.UI_Code = b.UI_Code and a.HI_ID = b.HI_ID
  387. where a.DW_WardDm = #{wardId} and b.SS_ISDel = 0 and a.SWP_IsDel = 0
  388. </select>
  389. <select id="selectByUiCode" resultMap="BaseResultMap">
  390. select
  391. <include refid="Base_Column_List"/>
  392. from sys_userinfo
  393. where SS_ISDel = 0
  394. and UI_Code = #{uiCode,jdbcType=VARCHAR}
  395. limit 1
  396. </select>
  397. <select id="countByUidAndPwd" resultType="java.lang.Integer">
  398. SELECT
  399. count(1)
  400. FROM
  401. sys_userinfo
  402. WHERE
  403. ui_id = #{uId}
  404. AND BINARY ss_password = #{pwd}
  405. AND ss_isdel = 0
  406. </select>
  407. <update id="updatePwd">
  408. UPDATE sys_userinfo
  409. SET ss_password = #{newPwd}
  410. WHERE
  411. ui_id = #{uId}
  412. AND ss_password = #{oldPwd}
  413. AND ss_isdel = 0
  414. </update>
  415. <select id="selectNameByUiCode" resultMap="BaseResultMap" parameterType="java.util.List">
  416. select <include refid="Base_Column_List"/>
  417. from sys_userinfo
  418. where SS_ISDel = 0
  419. and UI_Code IN
  420. <foreach collection="list" separator="," open="(" close=")" item="item">
  421. #{item}
  422. </foreach>
  423. </select>
  424. </mapper>