CustomUserMapper.xml 13 KB

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