TAffiliatedunitMapper.xml 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360
  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.TAffiliatedunitMapper">
  4. <resultMap id="BaseResultMap" type="com.mvc.entity.TAffiliatedunit">
  5. <id column="ID" jdbcType="INTEGER" property="id" />
  6. <result column="UNIT_CODE" jdbcType="VARCHAR" property="unitCode" />
  7. <result column="UNIT_NAME" jdbcType="VARCHAR" property="unitName" />
  8. <result column="UNIT_TYPE" jdbcType="VARCHAR" property="unitType" />
  9. <result column="UNIT_AREA" jdbcType="VARCHAR" property="unitArea" />
  10. <result column="LEADER_NAME" jdbcType="VARCHAR" property="leaderName" />
  11. <result column="LEADER_TELE" jdbcType="VARCHAR" property="leaderTele" />
  12. <result column="USE_FLAG" jdbcType="CHAR" property="useFlag" />
  13. <result column="MEMO" jdbcType="VARCHAR" property="memo" />
  14. <result column="CREATE_MAN" jdbcType="VARCHAR" property="createMan" />
  15. <result column="CREATE_TIME" jdbcType="TIMESTAMP" property="createTime" />
  16. <result column="CREATE_UNIT_CODE" jdbcType="VARCHAR" property="createUnitCode" />
  17. <result column="CREATE_UNIT_FALG" jdbcType="CHAR" property="createUnitFalg" />
  18. <result column="UNIT_NAME_PY" jdbcType="VARCHAR" property="unitNamePy" />
  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, UNIT_CODE, UNIT_NAME, UNIT_TYPE, UNIT_AREA, LEADER_NAME, LEADER_TELE, USE_FLAG,
  80. MEMO, CREATE_MAN, CREATE_TIME, CREATE_UNIT_CODE, CREATE_UNIT_FALG, UNIT_NAME_PY
  81. </sql>
  82. <select id="selectByExample" parameterType="com.mvc.entity.TAffiliatedunitExample" resultMap="BaseResultMap">
  83. select
  84. <if test="distinct">
  85. distinct
  86. </if>
  87. <include refid="Base_Column_List" />
  88. from t_affiliatedunit
  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 t_affiliatedunit
  100. where ID = #{id,jdbcType=INTEGER}
  101. </select>
  102. <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
  103. delete from t_affiliatedunit
  104. where ID = #{id,jdbcType=INTEGER}
  105. </delete>
  106. <delete id="deleteByExample" parameterType="com.mvc.entity.TAffiliatedunitExample">
  107. delete from t_affiliatedunit
  108. <if test="_parameter != null">
  109. <include refid="Example_Where_Clause" />
  110. </if>
  111. </delete>
  112. <insert id="insert" parameterType="com.mvc.entity.TAffiliatedunit">
  113. insert into t_affiliatedunit (ID, UNIT_CODE, UNIT_NAME,
  114. UNIT_TYPE, UNIT_AREA, LEADER_NAME,
  115. LEADER_TELE, USE_FLAG, MEMO,
  116. CREATE_MAN, CREATE_TIME, CREATE_UNIT_CODE,
  117. CREATE_UNIT_FALG, UNIT_NAME_PY)
  118. values (#{id,jdbcType=INTEGER}, #{unitCode,jdbcType=VARCHAR}, #{unitName,jdbcType=VARCHAR},
  119. #{unitType,jdbcType=VARCHAR}, #{unitArea,jdbcType=VARCHAR}, #{leaderName,jdbcType=VARCHAR},
  120. #{leaderTele,jdbcType=VARCHAR}, #{useFlag,jdbcType=CHAR}, #{memo,jdbcType=VARCHAR},
  121. #{createMan,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP}, #{createUnitCode,jdbcType=VARCHAR},
  122. #{createUnitFalg,jdbcType=CHAR}, #{unitNamePy,jdbcType=VARCHAR})
  123. </insert>
  124. <insert id="insertSelective" parameterType="com.mvc.entity.TAffiliatedunit">
  125. insert into t_affiliatedunit
  126. <trim prefix="(" suffix=")" suffixOverrides=",">
  127. <if test="id != null">
  128. ID,
  129. </if>
  130. <if test="unitCode != null">
  131. UNIT_CODE,
  132. </if>
  133. <if test="unitName != null">
  134. UNIT_NAME,
  135. </if>
  136. <if test="unitType != null">
  137. UNIT_TYPE,
  138. </if>
  139. <if test="unitArea != null">
  140. UNIT_AREA,
  141. </if>
  142. <if test="leaderName != null">
  143. LEADER_NAME,
  144. </if>
  145. <if test="leaderTele != null">
  146. LEADER_TELE,
  147. </if>
  148. <if test="useFlag != null">
  149. USE_FLAG,
  150. </if>
  151. <if test="memo != null">
  152. MEMO,
  153. </if>
  154. <if test="createMan != null">
  155. CREATE_MAN,
  156. </if>
  157. <if test="createTime != null">
  158. CREATE_TIME,
  159. </if>
  160. <if test="createUnitCode != null">
  161. CREATE_UNIT_CODE,
  162. </if>
  163. <if test="createUnitFalg != null">
  164. CREATE_UNIT_FALG,
  165. </if>
  166. <if test="unitNamePy != null">
  167. UNIT_NAME_PY,
  168. </if>
  169. </trim>
  170. <trim prefix="values (" suffix=")" suffixOverrides=",">
  171. <if test="id != null">
  172. #{id,jdbcType=INTEGER},
  173. </if>
  174. <if test="unitCode != null">
  175. #{unitCode,jdbcType=VARCHAR},
  176. </if>
  177. <if test="unitName != null">
  178. #{unitName,jdbcType=VARCHAR},
  179. </if>
  180. <if test="unitType != null">
  181. #{unitType,jdbcType=VARCHAR},
  182. </if>
  183. <if test="unitArea != null">
  184. #{unitArea,jdbcType=VARCHAR},
  185. </if>
  186. <if test="leaderName != null">
  187. #{leaderName,jdbcType=VARCHAR},
  188. </if>
  189. <if test="leaderTele != null">
  190. #{leaderTele,jdbcType=VARCHAR},
  191. </if>
  192. <if test="useFlag != null">
  193. #{useFlag,jdbcType=CHAR},
  194. </if>
  195. <if test="memo != null">
  196. #{memo,jdbcType=VARCHAR},
  197. </if>
  198. <if test="createMan != null">
  199. #{createMan,jdbcType=VARCHAR},
  200. </if>
  201. <if test="createTime != null">
  202. #{createTime,jdbcType=TIMESTAMP},
  203. </if>
  204. <if test="createUnitCode != null">
  205. #{createUnitCode,jdbcType=VARCHAR},
  206. </if>
  207. <if test="createUnitFalg != null">
  208. #{createUnitFalg,jdbcType=CHAR},
  209. </if>
  210. <if test="unitNamePy != null">
  211. #{unitNamePy,jdbcType=VARCHAR},
  212. </if>
  213. </trim>
  214. </insert>
  215. <select id="countByExample" parameterType="com.mvc.entity.TAffiliatedunitExample" resultType="java.lang.Long">
  216. select count(*) from t_affiliatedunit
  217. <if test="_parameter != null">
  218. <include refid="Example_Where_Clause" />
  219. </if>
  220. </select>
  221. <update id="updateByExampleSelective" parameterType="map">
  222. update t_affiliatedunit
  223. <set>
  224. <if test="record.id != null">
  225. ID = #{record.id,jdbcType=INTEGER},
  226. </if>
  227. <if test="record.unitCode != null">
  228. UNIT_CODE = #{record.unitCode,jdbcType=VARCHAR},
  229. </if>
  230. <if test="record.unitName != null">
  231. UNIT_NAME = #{record.unitName,jdbcType=VARCHAR},
  232. </if>
  233. <if test="record.unitType != null">
  234. UNIT_TYPE = #{record.unitType,jdbcType=VARCHAR},
  235. </if>
  236. <if test="record.unitArea != null">
  237. UNIT_AREA = #{record.unitArea,jdbcType=VARCHAR},
  238. </if>
  239. <if test="record.leaderName != null">
  240. LEADER_NAME = #{record.leaderName,jdbcType=VARCHAR},
  241. </if>
  242. <if test="record.leaderTele != null">
  243. LEADER_TELE = #{record.leaderTele,jdbcType=VARCHAR},
  244. </if>
  245. <if test="record.useFlag != null">
  246. USE_FLAG = #{record.useFlag,jdbcType=CHAR},
  247. </if>
  248. <if test="record.memo != null">
  249. MEMO = #{record.memo,jdbcType=VARCHAR},
  250. </if>
  251. <if test="record.createMan != null">
  252. CREATE_MAN = #{record.createMan,jdbcType=VARCHAR},
  253. </if>
  254. <if test="record.createTime != null">
  255. CREATE_TIME = #{record.createTime,jdbcType=TIMESTAMP},
  256. </if>
  257. <if test="record.createUnitCode != null">
  258. CREATE_UNIT_CODE = #{record.createUnitCode,jdbcType=VARCHAR},
  259. </if>
  260. <if test="record.createUnitFalg != null">
  261. CREATE_UNIT_FALG = #{record.createUnitFalg,jdbcType=CHAR},
  262. </if>
  263. <if test="record.unitNamePy != null">
  264. UNIT_NAME_PY = #{record.unitNamePy,jdbcType=VARCHAR},
  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 t_affiliatedunit
  273. set ID = #{record.id,jdbcType=INTEGER},
  274. UNIT_CODE = #{record.unitCode,jdbcType=VARCHAR},
  275. UNIT_NAME = #{record.unitName,jdbcType=VARCHAR},
  276. UNIT_TYPE = #{record.unitType,jdbcType=VARCHAR},
  277. UNIT_AREA = #{record.unitArea,jdbcType=VARCHAR},
  278. LEADER_NAME = #{record.leaderName,jdbcType=VARCHAR},
  279. LEADER_TELE = #{record.leaderTele,jdbcType=VARCHAR},
  280. USE_FLAG = #{record.useFlag,jdbcType=CHAR},
  281. MEMO = #{record.memo,jdbcType=VARCHAR},
  282. CREATE_MAN = #{record.createMan,jdbcType=VARCHAR},
  283. CREATE_TIME = #{record.createTime,jdbcType=TIMESTAMP},
  284. CREATE_UNIT_CODE = #{record.createUnitCode,jdbcType=VARCHAR},
  285. CREATE_UNIT_FALG = #{record.createUnitFalg,jdbcType=CHAR},
  286. UNIT_NAME_PY = #{record.unitNamePy,jdbcType=VARCHAR}
  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.TAffiliatedunit">
  292. update t_affiliatedunit
  293. <set>
  294. <if test="unitCode != null">
  295. UNIT_CODE = #{unitCode,jdbcType=VARCHAR},
  296. </if>
  297. <if test="unitName != null">
  298. UNIT_NAME = #{unitName,jdbcType=VARCHAR},
  299. </if>
  300. <if test="unitType != null">
  301. UNIT_TYPE = #{unitType,jdbcType=VARCHAR},
  302. </if>
  303. <if test="unitArea != null">
  304. UNIT_AREA = #{unitArea,jdbcType=VARCHAR},
  305. </if>
  306. <if test="leaderName != null">
  307. LEADER_NAME = #{leaderName,jdbcType=VARCHAR},
  308. </if>
  309. <if test="leaderTele != null">
  310. LEADER_TELE = #{leaderTele,jdbcType=VARCHAR},
  311. </if>
  312. <if test="useFlag != null">
  313. USE_FLAG = #{useFlag,jdbcType=CHAR},
  314. </if>
  315. <if test="memo != null">
  316. MEMO = #{memo,jdbcType=VARCHAR},
  317. </if>
  318. <if test="createMan != null">
  319. CREATE_MAN = #{createMan,jdbcType=VARCHAR},
  320. </if>
  321. <if test="createTime != null">
  322. CREATE_TIME = #{createTime,jdbcType=TIMESTAMP},
  323. </if>
  324. <if test="createUnitCode != null">
  325. CREATE_UNIT_CODE = #{createUnitCode,jdbcType=VARCHAR},
  326. </if>
  327. <if test="createUnitFalg != null">
  328. CREATE_UNIT_FALG = #{createUnitFalg,jdbcType=CHAR},
  329. </if>
  330. <if test="unitNamePy != null">
  331. UNIT_NAME_PY = #{unitNamePy,jdbcType=VARCHAR},
  332. </if>
  333. </set>
  334. where ID = #{id,jdbcType=INTEGER}
  335. </update>
  336. <update id="updateByPrimaryKey" parameterType="com.mvc.entity.TAffiliatedunit">
  337. update t_affiliatedunit
  338. set UNIT_CODE = #{unitCode,jdbcType=VARCHAR},
  339. UNIT_NAME = #{unitName,jdbcType=VARCHAR},
  340. UNIT_TYPE = #{unitType,jdbcType=VARCHAR},
  341. UNIT_AREA = #{unitArea,jdbcType=VARCHAR},
  342. LEADER_NAME = #{leaderName,jdbcType=VARCHAR},
  343. LEADER_TELE = #{leaderTele,jdbcType=VARCHAR},
  344. USE_FLAG = #{useFlag,jdbcType=CHAR},
  345. MEMO = #{memo,jdbcType=VARCHAR},
  346. CREATE_MAN = #{createMan,jdbcType=VARCHAR},
  347. CREATE_TIME = #{createTime,jdbcType=TIMESTAMP},
  348. CREATE_UNIT_CODE = #{createUnitCode,jdbcType=VARCHAR},
  349. CREATE_UNIT_FALG = #{createUnitFalg,jdbcType=CHAR},
  350. UNIT_NAME_PY = #{unitNamePy,jdbcType=VARCHAR}
  351. where ID = #{id,jdbcType=INTEGER}
  352. </update>
  353. <select id="findTAffiliatedunitByCreateUnitCode" resultMap="BaseResultMap">
  354. select
  355. <include refid="Base_Column_List" />
  356. from t_affiliatedunit
  357. where CREATE_UNIT_CODE = #{createUnitCode,jdbcType=VARCHAR} or CREATE_UNIT_CODE is null or CREATE_UNIT_CODE='1'
  358. </select>
  359. </mapper>