PcSiteUserMapper.xml 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344
  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.hz.employmentsite.mapper.PcSiteUserMapper">
  4. <resultMap id="BaseResultMap" type="com.hz.employmentsite.model.PcSiteUser">
  5. <id column="SiteUserID" jdbcType="VARCHAR" property="siteUserID" />
  6. <result column="SiteUserName" jdbcType="VARCHAR" property="siteUserName" />
  7. <result column="UserID" jdbcType="VARCHAR" property="userID" />
  8. <result column="SiteID" jdbcType="VARCHAR" property="siteID" />
  9. <result column="Gender" jdbcType="INTEGER" property="gender" />
  10. <result column="Mobile" jdbcType="VARCHAR" property="mobile" />
  11. <result column="RoleID" jdbcType="INTEGER" property="roleID" />
  12. <result column="CreateUserID" jdbcType="VARCHAR" property="createUserID" />
  13. <result column="CreateTime" jdbcType="TIMESTAMP" property="createTime" />
  14. <result column="UpdateBy" jdbcType="VARCHAR" property="updateBy" />
  15. <result column="UpdateTime" jdbcType="TIMESTAMP" property="updateTime" />
  16. <result column="UserNo" jdbcType="VARCHAR" property="userNo" />
  17. <result column="IDCard" jdbcType="VARCHAR" property="IDCard" />
  18. </resultMap>
  19. <sql id="Example_Where_Clause">
  20. <where>
  21. <foreach collection="oredCriteria" item="criteria" separator="or">
  22. <if test="criteria.valid">
  23. <trim prefix="(" prefixOverrides="and" suffix=")">
  24. <foreach collection="criteria.criteria" item="criterion">
  25. <choose>
  26. <when test="criterion.noValue">
  27. and ${criterion.condition}
  28. </when>
  29. <when test="criterion.singleValue">
  30. and ${criterion.condition} #{criterion.value}
  31. </when>
  32. <when test="criterion.betweenValue">
  33. and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
  34. </when>
  35. <when test="criterion.listValue">
  36. and ${criterion.condition}
  37. <foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
  38. #{listItem}
  39. </foreach>
  40. </when>
  41. </choose>
  42. </foreach>
  43. </trim>
  44. </if>
  45. </foreach>
  46. </where>
  47. </sql>
  48. <sql id="Update_By_Example_Where_Clause">
  49. <where>
  50. <foreach collection="example.oredCriteria" item="criteria" separator="or">
  51. <if test="criteria.valid">
  52. <trim prefix="(" prefixOverrides="and" suffix=")">
  53. <foreach collection="criteria.criteria" item="criterion">
  54. <choose>
  55. <when test="criterion.noValue">
  56. and ${criterion.condition}
  57. </when>
  58. <when test="criterion.singleValue">
  59. and ${criterion.condition} #{criterion.value}
  60. </when>
  61. <when test="criterion.betweenValue">
  62. and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
  63. </when>
  64. <when test="criterion.listValue">
  65. and ${criterion.condition}
  66. <foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
  67. #{listItem}
  68. </foreach>
  69. </when>
  70. </choose>
  71. </foreach>
  72. </trim>
  73. </if>
  74. </foreach>
  75. </where>
  76. </sql>
  77. <sql id="Base_Column_List">
  78. SiteUserID, SiteUserName, UserID, SiteID, Gender, Mobile, RoleID, CreateUserID, CreateTime,
  79. UpdateBy, UpdateTime, UserNo, IDCard
  80. </sql>
  81. <select id="selectByExample" parameterType="com.hz.employmentsite.model.PcSiteUserExample" resultMap="BaseResultMap">
  82. select
  83. <if test="distinct">
  84. distinct
  85. </if>
  86. <include refid="Base_Column_List" />
  87. from pc_site_user
  88. <if test="_parameter != null">
  89. <include refid="Example_Where_Clause" />
  90. </if>
  91. <if test="orderByClause != null">
  92. order by ${orderByClause}
  93. </if>
  94. </select>
  95. <select id="selectByPrimaryKey" parameterType="java.lang.String" resultMap="BaseResultMap">
  96. select
  97. <include refid="Base_Column_List" />
  98. from pc_site_user
  99. where SiteUserID = #{siteUserID,jdbcType=VARCHAR}
  100. </select>
  101. <delete id="deleteByPrimaryKey" parameterType="java.lang.String">
  102. delete from pc_site_user
  103. where SiteUserID = #{siteUserID,jdbcType=VARCHAR}
  104. </delete>
  105. <delete id="deleteByExample" parameterType="com.hz.employmentsite.model.PcSiteUserExample">
  106. delete from pc_site_user
  107. <if test="_parameter != null">
  108. <include refid="Example_Where_Clause" />
  109. </if>
  110. </delete>
  111. <insert id="insert" parameterType="com.hz.employmentsite.model.PcSiteUser">
  112. insert into pc_site_user (SiteUserID, SiteUserName, UserID,
  113. SiteID, Gender, Mobile,
  114. RoleID, CreateUserID, CreateTime,
  115. UpdateBy, UpdateTime, UserNo,
  116. IDCard)
  117. values (#{siteUserID,jdbcType=VARCHAR}, #{siteUserName,jdbcType=VARCHAR}, #{userID,jdbcType=VARCHAR},
  118. #{siteID,jdbcType=VARCHAR}, #{gender,jdbcType=INTEGER}, #{mobile,jdbcType=VARCHAR},
  119. #{roleID,jdbcType=INTEGER}, #{createUserID,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP},
  120. #{updateBy,jdbcType=VARCHAR}, #{updateTime,jdbcType=TIMESTAMP}, #{userNo,jdbcType=VARCHAR},
  121. #{IDCard,jdbcType=VARCHAR})
  122. </insert>
  123. <insert id="insertSelective" parameterType="com.hz.employmentsite.model.PcSiteUser">
  124. insert into pc_site_user
  125. <trim prefix="(" suffix=")" suffixOverrides=",">
  126. <if test="siteUserID != null">
  127. SiteUserID,
  128. </if>
  129. <if test="siteUserName != null">
  130. SiteUserName,
  131. </if>
  132. <if test="userID != null">
  133. UserID,
  134. </if>
  135. <if test="siteID != null">
  136. SiteID,
  137. </if>
  138. <if test="gender != null">
  139. Gender,
  140. </if>
  141. <if test="mobile != null">
  142. Mobile,
  143. </if>
  144. <if test="roleID != null">
  145. RoleID,
  146. </if>
  147. <if test="createUserID != null">
  148. CreateUserID,
  149. </if>
  150. <if test="createTime != null">
  151. CreateTime,
  152. </if>
  153. <if test="updateBy != null">
  154. UpdateBy,
  155. </if>
  156. <if test="updateTime != null">
  157. UpdateTime,
  158. </if>
  159. <if test="userNo != null">
  160. UserNo,
  161. </if>
  162. <if test="IDCard != null">
  163. IDCard,
  164. </if>
  165. </trim>
  166. <trim prefix="values (" suffix=")" suffixOverrides=",">
  167. <if test="siteUserID != null">
  168. #{siteUserID,jdbcType=VARCHAR},
  169. </if>
  170. <if test="siteUserName != null">
  171. #{siteUserName,jdbcType=VARCHAR},
  172. </if>
  173. <if test="userID != null">
  174. #{userID,jdbcType=VARCHAR},
  175. </if>
  176. <if test="siteID != null">
  177. #{siteID,jdbcType=VARCHAR},
  178. </if>
  179. <if test="gender != null">
  180. #{gender,jdbcType=INTEGER},
  181. </if>
  182. <if test="mobile != null">
  183. #{mobile,jdbcType=VARCHAR},
  184. </if>
  185. <if test="roleID != null">
  186. #{roleID,jdbcType=INTEGER},
  187. </if>
  188. <if test="createUserID != null">
  189. #{createUserID,jdbcType=VARCHAR},
  190. </if>
  191. <if test="createTime != null">
  192. #{createTime,jdbcType=TIMESTAMP},
  193. </if>
  194. <if test="updateBy != null">
  195. #{updateBy,jdbcType=VARCHAR},
  196. </if>
  197. <if test="updateTime != null">
  198. #{updateTime,jdbcType=TIMESTAMP},
  199. </if>
  200. <if test="userNo != null">
  201. #{userNo,jdbcType=VARCHAR},
  202. </if>
  203. <if test="IDCard != null">
  204. #{IDCard,jdbcType=VARCHAR},
  205. </if>
  206. </trim>
  207. </insert>
  208. <select id="countByExample" parameterType="com.hz.employmentsite.model.PcSiteUserExample" resultType="java.lang.Long">
  209. select count(*) from pc_site_user
  210. <if test="_parameter != null">
  211. <include refid="Example_Where_Clause" />
  212. </if>
  213. </select>
  214. <update id="updateByExampleSelective" parameterType="map">
  215. update pc_site_user
  216. <set>
  217. <if test="row.siteUserID != null">
  218. SiteUserID = #{row.siteUserID,jdbcType=VARCHAR},
  219. </if>
  220. <if test="row.siteUserName != null">
  221. SiteUserName = #{row.siteUserName,jdbcType=VARCHAR},
  222. </if>
  223. <if test="row.userID != null">
  224. UserID = #{row.userID,jdbcType=VARCHAR},
  225. </if>
  226. <if test="row.siteID != null">
  227. SiteID = #{row.siteID,jdbcType=VARCHAR},
  228. </if>
  229. <if test="row.gender != null">
  230. Gender = #{row.gender,jdbcType=INTEGER},
  231. </if>
  232. <if test="row.mobile != null">
  233. Mobile = #{row.mobile,jdbcType=VARCHAR},
  234. </if>
  235. <if test="row.roleID != null">
  236. RoleID = #{row.roleID,jdbcType=INTEGER},
  237. </if>
  238. <if test="row.createUserID != null">
  239. CreateUserID = #{row.createUserID,jdbcType=VARCHAR},
  240. </if>
  241. <if test="row.createTime != null">
  242. CreateTime = #{row.createTime,jdbcType=TIMESTAMP},
  243. </if>
  244. <if test="row.updateBy != null">
  245. UpdateBy = #{row.updateBy,jdbcType=VARCHAR},
  246. </if>
  247. <if test="row.updateTime != null">
  248. UpdateTime = #{row.updateTime,jdbcType=TIMESTAMP},
  249. </if>
  250. <if test="row.userNo != null">
  251. UserNo = #{row.userNo,jdbcType=VARCHAR},
  252. </if>
  253. <if test="row.IDCard != null">
  254. IDCard = #{row.IDCard,jdbcType=VARCHAR},
  255. </if>
  256. </set>
  257. <if test="example != null">
  258. <include refid="Update_By_Example_Where_Clause" />
  259. </if>
  260. </update>
  261. <update id="updateByExample" parameterType="map">
  262. update pc_site_user
  263. set SiteUserID = #{row.siteUserID,jdbcType=VARCHAR},
  264. SiteUserName = #{row.siteUserName,jdbcType=VARCHAR},
  265. UserID = #{row.userID,jdbcType=VARCHAR},
  266. SiteID = #{row.siteID,jdbcType=VARCHAR},
  267. Gender = #{row.gender,jdbcType=INTEGER},
  268. Mobile = #{row.mobile,jdbcType=VARCHAR},
  269. RoleID = #{row.roleID,jdbcType=INTEGER},
  270. CreateUserID = #{row.createUserID,jdbcType=VARCHAR},
  271. CreateTime = #{row.createTime,jdbcType=TIMESTAMP},
  272. UpdateBy = #{row.updateBy,jdbcType=VARCHAR},
  273. UpdateTime = #{row.updateTime,jdbcType=TIMESTAMP},
  274. UserNo = #{row.userNo,jdbcType=VARCHAR},
  275. IDCard = #{row.IDCard,jdbcType=VARCHAR}
  276. <if test="example != null">
  277. <include refid="Update_By_Example_Where_Clause" />
  278. </if>
  279. </update>
  280. <update id="updateByPrimaryKeySelective" parameterType="com.hz.employmentsite.model.PcSiteUser">
  281. update pc_site_user
  282. <set>
  283. <if test="siteUserName != null">
  284. SiteUserName = #{siteUserName,jdbcType=VARCHAR},
  285. </if>
  286. <if test="userID != null">
  287. UserID = #{userID,jdbcType=VARCHAR},
  288. </if>
  289. <if test="siteID != null">
  290. SiteID = #{siteID,jdbcType=VARCHAR},
  291. </if>
  292. <if test="gender != null">
  293. Gender = #{gender,jdbcType=INTEGER},
  294. </if>
  295. <if test="mobile != null">
  296. Mobile = #{mobile,jdbcType=VARCHAR},
  297. </if>
  298. <if test="roleID != null">
  299. RoleID = #{roleID,jdbcType=INTEGER},
  300. </if>
  301. <if test="createUserID != null">
  302. CreateUserID = #{createUserID,jdbcType=VARCHAR},
  303. </if>
  304. <if test="createTime != null">
  305. CreateTime = #{createTime,jdbcType=TIMESTAMP},
  306. </if>
  307. <if test="updateBy != null">
  308. UpdateBy = #{updateBy,jdbcType=VARCHAR},
  309. </if>
  310. <if test="updateTime != null">
  311. UpdateTime = #{updateTime,jdbcType=TIMESTAMP},
  312. </if>
  313. <if test="userNo != null">
  314. UserNo = #{userNo,jdbcType=VARCHAR},
  315. </if>
  316. <if test="IDCard != null">
  317. IDCard = #{IDCard,jdbcType=VARCHAR},
  318. </if>
  319. </set>
  320. where SiteUserID = #{siteUserID,jdbcType=VARCHAR}
  321. </update>
  322. <update id="updateByPrimaryKey" parameterType="com.hz.employmentsite.model.PcSiteUser">
  323. update pc_site_user
  324. set SiteUserName = #{siteUserName,jdbcType=VARCHAR},
  325. UserID = #{userID,jdbcType=VARCHAR},
  326. SiteID = #{siteID,jdbcType=VARCHAR},
  327. Gender = #{gender,jdbcType=INTEGER},
  328. Mobile = #{mobile,jdbcType=VARCHAR},
  329. RoleID = #{roleID,jdbcType=INTEGER},
  330. CreateUserID = #{createUserID,jdbcType=VARCHAR},
  331. CreateTime = #{createTime,jdbcType=TIMESTAMP},
  332. UpdateBy = #{updateBy,jdbcType=VARCHAR},
  333. UpdateTime = #{updateTime,jdbcType=TIMESTAMP},
  334. UserNo = #{userNo,jdbcType=VARCHAR},
  335. IDCard = #{IDCard,jdbcType=VARCHAR}
  336. where SiteUserID = #{siteUserID,jdbcType=VARCHAR}
  337. </update>
  338. <select id="selectByMobile" resultType="String">
  339. select SiteID
  340. from pc_site_user
  341. where mobile = #{mobile,jdbcType=VARCHAR}
  342. </select>
  343. </mapper>