TDevDataMapper.xml 14 KB

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