StationOilGunMapper.xml 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340
  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.platform.yijia.dao.StationOilGunMapper">
  4. <resultMap id="BaseResultMap" type="com.platform.yijia.pojo.StationOilGun">
  5. <!--
  6. WARNING - @mbg.generated
  7. This element is automatically generated by MyBatis Generator, do not modify.
  8. -->
  9. <id column="oil_gun_id" jdbcType="INTEGER" property="oilGunId" />
  10. <result column="oil_gun_no" jdbcType="VARCHAR" property="oilGunNo" />
  11. <result column="oil_name" jdbcType="VARCHAR" property="oilName" />
  12. <result column="oil_price" jdbcType="DECIMAL" property="oilPrice" />
  13. <result column="station_id" jdbcType="INTEGER" property="stationId" />
  14. <result column="station_name" jdbcType="VARCHAR" property="stationName" />
  15. <result column="date" jdbcType="TIMESTAMP" property="date" />
  16. <result column="status" jdbcType="VARCHAR" property="status" />
  17. </resultMap>
  18. <sql id="Example_Where_Clause">
  19. <!--
  20. WARNING - @mbg.generated
  21. This element is automatically generated by MyBatis Generator, do not modify.
  22. -->
  23. <where>
  24. <foreach collection="oredCriteria" item="criteria" separator="or">
  25. <if test="criteria.valid">
  26. <trim prefix="(" prefixOverrides="and" suffix=")">
  27. <foreach collection="criteria.criteria" item="criterion">
  28. <choose>
  29. <when test="criterion.noValue">
  30. and ${criterion.condition}
  31. </when>
  32. <when test="criterion.singleValue">
  33. and ${criterion.condition} #{criterion.value}
  34. </when>
  35. <when test="criterion.betweenValue">
  36. and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
  37. </when>
  38. <when test="criterion.listValue">
  39. and ${criterion.condition}
  40. <foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
  41. #{listItem}
  42. </foreach>
  43. </when>
  44. </choose>
  45. </foreach>
  46. </trim>
  47. </if>
  48. </foreach>
  49. </where>
  50. </sql>
  51. <sql id="Update_By_Example_Where_Clause">
  52. <!--
  53. WARNING - @mbg.generated
  54. This element is automatically generated by MyBatis Generator, do not modify.
  55. -->
  56. <where>
  57. <foreach collection="example.oredCriteria" item="criteria" separator="or">
  58. <if test="criteria.valid">
  59. <trim prefix="(" prefixOverrides="and" suffix=")">
  60. <foreach collection="criteria.criteria" item="criterion">
  61. <choose>
  62. <when test="criterion.noValue">
  63. and ${criterion.condition}
  64. </when>
  65. <when test="criterion.singleValue">
  66. and ${criterion.condition} #{criterion.value}
  67. </when>
  68. <when test="criterion.betweenValue">
  69. and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
  70. </when>
  71. <when test="criterion.listValue">
  72. and ${criterion.condition}
  73. <foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
  74. #{listItem}
  75. </foreach>
  76. </when>
  77. </choose>
  78. </foreach>
  79. </trim>
  80. </if>
  81. </foreach>
  82. </where>
  83. </sql>
  84. <sql id="Base_Column_List">
  85. <!--
  86. WARNING - @mbg.generated
  87. This element is automatically generated by MyBatis Generator, do not modify.
  88. -->
  89. oil_gun_id, oil_gun_no, oil_name, oil_price, station_id, station_name, date, status
  90. </sql>
  91. <select id="selectByExample" parameterType="com.platform.yijia.pojo.StationOilGunExample" resultMap="BaseResultMap">
  92. <!--
  93. WARNING - @mbg.generated
  94. This element is automatically generated by MyBatis Generator, do not modify.
  95. -->
  96. select
  97. <if test="distinct">
  98. distinct
  99. </if>
  100. <include refid="Base_Column_List" />
  101. from station_oil_gun
  102. <if test="_parameter != null">
  103. <include refid="Example_Where_Clause" />
  104. </if>
  105. <if test="orderByClause != null">
  106. order by ${orderByClause}
  107. </if>
  108. </select>
  109. <select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
  110. <!--
  111. WARNING - @mbg.generated
  112. This element is automatically generated by MyBatis Generator, do not modify.
  113. -->
  114. select
  115. <include refid="Base_Column_List" />
  116. from station_oil_gun
  117. where oil_gun_id = #{oilGunId,jdbcType=INTEGER}
  118. </select>
  119. <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
  120. <!--
  121. WARNING - @mbg.generated
  122. This element is automatically generated by MyBatis Generator, do not modify.
  123. -->
  124. delete from station_oil_gun
  125. where oil_gun_id = #{oilGunId,jdbcType=INTEGER}
  126. </delete>
  127. <delete id="deleteByExample" parameterType="com.platform.yijia.pojo.StationOilGunExample">
  128. <!--
  129. WARNING - @mbg.generated
  130. This element is automatically generated by MyBatis Generator, do not modify.
  131. -->
  132. delete from station_oil_gun
  133. <if test="_parameter != null">
  134. <include refid="Example_Where_Clause" />
  135. </if>
  136. </delete>
  137. <insert id="insert" parameterType="com.platform.yijia.pojo.StationOilGun">
  138. <!--
  139. WARNING - @mbg.generated
  140. This element is automatically generated by MyBatis Generator, do not modify.
  141. -->
  142. insert into station_oil_gun (oil_gun_id, oil_gun_no, oil_name,
  143. oil_price, station_id, station_name,
  144. date, status)
  145. values (#{oilGunId,jdbcType=INTEGER}, #{oilGunNo,jdbcType=VARCHAR}, #{oilName,jdbcType=VARCHAR},
  146. #{oilPrice,jdbcType=DECIMAL}, #{stationId,jdbcType=INTEGER}, #{stationName,jdbcType=VARCHAR},
  147. #{date,jdbcType=TIMESTAMP}, #{status,jdbcType=VARCHAR})
  148. </insert>
  149. <insert id="insertSelective" parameterType="com.platform.yijia.pojo.StationOilGun">
  150. <!--
  151. WARNING - @mbg.generated
  152. This element is automatically generated by MyBatis Generator, do not modify.
  153. -->
  154. insert into station_oil_gun
  155. <trim prefix="(" suffix=")" suffixOverrides=",">
  156. <if test="oilGunId != null">
  157. oil_gun_id,
  158. </if>
  159. <if test="oilGunNo != null">
  160. oil_gun_no,
  161. </if>
  162. <if test="oilName != null">
  163. oil_name,
  164. </if>
  165. <if test="oilPrice != null">
  166. oil_price,
  167. </if>
  168. <if test="stationId != null">
  169. station_id,
  170. </if>
  171. <if test="stationName != null">
  172. station_name,
  173. </if>
  174. <if test="date != null">
  175. date,
  176. </if>
  177. <if test="status != null">
  178. status,
  179. </if>
  180. </trim>
  181. <trim prefix="values (" suffix=")" suffixOverrides=",">
  182. <if test="oilGunId != null">
  183. #{oilGunId,jdbcType=INTEGER},
  184. </if>
  185. <if test="oilGunNo != null">
  186. #{oilGunNo,jdbcType=VARCHAR},
  187. </if>
  188. <if test="oilName != null">
  189. #{oilName,jdbcType=VARCHAR},
  190. </if>
  191. <if test="oilPrice != null">
  192. #{oilPrice,jdbcType=DECIMAL},
  193. </if>
  194. <if test="stationId != null">
  195. #{stationId,jdbcType=INTEGER},
  196. </if>
  197. <if test="stationName != null">
  198. #{stationName,jdbcType=VARCHAR},
  199. </if>
  200. <if test="date != null">
  201. #{date,jdbcType=TIMESTAMP},
  202. </if>
  203. <if test="status != null">
  204. #{status,jdbcType=VARCHAR},
  205. </if>
  206. </trim>
  207. </insert>
  208. <select id="countByExample" parameterType="com.platform.yijia.pojo.StationOilGunExample" resultType="java.lang.Long">
  209. <!--
  210. WARNING - @mbg.generated
  211. This element is automatically generated by MyBatis Generator, do not modify.
  212. -->
  213. select count(*) from station_oil_gun
  214. <if test="_parameter != null">
  215. <include refid="Example_Where_Clause" />
  216. </if>
  217. </select>
  218. <update id="updateByExampleSelective" parameterType="map">
  219. <!--
  220. WARNING - @mbg.generated
  221. This element is automatically generated by MyBatis Generator, do not modify.
  222. -->
  223. update station_oil_gun
  224. <set>
  225. <if test="record.oilGunId != null">
  226. oil_gun_id = #{record.oilGunId,jdbcType=INTEGER},
  227. </if>
  228. <if test="record.oilGunNo != null">
  229. oil_gun_no = #{record.oilGunNo,jdbcType=VARCHAR},
  230. </if>
  231. <if test="record.oilName != null">
  232. oil_name = #{record.oilName,jdbcType=VARCHAR},
  233. </if>
  234. <if test="record.oilPrice != null">
  235. oil_price = #{record.oilPrice,jdbcType=DECIMAL},
  236. </if>
  237. <if test="record.stationId != null">
  238. station_id = #{record.stationId,jdbcType=INTEGER},
  239. </if>
  240. <if test="record.stationName != null">
  241. station_name = #{record.stationName,jdbcType=VARCHAR},
  242. </if>
  243. <if test="record.date != null">
  244. date = #{record.date,jdbcType=TIMESTAMP},
  245. </if>
  246. <if test="record.status != null">
  247. status = #{record.status,jdbcType=VARCHAR},
  248. </if>
  249. </set>
  250. <if test="_parameter != null">
  251. <include refid="Update_By_Example_Where_Clause" />
  252. </if>
  253. </update>
  254. <update id="updateByExample" parameterType="map">
  255. <!--
  256. WARNING - @mbg.generated
  257. This element is automatically generated by MyBatis Generator, do not modify.
  258. -->
  259. update station_oil_gun
  260. set oil_gun_id = #{record.oilGunId,jdbcType=INTEGER},
  261. oil_gun_no = #{record.oilGunNo,jdbcType=VARCHAR},
  262. oil_name = #{record.oilName,jdbcType=VARCHAR},
  263. oil_price = #{record.oilPrice,jdbcType=DECIMAL},
  264. station_id = #{record.stationId,jdbcType=INTEGER},
  265. station_name = #{record.stationName,jdbcType=VARCHAR},
  266. date = #{record.date,jdbcType=TIMESTAMP},
  267. status = #{record.status,jdbcType=VARCHAR}
  268. <if test="_parameter != null">
  269. <include refid="Update_By_Example_Where_Clause" />
  270. </if>
  271. </update>
  272. <update id="updateByPrimaryKeySelective" parameterType="com.platform.yijia.pojo.StationOilGun">
  273. <!--
  274. WARNING - @mbg.generated
  275. This element is automatically generated by MyBatis Generator, do not modify.
  276. -->
  277. update station_oil_gun
  278. <set>
  279. <if test="oilGunNo != null">
  280. oil_gun_no = #{oilGunNo,jdbcType=VARCHAR},
  281. </if>
  282. <if test="oilName != null">
  283. oil_name = #{oilName,jdbcType=VARCHAR},
  284. </if>
  285. <if test="oilPrice != null">
  286. oil_price = #{oilPrice,jdbcType=DECIMAL},
  287. </if>
  288. <if test="stationId != null">
  289. station_id = #{stationId,jdbcType=INTEGER},
  290. </if>
  291. <if test="stationName != null">
  292. station_name = #{stationName,jdbcType=VARCHAR},
  293. </if>
  294. <if test="date != null">
  295. date = #{date,jdbcType=TIMESTAMP},
  296. </if>
  297. <if test="status != null">
  298. status = #{status,jdbcType=VARCHAR},
  299. </if>
  300. </set>
  301. where oil_gun_id = #{oilGunId,jdbcType=INTEGER}
  302. </update>
  303. <update id="updateByPrimaryKey" parameterType="com.platform.yijia.pojo.StationOilGun">
  304. <!--
  305. WARNING - @mbg.generated
  306. This element is automatically generated by MyBatis Generator, do not modify.
  307. -->
  308. update station_oil_gun
  309. set oil_gun_no = #{oilGunNo,jdbcType=VARCHAR},
  310. oil_name = #{oilName,jdbcType=VARCHAR},
  311. oil_price = #{oilPrice,jdbcType=DECIMAL},
  312. station_id = #{stationId,jdbcType=INTEGER},
  313. station_name = #{stationName,jdbcType=VARCHAR},
  314. date = #{date,jdbcType=TIMESTAMP},
  315. status = #{status,jdbcType=VARCHAR}
  316. where oil_gun_id = #{oilGunId,jdbcType=INTEGER}
  317. </update>
  318. <!--根据油站Id油枪号获取打印机编号 -->
  319. <select id="getPrinterSnByStationIdAndOilGunNo" parameterType="map" resultType="map">
  320. SELECT
  321. A.gun_no AS oilGunNo,
  322. A.station_id AS stationId,
  323. A.device_no AS printerSn,
  324. B.print_setting AS printSetting
  325. FROM station_device_manage AS A
  326. LEFT JOIN station_pay AS B ON A.station_id = B.station_id
  327. <where>
  328. A.device_status = "1"
  329. <if test="oilGunNo != null and oilGunNo !=''">
  330. AND FIND_IN_SET(#{oilGunNo}, A.gun_no)
  331. </if>
  332. <if test="stationId != null and stationId !=''">
  333. AND A.station_id = #{stationId}
  334. </if>
  335. </where>
  336. </select>
  337. </mapper>