SysUserCfMajorMapper.xml 7.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211
  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.bowintek.smartsearch.mapper.SysUserCfMajorMapper">
  4. <resultMap id="BaseResultMap" type="com.bowintek.smartsearch.model.SysUserCfMajor">
  5. <id column="UserMajorID" jdbcType="VARCHAR" property="userMajorID" />
  6. <result column="UserID" jdbcType="VARCHAR" property="userID" />
  7. <result column="MajorID" jdbcType="VARCHAR" property="majorID" />
  8. <result column="CreateBy" jdbcType="VARCHAR" property="createBy" />
  9. <result column="CreateTime" jdbcType="TIMESTAMP" property="createTime" />
  10. </resultMap>
  11. <sql id="Example_Where_Clause">
  12. <where>
  13. <foreach collection="oredCriteria" item="criteria" separator="or">
  14. <if test="criteria.valid">
  15. <trim prefix="(" prefixOverrides="and" suffix=")">
  16. <foreach collection="criteria.criteria" item="criterion">
  17. <choose>
  18. <when test="criterion.noValue">
  19. and ${criterion.condition}
  20. </when>
  21. <when test="criterion.singleValue">
  22. and ${criterion.condition} #{criterion.value}
  23. </when>
  24. <when test="criterion.betweenValue">
  25. and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
  26. </when>
  27. <when test="criterion.listValue">
  28. and ${criterion.condition}
  29. <foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
  30. #{listItem}
  31. </foreach>
  32. </when>
  33. </choose>
  34. </foreach>
  35. </trim>
  36. </if>
  37. </foreach>
  38. </where>
  39. </sql>
  40. <sql id="Update_By_Example_Where_Clause">
  41. <where>
  42. <foreach collection="example.oredCriteria" item="criteria" separator="or">
  43. <if test="criteria.valid">
  44. <trim prefix="(" prefixOverrides="and" suffix=")">
  45. <foreach collection="criteria.criteria" item="criterion">
  46. <choose>
  47. <when test="criterion.noValue">
  48. and ${criterion.condition}
  49. </when>
  50. <when test="criterion.singleValue">
  51. and ${criterion.condition} #{criterion.value}
  52. </when>
  53. <when test="criterion.betweenValue">
  54. and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
  55. </when>
  56. <when test="criterion.listValue">
  57. and ${criterion.condition}
  58. <foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
  59. #{listItem}
  60. </foreach>
  61. </when>
  62. </choose>
  63. </foreach>
  64. </trim>
  65. </if>
  66. </foreach>
  67. </where>
  68. </sql>
  69. <sql id="Base_Column_List">
  70. UserMajorID, UserID, MajorID, CreateBy, CreateTime
  71. </sql>
  72. <select id="selectByExample" parameterType="com.bowintek.smartsearch.model.SysUserCfMajorExample" resultMap="BaseResultMap">
  73. select
  74. <if test="distinct">
  75. distinct
  76. </if>
  77. <include refid="Base_Column_List" />
  78. from sys_user_cf_major
  79. <if test="_parameter != null">
  80. <include refid="Example_Where_Clause" />
  81. </if>
  82. <if test="orderByClause != null">
  83. order by ${orderByClause}
  84. </if>
  85. </select>
  86. <select id="selectByPrimaryKey" parameterType="java.lang.String" resultMap="BaseResultMap">
  87. select
  88. <include refid="Base_Column_List" />
  89. from sys_user_cf_major
  90. where UserMajorID = #{userMajorID,jdbcType=VARCHAR}
  91. </select>
  92. <delete id="deleteByPrimaryKey" parameterType="java.lang.String">
  93. delete from sys_user_cf_major
  94. where UserMajorID = #{userMajorID,jdbcType=VARCHAR}
  95. </delete>
  96. <delete id="deleteByExample" parameterType="com.bowintek.smartsearch.model.SysUserCfMajorExample">
  97. delete from sys_user_cf_major
  98. <if test="_parameter != null">
  99. <include refid="Example_Where_Clause" />
  100. </if>
  101. </delete>
  102. <insert id="insert" parameterType="com.bowintek.smartsearch.model.SysUserCfMajor">
  103. insert into sys_user_cf_major (UserMajorID, UserID, MajorID,
  104. CreateBy, CreateTime)
  105. values (#{userMajorID,jdbcType=VARCHAR}, #{userID,jdbcType=VARCHAR}, #{majorID,jdbcType=VARCHAR},
  106. #{createBy,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP})
  107. </insert>
  108. <insert id="insertSelective" parameterType="com.bowintek.smartsearch.model.SysUserCfMajor">
  109. insert into sys_user_cf_major
  110. <trim prefix="(" suffix=")" suffixOverrides=",">
  111. <if test="userMajorID != null">
  112. UserMajorID,
  113. </if>
  114. <if test="userID != null">
  115. UserID,
  116. </if>
  117. <if test="majorID != null">
  118. MajorID,
  119. </if>
  120. <if test="createBy != null">
  121. CreateBy,
  122. </if>
  123. <if test="createTime != null">
  124. CreateTime,
  125. </if>
  126. </trim>
  127. <trim prefix="values (" suffix=")" suffixOverrides=",">
  128. <if test="userMajorID != null">
  129. #{userMajorID,jdbcType=VARCHAR},
  130. </if>
  131. <if test="userID != null">
  132. #{userID,jdbcType=VARCHAR},
  133. </if>
  134. <if test="majorID != null">
  135. #{majorID,jdbcType=VARCHAR},
  136. </if>
  137. <if test="createBy != null">
  138. #{createBy,jdbcType=VARCHAR},
  139. </if>
  140. <if test="createTime != null">
  141. #{createTime,jdbcType=TIMESTAMP},
  142. </if>
  143. </trim>
  144. </insert>
  145. <select id="countByExample" parameterType="com.bowintek.smartsearch.model.SysUserCfMajorExample" resultType="java.lang.Long">
  146. select count(*) from sys_user_cf_major
  147. <if test="_parameter != null">
  148. <include refid="Example_Where_Clause" />
  149. </if>
  150. </select>
  151. <update id="updateByExampleSelective" parameterType="map">
  152. update sys_user_cf_major
  153. <set>
  154. <if test="row.userMajorID != null">
  155. UserMajorID = #{row.userMajorID,jdbcType=VARCHAR},
  156. </if>
  157. <if test="row.userID != null">
  158. UserID = #{row.userID,jdbcType=VARCHAR},
  159. </if>
  160. <if test="row.majorID != null">
  161. MajorID = #{row.majorID,jdbcType=VARCHAR},
  162. </if>
  163. <if test="row.createBy != null">
  164. CreateBy = #{row.createBy,jdbcType=VARCHAR},
  165. </if>
  166. <if test="row.createTime != null">
  167. CreateTime = #{row.createTime,jdbcType=TIMESTAMP},
  168. </if>
  169. </set>
  170. <if test="example != null">
  171. <include refid="Update_By_Example_Where_Clause" />
  172. </if>
  173. </update>
  174. <update id="updateByExample" parameterType="map">
  175. update sys_user_cf_major
  176. set UserMajorID = #{row.userMajorID,jdbcType=VARCHAR},
  177. UserID = #{row.userID,jdbcType=VARCHAR},
  178. MajorID = #{row.majorID,jdbcType=VARCHAR},
  179. CreateBy = #{row.createBy,jdbcType=VARCHAR},
  180. CreateTime = #{row.createTime,jdbcType=TIMESTAMP}
  181. <if test="example != null">
  182. <include refid="Update_By_Example_Where_Clause" />
  183. </if>
  184. </update>
  185. <update id="updateByPrimaryKeySelective" parameterType="com.bowintek.smartsearch.model.SysUserCfMajor">
  186. update sys_user_cf_major
  187. <set>
  188. <if test="userID != null">
  189. UserID = #{userID,jdbcType=VARCHAR},
  190. </if>
  191. <if test="majorID != null">
  192. MajorID = #{majorID,jdbcType=VARCHAR},
  193. </if>
  194. <if test="createBy != null">
  195. CreateBy = #{createBy,jdbcType=VARCHAR},
  196. </if>
  197. <if test="createTime != null">
  198. CreateTime = #{createTime,jdbcType=TIMESTAMP},
  199. </if>
  200. </set>
  201. where UserMajorID = #{userMajorID,jdbcType=VARCHAR}
  202. </update>
  203. <update id="updateByPrimaryKey" parameterType="com.bowintek.smartsearch.model.SysUserCfMajor">
  204. update sys_user_cf_major
  205. set UserID = #{userID,jdbcType=VARCHAR},
  206. MajorID = #{majorID,jdbcType=VARCHAR},
  207. CreateBy = #{createBy,jdbcType=VARCHAR},
  208. CreateTime = #{createTime,jdbcType=TIMESTAMP}
  209. where UserMajorID = #{userMajorID,jdbcType=VARCHAR}
  210. </update>
  211. </mapper>