TUsingunitGroupMapper.xml 10.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276
  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.TUsingunitGroupMapper">
  4. <resultMap id="BaseResultMap" type="com.mvc.entity.TUsingunitGroup">
  5. <id column="ID" jdbcType="INTEGER" property="id" />
  6. <result column="GROUP_CODE" jdbcType="VARCHAR" property="groupCode" />
  7. <result column="GROUP_NAME" jdbcType="VARCHAR" property="groupName" />
  8. <result column="UNIT_CODE" jdbcType="VARCHAR" property="unitCode" />
  9. <result column="STATION_CODES" jdbcType="VARCHAR" property="stationCodes" />
  10. <result column="USE_FLAG" jdbcType="CHAR" property="useFlag" />
  11. <result column="MEMO" jdbcType="VARCHAR" property="memo" />
  12. <result column="CREATE_MAN" jdbcType="VARCHAR" property="createMan" />
  13. <result column="CREATE_TIME" jdbcType="TIMESTAMP" property="createTime" />
  14. </resultMap>
  15. <sql id="Example_Where_Clause">
  16. <where>
  17. <foreach collection="oredCriteria" item="criteria" separator="or">
  18. <if test="criteria.valid">
  19. <trim prefix="(" prefixOverrides="and" suffix=")">
  20. <foreach collection="criteria.criteria" item="criterion">
  21. <choose>
  22. <when test="criterion.noValue">
  23. and ${criterion.condition}
  24. </when>
  25. <when test="criterion.singleValue">
  26. and ${criterion.condition} #{criterion.value}
  27. </when>
  28. <when test="criterion.betweenValue">
  29. and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
  30. </when>
  31. <when test="criterion.listValue">
  32. and ${criterion.condition}
  33. <foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
  34. #{listItem}
  35. </foreach>
  36. </when>
  37. </choose>
  38. </foreach>
  39. </trim>
  40. </if>
  41. </foreach>
  42. </where>
  43. </sql>
  44. <sql id="Update_By_Example_Where_Clause">
  45. <where>
  46. <foreach collection="example.oredCriteria" item="criteria" separator="or">
  47. <if test="criteria.valid">
  48. <trim prefix="(" prefixOverrides="and" suffix=")">
  49. <foreach collection="criteria.criteria" item="criterion">
  50. <choose>
  51. <when test="criterion.noValue">
  52. and ${criterion.condition}
  53. </when>
  54. <when test="criterion.singleValue">
  55. and ${criterion.condition} #{criterion.value}
  56. </when>
  57. <when test="criterion.betweenValue">
  58. and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
  59. </when>
  60. <when test="criterion.listValue">
  61. and ${criterion.condition}
  62. <foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
  63. #{listItem}
  64. </foreach>
  65. </when>
  66. </choose>
  67. </foreach>
  68. </trim>
  69. </if>
  70. </foreach>
  71. </where>
  72. </sql>
  73. <sql id="Base_Column_List">
  74. ID, GROUP_CODE, GROUP_NAME, UNIT_CODE, STATION_CODES, USE_FLAG, MEMO, CREATE_MAN,
  75. CREATE_TIME
  76. </sql>
  77. <select id="selectByExample" parameterType="com.mvc.entity.TUsingunitGroupExample" resultMap="BaseResultMap">
  78. select
  79. <if test="distinct">
  80. distinct
  81. </if>
  82. <include refid="Base_Column_List" />
  83. from t_usingunit_group
  84. <if test="_parameter != null">
  85. <include refid="Example_Where_Clause" />
  86. </if>
  87. <if test="orderByClause != null">
  88. order by ${orderByClause}
  89. </if>
  90. </select>
  91. <select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
  92. select
  93. <include refid="Base_Column_List" />
  94. from t_usingunit_group
  95. where ID = #{id,jdbcType=INTEGER}
  96. </select>
  97. <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
  98. delete from t_usingunit_group
  99. where ID = #{id,jdbcType=INTEGER}
  100. </delete>
  101. <delete id="deleteByExample" parameterType="com.mvc.entity.TUsingunitGroupExample">
  102. delete from t_usingunit_group
  103. <if test="_parameter != null">
  104. <include refid="Example_Where_Clause" />
  105. </if>
  106. </delete>
  107. <insert id="insert" parameterType="com.mvc.entity.TUsingunitGroup">
  108. insert into t_usingunit_group (ID, GROUP_CODE, GROUP_NAME,
  109. UNIT_CODE, STATION_CODES, USE_FLAG,
  110. MEMO, CREATE_MAN, CREATE_TIME
  111. )
  112. values (#{id,jdbcType=INTEGER}, #{groupCode,jdbcType=VARCHAR}, #{groupName,jdbcType=VARCHAR},
  113. #{unitCode,jdbcType=VARCHAR}, #{stationCodes,jdbcType=VARCHAR}, #{useFlag,jdbcType=CHAR},
  114. #{memo,jdbcType=VARCHAR}, #{createMan,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP}
  115. )
  116. </insert>
  117. <insert id="insertSelective" parameterType="com.mvc.entity.TUsingunitGroup">
  118. insert into t_usingunit_group
  119. <trim prefix="(" suffix=")" suffixOverrides=",">
  120. <if test="id != null">
  121. ID,
  122. </if>
  123. <if test="groupCode != null">
  124. GROUP_CODE,
  125. </if>
  126. <if test="groupName != null">
  127. GROUP_NAME,
  128. </if>
  129. <if test="unitCode != null">
  130. UNIT_CODE,
  131. </if>
  132. <if test="stationCodes != null">
  133. STATION_CODES,
  134. </if>
  135. <if test="useFlag != null">
  136. USE_FLAG,
  137. </if>
  138. <if test="memo != null">
  139. MEMO,
  140. </if>
  141. <if test="createMan != null">
  142. CREATE_MAN,
  143. </if>
  144. <if test="createTime != null">
  145. CREATE_TIME,
  146. </if>
  147. </trim>
  148. <trim prefix="values (" suffix=")" suffixOverrides=",">
  149. <if test="id != null">
  150. #{id,jdbcType=INTEGER},
  151. </if>
  152. <if test="groupCode != null">
  153. #{groupCode,jdbcType=VARCHAR},
  154. </if>
  155. <if test="groupName != null">
  156. #{groupName,jdbcType=VARCHAR},
  157. </if>
  158. <if test="unitCode != null">
  159. #{unitCode,jdbcType=VARCHAR},
  160. </if>
  161. <if test="stationCodes != null">
  162. #{stationCodes,jdbcType=VARCHAR},
  163. </if>
  164. <if test="useFlag != null">
  165. #{useFlag,jdbcType=CHAR},
  166. </if>
  167. <if test="memo != null">
  168. #{memo,jdbcType=VARCHAR},
  169. </if>
  170. <if test="createMan != null">
  171. #{createMan,jdbcType=VARCHAR},
  172. </if>
  173. <if test="createTime != null">
  174. #{createTime,jdbcType=TIMESTAMP},
  175. </if>
  176. </trim>
  177. </insert>
  178. <select id="countByExample" parameterType="com.mvc.entity.TUsingunitGroupExample" resultType="java.lang.Long">
  179. select count(*) from t_usingunit_group
  180. <if test="_parameter != null">
  181. <include refid="Example_Where_Clause" />
  182. </if>
  183. </select>
  184. <update id="updateByExampleSelective" parameterType="map">
  185. update t_usingunit_group
  186. <set>
  187. <if test="record.id != null">
  188. ID = #{record.id,jdbcType=INTEGER},
  189. </if>
  190. <if test="record.groupCode != null">
  191. GROUP_CODE = #{record.groupCode,jdbcType=VARCHAR},
  192. </if>
  193. <if test="record.groupName != null">
  194. GROUP_NAME = #{record.groupName,jdbcType=VARCHAR},
  195. </if>
  196. <if test="record.unitCode != null">
  197. UNIT_CODE = #{record.unitCode,jdbcType=VARCHAR},
  198. </if>
  199. <if test="record.stationCodes != null">
  200. STATION_CODES = #{record.stationCodes,jdbcType=VARCHAR},
  201. </if>
  202. <if test="record.useFlag != null">
  203. USE_FLAG = #{record.useFlag,jdbcType=CHAR},
  204. </if>
  205. <if test="record.memo != null">
  206. MEMO = #{record.memo,jdbcType=VARCHAR},
  207. </if>
  208. <if test="record.createMan != null">
  209. CREATE_MAN = #{record.createMan,jdbcType=VARCHAR},
  210. </if>
  211. <if test="record.createTime != null">
  212. CREATE_TIME = #{record.createTime,jdbcType=TIMESTAMP},
  213. </if>
  214. </set>
  215. <if test="_parameter != null">
  216. <include refid="Update_By_Example_Where_Clause" />
  217. </if>
  218. </update>
  219. <update id="updateByExample" parameterType="map">
  220. update t_usingunit_group
  221. set ID = #{record.id,jdbcType=INTEGER},
  222. GROUP_CODE = #{record.groupCode,jdbcType=VARCHAR},
  223. GROUP_NAME = #{record.groupName,jdbcType=VARCHAR},
  224. UNIT_CODE = #{record.unitCode,jdbcType=VARCHAR},
  225. STATION_CODES = #{record.stationCodes,jdbcType=VARCHAR},
  226. USE_FLAG = #{record.useFlag,jdbcType=CHAR},
  227. MEMO = #{record.memo,jdbcType=VARCHAR},
  228. CREATE_MAN = #{record.createMan,jdbcType=VARCHAR},
  229. CREATE_TIME = #{record.createTime,jdbcType=TIMESTAMP}
  230. <if test="_parameter != null">
  231. <include refid="Update_By_Example_Where_Clause" />
  232. </if>
  233. </update>
  234. <update id="updateByPrimaryKeySelective" parameterType="com.mvc.entity.TUsingunitGroup">
  235. update t_usingunit_group
  236. <set>
  237. <if test="groupCode != null">
  238. GROUP_CODE = #{groupCode,jdbcType=VARCHAR},
  239. </if>
  240. <if test="groupName != null">
  241. GROUP_NAME = #{groupName,jdbcType=VARCHAR},
  242. </if>
  243. <if test="unitCode != null">
  244. UNIT_CODE = #{unitCode,jdbcType=VARCHAR},
  245. </if>
  246. <if test="stationCodes != null">
  247. STATION_CODES = #{stationCodes,jdbcType=VARCHAR},
  248. </if>
  249. <if test="useFlag != null">
  250. USE_FLAG = #{useFlag,jdbcType=CHAR},
  251. </if>
  252. <if test="memo != null">
  253. MEMO = #{memo,jdbcType=VARCHAR},
  254. </if>
  255. <if test="createMan != null">
  256. CREATE_MAN = #{createMan,jdbcType=VARCHAR},
  257. </if>
  258. <if test="createTime != null">
  259. CREATE_TIME = #{createTime,jdbcType=TIMESTAMP},
  260. </if>
  261. </set>
  262. where ID = #{id,jdbcType=INTEGER}
  263. </update>
  264. <update id="updateByPrimaryKey" parameterType="com.mvc.entity.TUsingunitGroup">
  265. update t_usingunit_group
  266. set GROUP_CODE = #{groupCode,jdbcType=VARCHAR},
  267. GROUP_NAME = #{groupName,jdbcType=VARCHAR},
  268. UNIT_CODE = #{unitCode,jdbcType=VARCHAR},
  269. STATION_CODES = #{stationCodes,jdbcType=VARCHAR},
  270. USE_FLAG = #{useFlag,jdbcType=CHAR},
  271. MEMO = #{memo,jdbcType=VARCHAR},
  272. CREATE_MAN = #{createMan,jdbcType=VARCHAR},
  273. CREATE_TIME = #{createTime,jdbcType=TIMESTAMP}
  274. where ID = #{id,jdbcType=INTEGER}
  275. </update>
  276. </mapper>