BatteryAccMapper.xml 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354
  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.BatteryAccMapper">
  4. <resultMap id="BaseResultMap" type="com.mvc.entity.BatteryAcc">
  5. <id column="ID" jdbcType="INTEGER" property="id" />
  6. <result column="BAT_CODE" jdbcType="VARCHAR" property="batCode" />
  7. <result column="DELIVERY_TIME" jdbcType="TIMESTAMP" property="deliveryTime" />
  8. <result column="FIRST_USE_TIME" jdbcType="TIMESTAMP" property="firstUseTime" />
  9. <result column="BAT_MODEL" jdbcType="VARCHAR" property="batModel" />
  10. <result column="MANUFACTURER" jdbcType="VARCHAR" property="manufacturer" />
  11. <result column="BAT_CAPACITY" jdbcType="INTEGER" property="batCapacity" />
  12. <result column="LAST_WORKING_VOLTAGE" jdbcType="DECIMAL" property="lastWorkingVoltage" />
  13. <result column="BAT_RUM_TIME" jdbcType="INTEGER" property="batRumTime" />
  14. <result column="BAT_RUN_NUM" jdbcType="INTEGER" property="batRunNum" />
  15. <result column="BAT_STATUS" jdbcType="CHAR" property="batStatus" />
  16. <result column="STATUS_UPDATE_TIME" jdbcType="TIMESTAMP" property="statusUpdateTime" />
  17. <result column="CREATE_MAN" jdbcType="VARCHAR" property="createMan" />
  18. <result column="CREATE_TIME" jdbcType="TIMESTAMP" property="createTime" />
  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, BAT_CODE, DELIVERY_TIME, FIRST_USE_TIME, BAT_MODEL, MANUFACTURER, BAT_CAPACITY,
  80. LAST_WORKING_VOLTAGE, BAT_RUM_TIME, BAT_RUN_NUM, BAT_STATUS, STATUS_UPDATE_TIME,
  81. CREATE_MAN, CREATE_TIME
  82. </sql>
  83. <select id="selectByExample" parameterType="com.mvc.entity.BatteryAccExample" resultMap="BaseResultMap">
  84. select
  85. <if test="distinct">
  86. distinct
  87. </if>
  88. <include refid="Base_Column_List" />
  89. from battery_acc
  90. <if test="_parameter != null">
  91. <include refid="Example_Where_Clause" />
  92. </if>
  93. <if test="orderByClause != null">
  94. order by ${orderByClause}
  95. </if>
  96. </select>
  97. <select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
  98. select
  99. <include refid="Base_Column_List" />
  100. from battery_acc
  101. where ID = #{id,jdbcType=INTEGER}
  102. </select>
  103. <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
  104. delete from battery_acc
  105. where ID = #{id,jdbcType=INTEGER}
  106. </delete>
  107. <delete id="deleteByExample" parameterType="com.mvc.entity.BatteryAccExample">
  108. delete from battery_acc
  109. <if test="_parameter != null">
  110. <include refid="Example_Where_Clause" />
  111. </if>
  112. </delete>
  113. <insert id="insert" parameterType="com.mvc.entity.BatteryAcc">
  114. insert into battery_acc (ID, BAT_CODE, DELIVERY_TIME,
  115. FIRST_USE_TIME, BAT_MODEL, MANUFACTURER,
  116. BAT_CAPACITY, LAST_WORKING_VOLTAGE, BAT_RUM_TIME,
  117. BAT_RUN_NUM, BAT_STATUS, STATUS_UPDATE_TIME,
  118. CREATE_MAN, CREATE_TIME)
  119. values (#{id,jdbcType=INTEGER}, #{batCode,jdbcType=VARCHAR}, #{deliveryTime,jdbcType=TIMESTAMP},
  120. #{firstUseTime,jdbcType=TIMESTAMP}, #{batModel,jdbcType=VARCHAR}, #{manufacturer,jdbcType=VARCHAR},
  121. #{batCapacity,jdbcType=INTEGER}, #{lastWorkingVoltage,jdbcType=DECIMAL}, #{batRumTime,jdbcType=INTEGER},
  122. #{batRunNum,jdbcType=INTEGER}, #{batStatus,jdbcType=CHAR}, #{statusUpdateTime,jdbcType=TIMESTAMP},
  123. #{createMan,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP})
  124. </insert>
  125. <insert id="insertSelective" parameterType="com.mvc.entity.BatteryAcc">
  126. insert into battery_acc
  127. <trim prefix="(" suffix=")" suffixOverrides=",">
  128. <if test="id != null">
  129. ID,
  130. </if>
  131. <if test="batCode != null">
  132. BAT_CODE,
  133. </if>
  134. <if test="deliveryTime != null">
  135. DELIVERY_TIME,
  136. </if>
  137. <if test="firstUseTime != null">
  138. FIRST_USE_TIME,
  139. </if>
  140. <if test="batModel != null">
  141. BAT_MODEL,
  142. </if>
  143. <if test="manufacturer != null">
  144. MANUFACTURER,
  145. </if>
  146. <if test="batCapacity != null">
  147. BAT_CAPACITY,
  148. </if>
  149. <if test="lastWorkingVoltage != null">
  150. LAST_WORKING_VOLTAGE,
  151. </if>
  152. <if test="batRumTime != null">
  153. BAT_RUM_TIME,
  154. </if>
  155. <if test="batRunNum != null">
  156. BAT_RUN_NUM,
  157. </if>
  158. <if test="batStatus != null">
  159. BAT_STATUS,
  160. </if>
  161. <if test="statusUpdateTime != null">
  162. STATUS_UPDATE_TIME,
  163. </if>
  164. <if test="createMan != null">
  165. CREATE_MAN,
  166. </if>
  167. <if test="createTime != null">
  168. CREATE_TIME,
  169. </if>
  170. </trim>
  171. <trim prefix="values (" suffix=")" suffixOverrides=",">
  172. <if test="id != null">
  173. #{id,jdbcType=INTEGER},
  174. </if>
  175. <if test="batCode != null">
  176. #{batCode,jdbcType=VARCHAR},
  177. </if>
  178. <if test="deliveryTime != null">
  179. #{deliveryTime,jdbcType=TIMESTAMP},
  180. </if>
  181. <if test="firstUseTime != null">
  182. #{firstUseTime,jdbcType=TIMESTAMP},
  183. </if>
  184. <if test="batModel != null">
  185. #{batModel,jdbcType=VARCHAR},
  186. </if>
  187. <if test="manufacturer != null">
  188. #{manufacturer,jdbcType=VARCHAR},
  189. </if>
  190. <if test="batCapacity != null">
  191. #{batCapacity,jdbcType=INTEGER},
  192. </if>
  193. <if test="lastWorkingVoltage != null">
  194. #{lastWorkingVoltage,jdbcType=DECIMAL},
  195. </if>
  196. <if test="batRumTime != null">
  197. #{batRumTime,jdbcType=INTEGER},
  198. </if>
  199. <if test="batRunNum != null">
  200. #{batRunNum,jdbcType=INTEGER},
  201. </if>
  202. <if test="batStatus != null">
  203. #{batStatus,jdbcType=CHAR},
  204. </if>
  205. <if test="statusUpdateTime != null">
  206. #{statusUpdateTime,jdbcType=TIMESTAMP},
  207. </if>
  208. <if test="createMan != null">
  209. #{createMan,jdbcType=VARCHAR},
  210. </if>
  211. <if test="createTime != null">
  212. #{createTime,jdbcType=TIMESTAMP},
  213. </if>
  214. </trim>
  215. </insert>
  216. <select id="countByExample" parameterType="com.mvc.entity.BatteryAccExample" resultType="java.lang.Long">
  217. select count(*) from battery_acc
  218. <if test="_parameter != null">
  219. <include refid="Example_Where_Clause" />
  220. </if>
  221. </select>
  222. <update id="updateByExampleSelective" parameterType="map">
  223. update battery_acc
  224. <set>
  225. <if test="record.id != null">
  226. ID = #{record.id,jdbcType=INTEGER},
  227. </if>
  228. <if test="record.batCode != null">
  229. BAT_CODE = #{record.batCode,jdbcType=VARCHAR},
  230. </if>
  231. <if test="record.deliveryTime != null">
  232. DELIVERY_TIME = #{record.deliveryTime,jdbcType=TIMESTAMP},
  233. </if>
  234. <if test="record.firstUseTime != null">
  235. FIRST_USE_TIME = #{record.firstUseTime,jdbcType=TIMESTAMP},
  236. </if>
  237. <if test="record.batModel != null">
  238. BAT_MODEL = #{record.batModel,jdbcType=VARCHAR},
  239. </if>
  240. <if test="record.manufacturer != null">
  241. MANUFACTURER = #{record.manufacturer,jdbcType=VARCHAR},
  242. </if>
  243. <if test="record.batCapacity != null">
  244. BAT_CAPACITY = #{record.batCapacity,jdbcType=INTEGER},
  245. </if>
  246. <if test="record.lastWorkingVoltage != null">
  247. LAST_WORKING_VOLTAGE = #{record.lastWorkingVoltage,jdbcType=DECIMAL},
  248. </if>
  249. <if test="record.batRumTime != null">
  250. BAT_RUM_TIME = #{record.batRumTime,jdbcType=INTEGER},
  251. </if>
  252. <if test="record.batRunNum != null">
  253. BAT_RUN_NUM = #{record.batRunNum,jdbcType=INTEGER},
  254. </if>
  255. <if test="record.batStatus != null">
  256. BAT_STATUS = #{record.batStatus,jdbcType=CHAR},
  257. </if>
  258. <if test="record.statusUpdateTime != null">
  259. STATUS_UPDATE_TIME = #{record.statusUpdateTime,jdbcType=TIMESTAMP},
  260. </if>
  261. <if test="record.createMan != null">
  262. CREATE_MAN = #{record.createMan,jdbcType=VARCHAR},
  263. </if>
  264. <if test="record.createTime != null">
  265. CREATE_TIME = #{record.createTime,jdbcType=TIMESTAMP},
  266. </if>
  267. </set>
  268. <if test="_parameter != null">
  269. <include refid="Update_By_Example_Where_Clause" />
  270. </if>
  271. </update>
  272. <update id="updateByExample" parameterType="map">
  273. update battery_acc
  274. set ID = #{record.id,jdbcType=INTEGER},
  275. BAT_CODE = #{record.batCode,jdbcType=VARCHAR},
  276. DELIVERY_TIME = #{record.deliveryTime,jdbcType=TIMESTAMP},
  277. FIRST_USE_TIME = #{record.firstUseTime,jdbcType=TIMESTAMP},
  278. BAT_MODEL = #{record.batModel,jdbcType=VARCHAR},
  279. MANUFACTURER = #{record.manufacturer,jdbcType=VARCHAR},
  280. BAT_CAPACITY = #{record.batCapacity,jdbcType=INTEGER},
  281. LAST_WORKING_VOLTAGE = #{record.lastWorkingVoltage,jdbcType=DECIMAL},
  282. BAT_RUM_TIME = #{record.batRumTime,jdbcType=INTEGER},
  283. BAT_RUN_NUM = #{record.batRunNum,jdbcType=INTEGER},
  284. BAT_STATUS = #{record.batStatus,jdbcType=CHAR},
  285. STATUS_UPDATE_TIME = #{record.statusUpdateTime,jdbcType=TIMESTAMP},
  286. CREATE_MAN = #{record.createMan,jdbcType=VARCHAR},
  287. CREATE_TIME = #{record.createTime,jdbcType=TIMESTAMP}
  288. <if test="_parameter != null">
  289. <include refid="Update_By_Example_Where_Clause" />
  290. </if>
  291. </update>
  292. <update id="updateByPrimaryKeySelective" parameterType="com.mvc.entity.BatteryAcc">
  293. update battery_acc
  294. <set>
  295. <if test="batCode != null">
  296. BAT_CODE = #{batCode,jdbcType=VARCHAR},
  297. </if>
  298. <if test="deliveryTime != null">
  299. DELIVERY_TIME = #{deliveryTime,jdbcType=TIMESTAMP},
  300. </if>
  301. <if test="firstUseTime != null">
  302. FIRST_USE_TIME = #{firstUseTime,jdbcType=TIMESTAMP},
  303. </if>
  304. <if test="batModel != null">
  305. BAT_MODEL = #{batModel,jdbcType=VARCHAR},
  306. </if>
  307. <if test="manufacturer != null">
  308. MANUFACTURER = #{manufacturer,jdbcType=VARCHAR},
  309. </if>
  310. <if test="batCapacity != null">
  311. BAT_CAPACITY = #{batCapacity,jdbcType=INTEGER},
  312. </if>
  313. <if test="lastWorkingVoltage != null">
  314. LAST_WORKING_VOLTAGE = #{lastWorkingVoltage,jdbcType=DECIMAL},
  315. </if>
  316. <if test="batRumTime != null">
  317. BAT_RUM_TIME = #{batRumTime,jdbcType=INTEGER},
  318. </if>
  319. <if test="batRunNum != null">
  320. BAT_RUN_NUM = #{batRunNum,jdbcType=INTEGER},
  321. </if>
  322. <if test="batStatus != null">
  323. BAT_STATUS = #{batStatus,jdbcType=CHAR},
  324. </if>
  325. <if test="statusUpdateTime != null">
  326. STATUS_UPDATE_TIME = #{statusUpdateTime,jdbcType=TIMESTAMP},
  327. </if>
  328. <if test="createMan != null">
  329. CREATE_MAN = #{createMan,jdbcType=VARCHAR},
  330. </if>
  331. <if test="createTime != null">
  332. CREATE_TIME = #{createTime,jdbcType=TIMESTAMP},
  333. </if>
  334. </set>
  335. where ID = #{id,jdbcType=INTEGER}
  336. </update>
  337. <update id="updateByPrimaryKey" parameterType="com.mvc.entity.BatteryAcc">
  338. update battery_acc
  339. set BAT_CODE = #{batCode,jdbcType=VARCHAR},
  340. DELIVERY_TIME = #{deliveryTime,jdbcType=TIMESTAMP},
  341. FIRST_USE_TIME = #{firstUseTime,jdbcType=TIMESTAMP},
  342. BAT_MODEL = #{batModel,jdbcType=VARCHAR},
  343. MANUFACTURER = #{manufacturer,jdbcType=VARCHAR},
  344. BAT_CAPACITY = #{batCapacity,jdbcType=INTEGER},
  345. LAST_WORKING_VOLTAGE = #{lastWorkingVoltage,jdbcType=DECIMAL},
  346. BAT_RUM_TIME = #{batRumTime,jdbcType=INTEGER},
  347. BAT_RUN_NUM = #{batRunNum,jdbcType=INTEGER},
  348. BAT_STATUS = #{batStatus,jdbcType=CHAR},
  349. STATUS_UPDATE_TIME = #{statusUpdateTime,jdbcType=TIMESTAMP},
  350. CREATE_MAN = #{createMan,jdbcType=VARCHAR},
  351. CREATE_TIME = #{createTime,jdbcType=TIMESTAMP}
  352. where ID = #{id,jdbcType=INTEGER}
  353. </update>
  354. </mapper>