TCtldevinfoMapper.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.chinaitop.depot.intelligent.ventilation.mapper.TCtldevinfoMapper" >
  4. <resultMap id="BaseResultMap" type="com.chinaitop.depot.intelligent.ventilation.model.TCtldevinfo" >
  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="idevtdh" property="idevtdh" jdbcType="INTEGER" />
  9. <result column="vdevkindcode" property="vdevkindcode" jdbcType="VARCHAR" />
  10. <result column="sitecode" property="sitecode" jdbcType="VARCHAR" />
  11. <result column="vcfcode" property="vcfcode" jdbcType="VARCHAR" />
  12. <result column="vposition" property="vposition" jdbcType="VARCHAR" />
  13. <result column="valarmstatue" property="valarmstatue" jdbcType="VARCHAR" />
  14. <result column="updatetime" property="updatetime" jdbcType="TIMESTAMP" />
  15. <result column="remark" property="remark" jdbcType="VARCHAR" />
  16. <result column="vstatue" property="vstatue" jdbcType="VARCHAR" />
  17. <result column="org_id" property="orgId" jdbcType="INTEGER" />
  18. <result column="del_flag" property="delFlag" jdbcType="INTEGER" />
  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="(" suffix=")" prefixOverrides="and" >
  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 collection="criterion.value" item="listItem" open="(" close=")" 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="(" suffix=")" prefixOverrides="and" >
  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 collection="criterion.value" item="listItem" open="(" close=")" 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, vdevcode, vdevname, idevtdh, vdevkindcode, sitecode, vcfcode, vposition, valarmstatue,
  80. updatetime, remark, vstatue, org_id, del_flag
  81. </sql>
  82. <select id="selectByExample" resultMap="BaseResultMap" parameterType="com.chinaitop.depot.intelligent.ventilation.model.TCtldevinfoExample" >
  83. select
  84. <if test="distinct" >
  85. distinct
  86. </if>
  87. <include refid="Base_Column_List" />
  88. from t_ctldevinfo
  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" resultMap="BaseResultMap" parameterType="java.lang.String" >
  97. select
  98. <include refid="Base_Column_List" />
  99. from t_ctldevinfo
  100. where id = #{id,jdbcType=VARCHAR}
  101. </select>
  102. <delete id="deleteByPrimaryKey" parameterType="java.lang.String" >
  103. delete from t_ctldevinfo
  104. where id = #{id,jdbcType=VARCHAR}
  105. </delete>
  106. <delete id="deleteByExample" parameterType="com.chinaitop.depot.intelligent.ventilation.model.TCtldevinfoExample" >
  107. delete from t_ctldevinfo
  108. <if test="_parameter != null" >
  109. <include refid="Example_Where_Clause" />
  110. </if>
  111. </delete>
  112. <insert id="insert" parameterType="com.chinaitop.depot.intelligent.ventilation.model.TCtldevinfo" >
  113. insert into t_ctldevinfo (id, vdevcode, vdevname,
  114. idevtdh, vdevkindcode, sitecode,
  115. vcfcode, vposition, valarmstatue,
  116. updatetime, remark, vstatue,
  117. org_id, del_flag)
  118. values (#{id,jdbcType=VARCHAR}, #{vdevcode,jdbcType=VARCHAR}, #{vdevname,jdbcType=VARCHAR},
  119. #{idevtdh,jdbcType=INTEGER}, #{vdevkindcode,jdbcType=VARCHAR}, #{sitecode,jdbcType=VARCHAR},
  120. #{vcfcode,jdbcType=VARCHAR}, #{vposition,jdbcType=VARCHAR}, #{valarmstatue,jdbcType=VARCHAR},
  121. #{updatetime,jdbcType=TIMESTAMP}, #{remark,jdbcType=VARCHAR}, #{vstatue,jdbcType=VARCHAR},
  122. #{orgId,jdbcType=INTEGER}, #{delFlag,jdbcType=INTEGER})
  123. </insert>
  124. <insert id="insertSelective" parameterType="com.chinaitop.depot.intelligent.ventilation.model.TCtldevinfo" >
  125. insert into t_ctldevinfo
  126. <trim prefix="(" suffix=")" suffixOverrides="," >
  127. <if test="id != null" >
  128. id,
  129. </if>
  130. <if test="vdevcode != null" >
  131. vdevcode,
  132. </if>
  133. <if test="vdevname != null" >
  134. vdevname,
  135. </if>
  136. <if test="idevtdh != null" >
  137. idevtdh,
  138. </if>
  139. <if test="vdevkindcode != null" >
  140. vdevkindcode,
  141. </if>
  142. <if test="sitecode != null" >
  143. sitecode,
  144. </if>
  145. <if test="vcfcode != null" >
  146. vcfcode,
  147. </if>
  148. <if test="vposition != null" >
  149. vposition,
  150. </if>
  151. <if test="valarmstatue != null" >
  152. valarmstatue,
  153. </if>
  154. <if test="updatetime != null" >
  155. updatetime,
  156. </if>
  157. <if test="remark != null" >
  158. remark,
  159. </if>
  160. <if test="vstatue != null" >
  161. vstatue,
  162. </if>
  163. <if test="orgId != null" >
  164. org_id,
  165. </if>
  166. <if test="delFlag != null" >
  167. del_flag,
  168. </if>
  169. </trim>
  170. <trim prefix="values (" suffix=")" suffixOverrides="," >
  171. <if test="id != null" >
  172. #{id,jdbcType=VARCHAR},
  173. </if>
  174. <if test="vdevcode != null" >
  175. #{vdevcode,jdbcType=VARCHAR},
  176. </if>
  177. <if test="vdevname != null" >
  178. #{vdevname,jdbcType=VARCHAR},
  179. </if>
  180. <if test="idevtdh != null" >
  181. #{idevtdh,jdbcType=INTEGER},
  182. </if>
  183. <if test="vdevkindcode != null" >
  184. #{vdevkindcode,jdbcType=VARCHAR},
  185. </if>
  186. <if test="sitecode != null" >
  187. #{sitecode,jdbcType=VARCHAR},
  188. </if>
  189. <if test="vcfcode != null" >
  190. #{vcfcode,jdbcType=VARCHAR},
  191. </if>
  192. <if test="vposition != null" >
  193. #{vposition,jdbcType=VARCHAR},
  194. </if>
  195. <if test="valarmstatue != null" >
  196. #{valarmstatue,jdbcType=VARCHAR},
  197. </if>
  198. <if test="updatetime != null" >
  199. #{updatetime,jdbcType=TIMESTAMP},
  200. </if>
  201. <if test="remark != null" >
  202. #{remark,jdbcType=VARCHAR},
  203. </if>
  204. <if test="vstatue != null" >
  205. #{vstatue,jdbcType=VARCHAR},
  206. </if>
  207. <if test="orgId != null" >
  208. #{orgId,jdbcType=INTEGER},
  209. </if>
  210. <if test="delFlag != null" >
  211. #{delFlag,jdbcType=INTEGER},
  212. </if>
  213. </trim>
  214. </insert>
  215. <select id="countByExample" parameterType="com.chinaitop.depot.intelligent.ventilation.model.TCtldevinfoExample" resultType="java.lang.Integer" >
  216. select count(*) from t_ctldevinfo
  217. <if test="_parameter != null" >
  218. <include refid="Example_Where_Clause" />
  219. </if>
  220. </select>
  221. <update id="updateByExampleSelective" parameterType="map" >
  222. update t_ctldevinfo
  223. <set >
  224. <if test="record.id != null" >
  225. id = #{record.id,jdbcType=VARCHAR},
  226. </if>
  227. <if test="record.vdevcode != null" >
  228. vdevcode = #{record.vdevcode,jdbcType=VARCHAR},
  229. </if>
  230. <if test="record.vdevname != null" >
  231. vdevname = #{record.vdevname,jdbcType=VARCHAR},
  232. </if>
  233. <if test="record.idevtdh != null" >
  234. idevtdh = #{record.idevtdh,jdbcType=INTEGER},
  235. </if>
  236. <if test="record.vdevkindcode != null" >
  237. vdevkindcode = #{record.vdevkindcode,jdbcType=VARCHAR},
  238. </if>
  239. <if test="record.sitecode != null" >
  240. sitecode = #{record.sitecode,jdbcType=VARCHAR},
  241. </if>
  242. <if test="record.vcfcode != null" >
  243. vcfcode = #{record.vcfcode,jdbcType=VARCHAR},
  244. </if>
  245. <if test="record.vposition != null" >
  246. vposition = #{record.vposition,jdbcType=VARCHAR},
  247. </if>
  248. <if test="record.valarmstatue != null" >
  249. valarmstatue = #{record.valarmstatue,jdbcType=VARCHAR},
  250. </if>
  251. <if test="record.updatetime != null" >
  252. updatetime = #{record.updatetime,jdbcType=TIMESTAMP},
  253. </if>
  254. <if test="record.remark != null" >
  255. remark = #{record.remark,jdbcType=VARCHAR},
  256. </if>
  257. <if test="record.vstatue != null" >
  258. vstatue = #{record.vstatue,jdbcType=VARCHAR},
  259. </if>
  260. <if test="record.orgId != null" >
  261. org_id = #{record.orgId,jdbcType=INTEGER},
  262. </if>
  263. <if test="record.delFlag != null" >
  264. del_flag = #{record.delFlag,jdbcType=INTEGER},
  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_ctldevinfo
  273. set id = #{record.id,jdbcType=VARCHAR},
  274. vdevcode = #{record.vdevcode,jdbcType=VARCHAR},
  275. vdevname = #{record.vdevname,jdbcType=VARCHAR},
  276. idevtdh = #{record.idevtdh,jdbcType=INTEGER},
  277. vdevkindcode = #{record.vdevkindcode,jdbcType=VARCHAR},
  278. sitecode = #{record.sitecode,jdbcType=VARCHAR},
  279. vcfcode = #{record.vcfcode,jdbcType=VARCHAR},
  280. vposition = #{record.vposition,jdbcType=VARCHAR},
  281. valarmstatue = #{record.valarmstatue,jdbcType=VARCHAR},
  282. updatetime = #{record.updatetime,jdbcType=TIMESTAMP},
  283. remark = #{record.remark,jdbcType=VARCHAR},
  284. vstatue = #{record.vstatue,jdbcType=VARCHAR},
  285. org_id = #{record.orgId,jdbcType=INTEGER},
  286. del_flag = #{record.delFlag,jdbcType=INTEGER}
  287. <if test="_parameter != null" >
  288. <include refid="Update_By_Example_Where_Clause" />
  289. </if>
  290. </update>
  291. <update id="updateByPrimaryKeySelective" parameterType="com.chinaitop.depot.intelligent.ventilation.model.TCtldevinfo" >
  292. update t_ctldevinfo
  293. <set >
  294. <if test="vdevcode != null" >
  295. vdevcode = #{vdevcode,jdbcType=VARCHAR},
  296. </if>
  297. <if test="vdevname != null" >
  298. vdevname = #{vdevname,jdbcType=VARCHAR},
  299. </if>
  300. <if test="idevtdh != null" >
  301. idevtdh = #{idevtdh,jdbcType=INTEGER},
  302. </if>
  303. <if test="vdevkindcode != null" >
  304. vdevkindcode = #{vdevkindcode,jdbcType=VARCHAR},
  305. </if>
  306. <if test="sitecode != null" >
  307. sitecode = #{sitecode,jdbcType=VARCHAR},
  308. </if>
  309. <if test="vcfcode != null" >
  310. vcfcode = #{vcfcode,jdbcType=VARCHAR},
  311. </if>
  312. <if test="vposition != null" >
  313. vposition = #{vposition,jdbcType=VARCHAR},
  314. </if>
  315. <if test="valarmstatue != null" >
  316. valarmstatue = #{valarmstatue,jdbcType=VARCHAR},
  317. </if>
  318. <if test="updatetime != null" >
  319. updatetime = #{updatetime,jdbcType=TIMESTAMP},
  320. </if>
  321. <if test="remark != null" >
  322. remark = #{remark,jdbcType=VARCHAR},
  323. </if>
  324. <if test="vstatue != null" >
  325. vstatue = #{vstatue,jdbcType=VARCHAR},
  326. </if>
  327. <if test="orgId != null" >
  328. org_id = #{orgId,jdbcType=INTEGER},
  329. </if>
  330. <if test="delFlag != null" >
  331. del_flag = #{delFlag,jdbcType=INTEGER},
  332. </if>
  333. </set>
  334. where id = #{id,jdbcType=VARCHAR}
  335. </update>
  336. <update id="updateByPrimaryKey" parameterType="com.chinaitop.depot.intelligent.ventilation.model.TCtldevinfo" >
  337. update t_ctldevinfo
  338. set vdevcode = #{vdevcode,jdbcType=VARCHAR},
  339. vdevname = #{vdevname,jdbcType=VARCHAR},
  340. idevtdh = #{idevtdh,jdbcType=INTEGER},
  341. vdevkindcode = #{vdevkindcode,jdbcType=VARCHAR},
  342. sitecode = #{sitecode,jdbcType=VARCHAR},
  343. vcfcode = #{vcfcode,jdbcType=VARCHAR},
  344. vposition = #{vposition,jdbcType=VARCHAR},
  345. valarmstatue = #{valarmstatue,jdbcType=VARCHAR},
  346. updatetime = #{updatetime,jdbcType=TIMESTAMP},
  347. remark = #{remark,jdbcType=VARCHAR},
  348. vstatue = #{vstatue,jdbcType=VARCHAR},
  349. org_id = #{orgId,jdbcType=INTEGER},
  350. del_flag = #{delFlag,jdbcType=INTEGER}
  351. where id = #{id,jdbcType=VARCHAR}
  352. </update>
  353. <!-- 根据仓房,设备类型获取设备信息 -->
  354. <select id="selectBycf" parameterType="java.util.Map" resultMap="BaseResultMap">
  355. select <include refid="Base_Column_List" />
  356. from t_ctldevinfo where
  357. vcfcode = #{vcfcode,jdbcType=VARCHAR} and vdevkindcode = #{vdevkindcode,jdbcType=VARCHAR}
  358. </select>
  359. </mapper>