ThirdInterface.xml 30 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908
  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <!DOCTYPE mapper
  3. PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
  4. "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
  5. <mapper namespace="com.runzhixing.dao.interf.ThirdInterface">
  6. <update id="updateWxInfo" parameterType="com.runzhixing.bean.WxInfo">
  7. update TB_REG_USER set NICKNAME=#{nickName},REGTIME=to_date(#{operTime},'yyyy-mm-dd hh24:mi:ss') where WXID = #{wxId}
  8. </update>
  9. <update id="insertWxInfo" parameterType="com.runzhixing.bean.WxInfo">
  10. <!-- insert into TB_REG_USER(WXID,NICKNAME,REGTIME) values (#{wxId},#{nickName},to_date(#{operTime},'yyyy-mm-dd hh24:mi:ss')) -->
  11. insert into TB_REG_USER (WXID,NICKNAME,REGTIME)
  12. select #{wxId},#{nickName},to_date(#{operTime},'yyyy-mm-dd hh24:mi:ss') from dual
  13. where NOT EXISTS (SELECT WXID FROM TB_REG_USER WHERE WXID= #{wxId})
  14. </update>
  15. <update id="updateRegister" parameterType="com.runzhixing.bean.Register">
  16. update TB_REG_USER set
  17. <if test="UNITNAME != null">
  18. UNITNAME=#{UNITNAME},
  19. </if>
  20. <if test="UNITAB != null">
  21. UNITAB=#{UNITAB},
  22. </if>
  23. <if test="UNITMANA != null">
  24. UNITMANA=#{UNITMANA},
  25. </if>
  26. <if test="UNITPHONE != null">
  27. UNITPHONE=#{UNITPHONE},
  28. </if>
  29. <if test="USERNAME != null">
  30. USERNAME=#{USERNAME},
  31. </if>
  32. <if test="USCC != null">
  33. USCC=#{USCC},
  34. </if>
  35. <if test="UNITSAFEMANA != null">
  36. UNITSAFEMANA=#{UNITSAFEMANA},
  37. </if>
  38. <if test="UNITSAFEPHONE != null">
  39. UNITSAFEPHONE=#{UNITSAFEPHONE},
  40. </if>
  41. <if test="MOBILE != null">
  42. MOBILE=#{MOBILE},
  43. </if>
  44. <if test="POST != null">
  45. POST=#{POST},
  46. </if>
  47. <if test="ADDR != null">
  48. ADDR=#{ADDR},
  49. </if>
  50. <if test="USERID != null">
  51. USERID=#{USERID},
  52. </if>
  53. <if test="USERTYPE != null">
  54. USERTYPE=#{USERTYPE},
  55. </if>
  56. <if test="EMAIL != null">
  57. EMAIL=#{EMAIL},
  58. </if>
  59. <if test="nickName != null">
  60. nickName=#{nickName},
  61. </if>
  62. <if test="districtNo != null">
  63. DISTRICTNO=#{districtNo},
  64. </if>
  65. REGTIME=to_date(#{REGTIME},'yyyy-mm-dd hh24:mi:ss'),
  66. WXVERIFY=1,
  67. REGSTATE=1
  68. where WXID=#{openid}
  69. <!--
  70. where WXID=#{openid}
  71. update TB_REG_USER set
  72. UNITNAME=#{UNITNAME},
  73. UNITAB=#{UNITAB},
  74. UNITMANA=#{UNITMANA},
  75. UNITPHONE=#{UNITPHONE},
  76. USERNAME=#{USERNAME},
  77. USCC=#{USCC},
  78. UNITSAFEMANA=#{UNITSAFEMANA},
  79. UNITSAFEPHONE=#{UNITSAFEPHONE},
  80. MOBILE=#{MOBILE},
  81. POST=#{POST},
  82. ADDR=#{ADDR},
  83. USERID=#{USERID},
  84. USERTYPE=#{USERTYPE},
  85. EMAIL=#{EMAIL},
  86. nickName=#{nickName},
  87. REGTIME=to_date(#{REGTIME},'yyyy-mm-dd hh24:mi:ss'),
  88. WXVERIFY=1,
  89. REGSTATE=1
  90. where WXID=#{openid}
  91. -->
  92. </update>
  93. <insert id="insertRegister" parameterType="com.runzhixing.bean.Register">
  94. insert into
  95. TB_REG_USER(WXID,nickName,UNITNAME,UNITAB,UNITMANA,UNITPHONE,USERNAME,USCC,UNITSAFEMANA,UNITSAFEPHONE,MOBILE,POST,ADDR,USERID,USERTYPE,EMAIL,REGTIME,WXVERIFY,REGSTATE)
  96. values (#{openid},#{nickName},#{UNITNAME},#{UNITAB},#{UNITMANA},#{UNITPHONE},#{USERNAME},#{USCC},#{UNITSAFEMANA},#{UNITSAFEPHONE},#{MOBILE},#{POST},#{ADDR},#{USERID},#{USERTYPE},#{EMAIL},to_date(#{REGTIME},'yyyy-mm-dd hh24:mi:ss'),1,1)
  97. </insert>
  98. <resultMap id="province_list" type="com.runzhixing.bean.Provice_new">
  99. <result column="provinceno" property="id"/>
  100. <result column="provincename" property="name"/>
  101. <result column="provinceab" property="ab"/>
  102. <result column="carprefix1" property="carPrefix"/>
  103. <collection property="cityList" javaType="java.util.List" resultMap="cityList"/>
  104. </resultMap>
  105. <resultMap id="cityList" type="com.runzhixing.bean.City_new">
  106. <result column="cityno" property="id"/>
  107. <result column="cityname" property="name"/>
  108. <result column="cityab" property="ab"/>
  109. <result column="carprefix2" property="carPrefix"/>
  110. <collection property="countryList" javaType="java.util.List" resultMap="countryList"/>
  111. </resultMap>
  112. <resultMap id="countryList" type="com.runzhixing.bean.Country_new">
  113. <result column="countyno" property="id"/>
  114. <result column="countyname" property="name"/>
  115. <result column="countyab" property="ab"/>
  116. <result column="carprefix3" property="carPrefix"/>
  117. </resultMap>
  118. <select id="city_country_inifo" parameterType="String" resultMap="province_list">
  119. select
  120. t0.provinceno,t0.provincename,t0.provinceab,t0.carprefix as carprefix1,
  121. t.cityno,t.cityname,t.cityab,t.carprefix as carprefix2,
  122. t1.countyno,t1.countyname,t1.countyab,t1.carprefix as carprefix3
  123. from
  124. td_province t0
  125. left join
  126. td_city t on t.provinceno = t0.provinceno
  127. left join TD_COUNTY t1 on t1.provinceno = t.provinceno and t1.cityno=t.cityno
  128. where t.provinceno=#{province} and t.cityno!='00'
  129. order by t0.provinceno asc,t.cityno asc,t1.countyno asc
  130. </select>
  131. <resultMap id="wxList" type="com.runzhixing.bean.WxInfo">
  132. <result column="DISTRICTNO" property="districtNo"/>
  133. <result column="USER_GUID" property="userGuid"/>
  134. <result column="WXID" property="wxId"/>
  135. <result column="nickName" property="nickName"/>
  136. <result column="UNITNAME" property="UNITNAME"/>
  137. <result column="UNITAB" property="UNITAB"/>
  138. <result column="UNITMANA" property="UNITMANA"/>
  139. <result column="UNITPHONE" property="UNITPHONE"/>
  140. <result column="USERNAME" property="USERNAME"/>
  141. <result column="USCC" property="USCC"/>
  142. <result column="UNITSAFEMANA" property="UNITSAFEMANA"/>
  143. <result column="UNITSAFEPHONE" property="UNITSAFEPHONE"/>
  144. <result column="MOBILE" property="MOBILE"/>
  145. <result column="POST" property="POST"/>
  146. <result column="ADDR" property="ADDR"/>
  147. <result column="USERID" property="idNo"/>
  148. <result column="USERTYPE" property="USERTYPE"/>
  149. <result column="EMAIL" property="EMAIL"/>
  150. <result column="REGTIME" property="REGTIME"/>
  151. </resultMap>
  152. <select id="queryWxInfo" parameterType="com.runzhixing.bean.WxInfo" resultMap="wxList">
  153. select
  154. DISTRICTNO,USER_GUID,WXID,nickName,UNITNAME,UNITAB,UNITMANA,UNITPHONE,USERNAME,USCC,UNITSAFEMANA,UNITSAFEPHONE,MOBILE,POST,ADDR,USERID,USERTYPE,EMAIL,REGTIME,WXVERIFY,REGSTATE
  155. from TB_REG_USER t where t.WXID = #{wxId}
  156. </select>
  157. <resultMap id="atList" type="com.runzhixing.bean.AppType">
  158. <result column="PROVINCENO" property="id"/>
  159. <result column="PROVINCENAME" property="name"/>
  160. </resultMap>
  161. <select id="getProviceInfo" resultMap="atList">
  162. select
  163. PROVINCENO,PROVINCENAME
  164. from TD_PROVINCE order by PROVINCENO asc
  165. </select>
  166. <resultMap id="cyImgList" type="com.runzhixing.bean.CylinderImg">
  167. <result column="CYLINDER_GUID" property="CYLINDER_GUID"/>
  168. <result column="IMGTYPE" property="IMGTYPE"/>
  169. <result column="IMGINDEX" property="IMGINDEX"/>
  170. <result column="FILENAME" property="FILENAME"/>
  171. <result column="FROMTYPE" property="FROMTYPE"/>
  172. <result column="OTHEROPERATOR" property="OTHEROPERATOR"/>
  173. <result column="EDITSTATIONNO" property="EDITSTATIONNO"/>
  174. <result column="EDITOPERATORNO" property="EDITOPERATORNO"/>
  175. <result column="EDITOPERTIME" property="EDITOPERTIME"/>
  176. </resultMap>
  177. <select id="queryCylinderImg" parameterType="String" resultMap="cyImgList">
  178. select CYLINDER_GUID,IMGTYPE,IMGINDEX,IMGDIR,FILENAME,FROMTYPE,OTHEROPERATOR,EDITSTATIONNO,EDITOPERATORNO,EDITOPERTIME from TB_CYLINDER_IMG where CYLINDER_GUID = #{cylinderGuid}
  179. </select>
  180. <delete id="deleteCertInfo" parameterType="List">
  181. delete from TB_CYLINDER_IMG
  182. where CYLINDER_GUID in
  183. <foreach collection="list" index="index" item="cylinderW" open="(" separator="," close=")">
  184. #{cylinderW.cylinderGuid}
  185. </foreach>
  186. </delete>
  187. <select id="getCngCarCount" parameterType="com.runzhixing.bean.ReportFormBean" resultType="Integer">
  188. <!-- select count(T1.CAR_GUID) from V_CAR_ALL t1
  189. join
  190. (
  191. select t.CAR_GUID from v_cylinder_all t where t.CYLINDERTYPE in(0,1,2,3,4) GROUP BY t.CAR_GUID
  192. )tt on tt.CAR_GUID = t1.CAR_GUID
  193. where
  194. t1.REGTIME <![CDATA[ <= ]]> to_date(#{endDate},'yyyy-mm-dd')
  195. and
  196. T1.DISTRICTNO LIKE CONCAT(#{authCode},'%') -->
  197. select NVL(count(T1.CAR_GUID) ,0) from V_CAR_ALL t1
  198. where
  199. T1.CAR_GUID IN
  200. (
  201. select t.CAR_GUID from v_cylinder_all t where t.CYLINDERTYPE in(0,1,2,3,4)
  202. )
  203. and
  204. t1.REGTIME <![CDATA[ <= ]]> to_date(#{endDate},'yyyy-mm-dd')
  205. and
  206. T1.DISTRICTNO LIKE CONCAT(#{authCode},'%')
  207. </select>
  208. <select id="getCngCylinderCount" parameterType="com.runzhixing.bean.ReportFormBean" resultType="Integer">
  209. <!-- select count(t.CYLINDER_GUID) from V_CYLINDER_ALL t join V_CAR_ALL t1 on T1.CAR_GUID=t.CAR_GUID
  210. where
  211. t.CYLINDERTYPE in (0,1,2,3,4)
  212. and
  213. T1.REGTIME <![CDATA[ <= ]]> to_date(#{endDate},'yyyy-mm-dd')
  214. and
  215. T1.DISTRICTNO LIKE CONCAT(#{authCode},'%') -->
  216. select NVL(sum(T1.installNum) ,0) from V_CAR_ALL t1
  217. where
  218. T1.CAR_GUID IN
  219. (
  220. select t.CAR_GUID from v_cylinder_all t where t.CYLINDERTYPE in(0,1,2,3,4)
  221. )
  222. and
  223. t1.REGTIME <![CDATA[ <= ]]> to_date(#{endDate},'yyyy-mm-dd')
  224. and
  225. T1.DISTRICTNO LIKE CONCAT(#{authCode},'%')
  226. </select>
  227. <select id="getCngCarCylinderCount" parameterType="com.runzhixing.bean.ReportFormBean" resultType="com.runzhixing.bean.ReportFormBean">
  228. select count(T1.CAR_GUID) as cngCarCount, sum(T1.installNum) as cngCylinderCount from V_CAR_ALL t1
  229. where
  230. T1.CAR_GUID IN
  231. (
  232. select t.CAR_GUID from v_cylinder_all t where t.CYLINDERTYPE in(0,1,2,3,4)
  233. )
  234. and
  235. t1.REGTIME <![CDATA[ <= ]]> to_date(#{endDate},'yyyy-mm-dd')
  236. and
  237. T1.DISTRICTNO LIKE CONCAT(#{authCode},'%')
  238. </select>
  239. <select id="getLngCarCount" parameterType="com.runzhixing.bean.ReportFormBean" resultType="Integer">
  240. <!-- select count(T1.CAR_GUID) from V_CAR_ALL t1
  241. join
  242. (
  243. select t.CAR_GUID from v_cylinder_all t where t.CYLINDERTYPE = 5 GROUP BY t.CAR_GUID
  244. )tt on tt.CAR_GUID = T1.CAR_GUID
  245. where
  246. T1.REGTIME <![CDATA[ <= ]]> to_date(#{endDate},'yyyy-mm-dd')
  247. and
  248. T1.DISTRICTNO LIKE CONCAT(#{authCode},'%') -->
  249. select NVL(count(T1.CAR_GUID) ,0) from V_CAR_ALL t1
  250. where
  251. T1.CAR_GUID IN
  252. (
  253. select t.CAR_GUID from v_cylinder_all t where t.CYLINDERTYPE = 5
  254. )
  255. and
  256. t1.REGTIME <![CDATA[ <= ]]> to_date(#{endDate},'yyyy-mm-dd')
  257. and
  258. T1.DISTRICTNO LIKE CONCAT(#{authCode},'%')
  259. </select>
  260. <select id="getLngCngCylinderCount" parameterType="com.runzhixing.bean.ReportFormBean" resultType="com.runzhixing.bean.ReportFormBean">
  261. select count(T1.CAR_GUID) as lngCarCount, sum(T1.installNum) as lngCylinderCount from V_CAR_ALL t1
  262. where
  263. T1.CAR_GUID IN
  264. (
  265. select t.CAR_GUID from v_cylinder_all t where t.CYLINDERTYPE = 5
  266. )
  267. and
  268. t1.REGTIME <![CDATA[ <= ]]> to_date(#{endDate},'yyyy-mm-dd')
  269. and
  270. T1.DISTRICTNO LIKE CONCAT(#{authCode},'%')
  271. </select>
  272. <select id="getLngCylinderCount" parameterType="com.runzhixing.bean.ReportFormBean" resultType="Integer">
  273. <!-- select count(t.CYLINDER_GUID) from V_CYLINDER_ALL t join V_CAR_ALL t1 on T1.CAR_GUID=t.CAR_GUID
  274. where
  275. t.CYLINDERTYPE = 5
  276. and T1.REGTIME <![CDATA[ <= ]]> to_date(#{endDate},'yyyy-mm-dd')
  277. and T1.CARSTATE=0
  278. and
  279. T1.DISTRICTNO LIKE CONCAT(#{authCode},'%') -->
  280. select NVL(sum(T1.installNum) ,0) from V_CAR_ALL t1
  281. where
  282. T1.CAR_GUID IN
  283. (
  284. select t.CAR_GUID from v_cylinder_all t where t.CYLINDERTYPE = 5
  285. )
  286. and
  287. t1.REGTIME <![CDATA[ <= ]]> to_date(#{endDate},'yyyy-mm-dd')
  288. and
  289. T1.DISTRICTNO LIKE CONCAT(#{authCode},'%')
  290. </select>
  291. <select id="getCngCarCylinderInuseCount" parameterType="com.runzhixing.bean.ReportFormBean" resultType="com.runzhixing.bean.ReportFormBean">
  292. select count(T1.CAR_GUID) as cngCarInuseCount,sum(T1.installNum) as cngCylinderInuseCount from V_CAR_ALL t1
  293. where
  294. T1.CAR_GUID in
  295. (
  296. select t.CAR_GUID from v_cylinder_all t where t.CYLINDERTYPE in(0,1,2,3,4)
  297. )
  298. and
  299. T1.CAR_GUID in
  300. (
  301. select t.CAR_GUID from tb_guidfillinfo t where
  302. t.FILLTIME <![CDATA[ <= ]]> to_date(#{endDate},'yyyy-mm-dd')
  303. and t.FILLTIME <![CDATA[ >= ]]> to_date(#{startDate},'yyyy-mm-dd')
  304. )
  305. and
  306. t1.DISTRICTNO LIKE CONCAT(#{authCode},'%')
  307. </select>
  308. <select id="getLngCarCylinderInuseCount" parameterType="com.runzhixing.bean.ReportFormBean" resultType="com.runzhixing.bean.ReportFormBean">
  309. select count(T1.CAR_GUID) as cngCarInuseCount,sum(T1.installNum) as cngCylinderInuseCount from V_CAR_ALL t1
  310. where
  311. T1.CAR_GUID in
  312. (
  313. select t.CAR_GUID from v_cylinder_all t where t.CYLINDERTYPE = 5
  314. )
  315. and
  316. T1.CAR_GUID in
  317. (
  318. select t.CAR_GUID from tb_guidfillinfo t where
  319. t.FILLTIME <![CDATA[ <= ]]> to_date(#{endDate},'yyyy-mm-dd')
  320. and t.FILLTIME <![CDATA[ >= ]]> to_date(#{startDate},'yyyy-mm-dd')
  321. )
  322. and
  323. t1.DISTRICTNO LIKE CONCAT(#{authCode},'%')
  324. </select>
  325. <select id="getCngCarInuseCount" parameterType="com.runzhixing.bean.ReportFormBean" resultType="Integer">
  326. <!-- select count(T1.CAR_GUID) from V_CAR_ALL t1
  327. join
  328. (
  329. select t.CAR_GUID from v_cylinder_all t where t.CYLINDERTYPE in(0,1,2,3,4) GROUP BY t.CAR_GUID
  330. )tt on tt.CAR_GUID = T1.CAR_GUID
  331. join
  332. (
  333. select t.CAR_GUID from tb_guidfillinfo t where
  334. t.FILLTIME <![CDATA[ <= ]]> to_date(#{endDate},'yyyy-mm-dd')
  335. and t.FILLTIME <![CDATA[ >= ]]> to_date(#{startDate},'yyyy-mm-dd')
  336. GROUP BY t.CAR_GUID
  337. )tt1 on tt1.CAR_GUID = T1.CAR_GUID
  338. where
  339. t1.DISTRICTNO LIKE CONCAT(#{authCode},'%') -->
  340. select NVL(count(T1.CAR_GUID) ,0) from V_CAR_ALL t1
  341. where
  342. T1.CAR_GUID in
  343. (
  344. select t.CAR_GUID from v_cylinder_all t where t.CYLINDERTYPE in(0,1,2,3,4)
  345. )
  346. and
  347. T1.CAR_GUID in
  348. (
  349. select t.CAR_GUID from tb_guidfillinfo t where
  350. t.FILLTIME <![CDATA[ <= ]]> to_date(#{endDate},'yyyy-mm-dd')
  351. and t.FILLTIME <![CDATA[ >= ]]> to_date(#{startDate},'yyyy-mm-dd')
  352. )
  353. and
  354. t1.DISTRICTNO LIKE CONCAT(#{authCode},'%')
  355. </select>
  356. <select id="getCngCylinderInuseCount" parameterType="com.runzhixing.bean.ReportFormBean" resultType="Integer">
  357. <!-- select count(t.CYLINDER_GUID) from V_CYLINDER_ALL t join V_CAR_ALL t1 on T1.CAR_GUID=t.CAR_GUID
  358. join
  359. (
  360. select t.CAR_GUID from tb_guidfillinfo t where
  361. t.FILLTIME <![CDATA[ <= ]]> to_date(#{endDate},'yyyy-mm-dd')
  362. and t.FILLTIME <![CDATA[ >= ]]> to_date(#{startDate},'yyyy-mm-dd')
  363. GROUP BY t.CAR_GUID
  364. )tt on tt.CAR_GUID = T1.CAR_GUID
  365. where
  366. t.CYLINDERTYPE in (0,1,2,3,4)
  367. and
  368. t1.DISTRICTNO LIKE CONCAT(#{authCode},'%') -->
  369. select NVL(sum(T1.installNum) ,0) from V_CAR_ALL t1
  370. where
  371. T1.CAR_GUID in
  372. (
  373. select t.CAR_GUID from v_cylinder_all t where t.CYLINDERTYPE in(0,1,2,3,4)
  374. )
  375. and
  376. T1.CAR_GUID in
  377. (
  378. select t.CAR_GUID from tb_guidfillinfo t where
  379. t.FILLTIME <![CDATA[ <= ]]> to_date(#{endDate},'yyyy-mm-dd')
  380. and t.FILLTIME <![CDATA[ >= ]]> to_date(#{startDate},'yyyy-mm-dd')
  381. )
  382. and
  383. t1.DISTRICTNO LIKE CONCAT(#{authCode},'%')
  384. </select>
  385. <select id="getLngCarInuseCount" parameterType="com.runzhixing.bean.ReportFormBean" resultType="Integer">
  386. <!-- select count(T1.CAR_GUID) from V_CAR_ALL t1
  387. join
  388. (
  389. select t.CAR_GUID from v_cylinder_all t where t.CYLINDERTYPE =5 GROUP BY t.CAR_GUID
  390. )tt on tt.CAR_GUID = T1.CAR_GUID
  391. join
  392. (
  393. select t.CAR_GUID from tb_guidfillinfo t where
  394. t.FILLTIME <![CDATA[ <= ]]> to_date(#{endDate},'yyyy-mm-dd')
  395. and t.FILLTIME <![CDATA[ >= ]]> to_date(#{startDate},'yyyy-mm-dd')
  396. GROUP BY t.CAR_GUID
  397. )tt1 on tt1.CAR_GUID = T1.CAR_GUID
  398. where
  399. t1.DISTRICTNO LIKE CONCAT(#{authCode},'%') -->
  400. select NVL(count(T1.CAR_GUID) ,0) from V_CAR_ALL t1
  401. where
  402. T1.CAR_GUID in
  403. (
  404. select t.CAR_GUID from v_cylinder_all t where t.CYLINDERTYPE = 5
  405. )
  406. and
  407. T1.CAR_GUID in
  408. (
  409. select t.CAR_GUID from tb_guidfillinfo t where
  410. t.FILLTIME <![CDATA[ <= ]]> to_date(#{endDate},'yyyy-mm-dd')
  411. and t.FILLTIME <![CDATA[ >= ]]> to_date(#{startDate},'yyyy-mm-dd')
  412. )
  413. and
  414. t1.DISTRICTNO LIKE CONCAT(#{authCode},'%')
  415. </select>
  416. <select id="getLngCylinderInuseCount" parameterType="com.runzhixing.bean.ReportFormBean" resultType="Integer">
  417. <!-- select count(t.CYLINDER_GUID) from V_CYLINDER_ALL t join V_CAR_ALL t1 on T1.CAR_GUID=t.CAR_GUID
  418. join
  419. (
  420. select t.CAR_GUID from tb_guidfillinfo t where
  421. t.FILLTIME <![CDATA[ <= ]]> to_date(#{endDate},'yyyy-mm-dd')
  422. and t.FILLTIME <![CDATA[ >= ]]> to_date(#{startDate},'yyyy-mm-dd')
  423. GROUP BY t.CAR_GUID
  424. )tt on tt.CAR_GUID = T1.CAR_GUID
  425. where
  426. t.CYLINDERTYPE =5
  427. and
  428. t1.DISTRICTNO LIKE CONCAT(#{authCode},'%') -->
  429. select NVL(sum(T1.installNum) ,0) from V_CAR_ALL t1
  430. where
  431. T1.CAR_GUID in
  432. (
  433. select t.CAR_GUID from v_cylinder_all t where t.CYLINDERTYPE = 5
  434. )
  435. and
  436. T1.CAR_GUID in
  437. (
  438. select t.CAR_GUID from tb_guidfillinfo t where
  439. t.FILLTIME <![CDATA[ <= ]]> to_date(#{endDate},'yyyy-mm-dd')
  440. and t.FILLTIME <![CDATA[ >= ]]> to_date(#{startDate},'yyyy-mm-dd')
  441. )
  442. and
  443. t1.DISTRICTNO LIKE CONCAT(#{authCode},'%')
  444. </select>
  445. <select id="getRegisterRefitPlantCount" parameterType="com.runzhixing.bean.ReportFormBean" resultType="Integer">
  446. select count(t.STATIONNO) from v_station t where t.STATIONTYPE=3 and t.STATIONNO LIKE CONCAT(#{authCode},'%')
  447. </select>
  448. <select id="getRegisterInspectionStationCount" parameterType="com.runzhixing.bean.ReportFormBean" resultType="Integer">
  449. select count(t.STATIONNO) from v_station t where t.STATIONTYPE=1 and t.STATIONNO LIKE CONCAT(#{authCode},'%')
  450. </select>
  451. <select id="getRegisterGasStationCount" parameterType="com.runzhixing.bean.ReportFormBean" resultType="Integer">
  452. select count(t.STATIONNO) from v_station t where t.STATIONTYPE=2 and t.STATIONNO LIKE CONCAT(#{authCode},'%')
  453. </select>
  454. <resultMap id="rfbList" type="com.runzhixing.bean.ReportFormBean">
  455. <result column="REGTIME" property="regTime"/>
  456. <result column="count" property="count"/>
  457. </resultMap>
  458. <select id="getTrendCngCarLsit" parameterType="com.runzhixing.bean.ReportFormBean" resultMap="rfbList">
  459. <!-- select T1.REGTIME,count(T1.REGTIME) as count from V_CAR_ALL t1
  460. join
  461. (
  462. select t.CAR_GUID from v_cylinder_all t where t.CYLINDERTYPE in(0,1,2,3,4) GROUP BY t.CAR_GUID
  463. )tt on tt.CAR_GUID = T1.CAR_GUID
  464. where
  465. (
  466. T1.REGTIME <![CDATA[ <= ]]> to_date(#{endDate},'yyyy-mm-dd')
  467. and
  468. T1.REGTIME <![CDATA[ >= ]]> to_date(#{startDate},'yyyy-mm-dd')
  469. )
  470. and
  471. t1.DISTRICTNO LIKE CONCAT(#{authCode},'%')
  472. GROUP BY T1.REGTIME -->
  473. select to_char(T.REGTIME,'yyyy-mm') as REGTIME,count(*) as count from V_CAR_ALL t
  474. where
  475. t.car_guid in
  476. (
  477. select CAR_GUID from v_cylinder_all where CYLINDERTYPE in(0,1,2,3,4)
  478. )
  479. and
  480. (
  481. T.REGTIME <![CDATA[ <= ]]> to_date(#{endDate},'yyyy-mm-dd')
  482. and
  483. T.REGTIME <![CDATA[ >= ]]> to_date(#{startDate},'yyyy-mm-dd')
  484. )
  485. and
  486. t.DISTRICTNO LIKE CONCAT(#{authCode},'%')
  487. GROUP BY to_char(T.REGTIME,'yyyy-mm')
  488. ORDER BY REGTIME
  489. </select>
  490. <select id="getTrendCngCylinderLsit" parameterType="com.runzhixing.bean.ReportFormBean" resultMap="rfbList">
  491. <!-- select T1.REGTIME,count(T1.REGTIME) as count from V_CYLINDER_ALL t join V_CAR_ALL t1 on T1.CAR_GUID=t.CAR_GUID
  492. where
  493. t.CYLINDERTYPE in (0,1,2,3,4)
  494. and (
  495. T1.REGTIME <![CDATA[ <= ]]> to_date(#{endDate},'yyyy-mm-dd')
  496. and
  497. T1.REGTIME <![CDATA[ >= ]]> to_date(#{startDate},'yyyy-mm-dd')
  498. )
  499. and T1.CARSTATE=0
  500. and
  501. t1.DISTRICTNO LIKE CONCAT(#{authCode},'%')
  502. GROUP BY T1.REGTIME -->
  503. select to_char(T.REGTIME,'yyyy-mm') as REGTIME,sum(t.installNum) as count from V_CAR_ALL t
  504. where
  505. t.car_guid in
  506. (
  507. select CAR_GUID from v_cylinder_all where CYLINDERTYPE in(0,1,2,3,4)
  508. )
  509. and
  510. (
  511. T.REGTIME <![CDATA[ <= ]]> to_date(#{endDate},'yyyy-mm-dd')
  512. and
  513. T.REGTIME <![CDATA[ >= ]]> to_date(#{startDate},'yyyy-mm-dd')
  514. )
  515. and
  516. t.DISTRICTNO LIKE CONCAT(#{authCode},'%')
  517. GROUP BY to_char(T.REGTIME,'yyyy-mm')
  518. ORDER BY REGTIME
  519. </select>
  520. <select id="getTrendLngCarLsit" parameterType="com.runzhixing.bean.ReportFormBean" resultMap="rfbList">
  521. <!-- select T1.REGTIME,count(T1.REGTIME) as count from V_CAR_ALL t1
  522. join
  523. (
  524. select t.CAR_GUID from v_cylinder_all t where t.CYLINDERTYPE =5 GROUP BY t.CAR_GUID
  525. ) tt on tt.CAR_GUID = T1.CAR_GUID
  526. where
  527. (
  528. T1.REGTIME <![CDATA[ <= ]]> to_date(#{endDate},'yyyy-mm-dd')
  529. and
  530. T1.REGTIME <![CDATA[ >= ]]> to_date(#{startDate},'yyyy-mm-dd')
  531. )
  532. and
  533. t1.DISTRICTNO LIKE CONCAT(#{authCode},'%')
  534. GROUP BY T1.REGTIME -->
  535. select to_char(T.REGTIME,'yyyy-mm') as REGTIME,count(*) as count from V_CAR_ALL t
  536. where
  537. t.car_guid in
  538. (
  539. select t.CAR_GUID from v_cylinder_all t where t.CYLINDERTYPE =5
  540. )
  541. and
  542. (
  543. T.REGTIME <![CDATA[ <= ]]> to_date(#{endDate},'yyyy-mm-dd')
  544. and
  545. T.REGTIME <![CDATA[ >= ]]> to_date(#{startDate},'yyyy-mm-dd')
  546. )
  547. and
  548. t.DISTRICTNO LIKE CONCAT(#{authCode},'%')
  549. GROUP BY to_char(T.REGTIME,'yyyy-mm')
  550. ORDER BY REGTIME
  551. </select>
  552. <select id="getTrendLngCylinderLsit" parameterType="com.runzhixing.bean.ReportFormBean" resultMap="rfbList">
  553. <!-- select T1.REGTIME,count(T1.REGTIME) as count from V_CYLINDER_ALL t join V_CAR_ALL t1 on T1.CAR_GUID=t.CAR_GUID
  554. where
  555. t.CYLINDERTYPE =5
  556. and (
  557. T1.REGTIME <![CDATA[ <= ]]> to_date(#{endDate},'yyyy-mm-dd')
  558. and
  559. T1.REGTIME <![CDATA[ >= ]]> to_date(#{startDate},'yyyy-mm-dd')
  560. )
  561. and T1.CARSTATE=0
  562. and
  563. t1.DISTRICTNO LIKE CONCAT(#{authCode},'%')
  564. GROUP BY T1.REGTIME -->
  565. select to_char(T.REGTIME,'yyyy-mm') as REGTIME,sum(t.installNum) as count from V_CAR_ALL t
  566. where
  567. t.car_guid in
  568. (
  569. select t.CAR_GUID from v_cylinder_all t where t.CYLINDERTYPE =5
  570. )
  571. and
  572. (
  573. T.REGTIME <![CDATA[ <= ]]> to_date(#{endDate},'yyyy-mm-dd')
  574. and
  575. T.REGTIME <![CDATA[ >= ]]> to_date(#{startDate},'yyyy-mm-dd')
  576. )
  577. and
  578. t.DISTRICTNO LIKE CONCAT(#{authCode},'%')
  579. GROUP BY to_char(T.REGTIME,'yyyy-mm')
  580. ORDER BY REGTIME
  581. </select>
  582. <resultMap id="inUseCngCarList" type="com.runzhixing.bean.ReportFormBean">
  583. <result column="CAR_GUID" property="carGuid"/>
  584. <result column="FILLTIME" property="fillTime"/>
  585. </resultMap>
  586. <select id="getTrendInUseCngCarLsit" parameterType="com.runzhixing.bean.ReportFormBean" resultMap="inUseCngCarList">
  587. <!-- select tt1.CAR_GUID,tt1.FILLTIME from V_CAR_ALL t1
  588. join
  589. (
  590. select t.CAR_GUID from v_cylinder_all t where t.CYLINDERTYPE in(0,1,2,3,4) GROUP BY t.CAR_GUID
  591. )tt on tt.CAR_GUID=T1.CAR_GUID
  592. join
  593. (
  594. select t.CAR_GUID,t.FILLTIME from tb_guidfillinfo t where
  595. t.FILLTIME <![CDATA[ <= ]]> to_date(#{endDate},'yyyy-mm-dd')
  596. and
  597. t.FILLTIME <![CDATA[ >= ]]> to_date(#{startDate},'yyyy-mm-dd')
  598. GROUP BY t.CAR_GUID,t.FILLTIME
  599. )tt1 on tt1.CAR_GUID = T1.CAR_GUID
  600. where
  601. t1.DISTRICTNO LIKE CONCAT(#{authCode},'%')
  602. GROUP BY tt1.CAR_GUID,tt1.FILLTIME
  603. ORDER BY tt1.FILLTIME,tt1.CAR_GUID -->
  604. select count(*) as CAR_GUID from V_CAR_ALL t1
  605. where
  606. t1.car_guid in
  607. (
  608. select t.CAR_GUID from v_cylinder_all t where t.CYLINDERTYPE in(0,1,2,3,4)
  609. )
  610. and t1.car_guid in
  611. (
  612. select t.CAR_GUID from tb_guidfillinfo t where
  613. t.FILLTIME <![CDATA[ <= ]]> to_date(#{endDate},'yyyy-mm-dd')
  614. and
  615. t.FILLTIME <![CDATA[ >= ]]> to_date(#{startDate},'yyyy-mm-dd')
  616. )
  617. and
  618. t1.DISTRICTNO LIKE CONCAT(#{authCode},'%')
  619. </select>
  620. <select id="getTrendInUseLngCarLsit" parameterType="com.runzhixing.bean.ReportFormBean" resultMap="inUseCngCarList">
  621. <!-- select tt1.CAR_GUID,tt1.FILLTIME from V_CAR_ALL t1
  622. join
  623. (
  624. select t.CAR_GUID from v_cylinder_all t where t.CYLINDERTYPE =5 GROUP BY t.CAR_GUID
  625. )tt on tt.CAR_GUID=T1.CAR_GUID
  626. join
  627. (
  628. select t.CAR_GUID,t.FILLTIME from tb_guidfillinfo t where
  629. t.FILLTIME <![CDATA[ <= ]]> to_date(#{endDate},'yyyy-mm-dd')
  630. and
  631. t.FILLTIME <![CDATA[ >= ]]> to_date(#{startDate},'yyyy-mm-dd')
  632. GROUP BY t.CAR_GUID,t.FILLTIME
  633. )tt1 on tt1.CAR_GUID = T1.CAR_GUID
  634. where
  635. t1.DISTRICTNO LIKE CONCAT(#{authCode},'%')
  636. GROUP BY tt1.CAR_GUID,tt1.FILLTIME
  637. ORDER BY tt1.FILLTIME,tt1.CAR_GUID -->
  638. select count(*) as CAR_GUID from V_CAR_ALL t1
  639. where
  640. t1.car_guid in
  641. (
  642. select t.CAR_GUID from v_cylinder_all t where t.CYLINDERTYPE = 5
  643. )
  644. and t1.car_guid in
  645. (
  646. select t.CAR_GUID from tb_guidfillinfo t where
  647. t.FILLTIME <![CDATA[ <= ]]> to_date(#{endDate},'yyyy-mm-dd')
  648. and
  649. t.FILLTIME <![CDATA[ >= ]]> to_date(#{startDate},'yyyy-mm-dd')
  650. )
  651. and
  652. t1.DISTRICTNO LIKE CONCAT(#{authCode},'%')
  653. </select>
  654. <resultMap id="inUseCngCylinderLsit" type="com.runzhixing.bean.ReportFormBean">
  655. <result column="cylinder_Guid" property="cylinderGuid"/>
  656. <result column="FILLTIME" property="fillTime"/>
  657. </resultMap>
  658. <select id="getTrendInUseCngCylinderLsit" parameterType="com.runzhixing.bean.ReportFormBean" resultMap="inUseCngCylinderLsit">
  659. <!-- select t.cylinder_Guid,tt1.FILLTIME FROM V_CYLINDER_ALL t join
  660. V_CAR_ALL t1 on t1.CAR_GUID = t.CAR_GUID
  661. join
  662. (
  663. select t.CAR_GUID,t.FILLTIME from tb_guidfillinfo t where
  664. t.FILLTIME <![CDATA[ <= ]]> to_date(#{endDate},'yyyy-mm-dd')
  665. and
  666. t.FILLTIME <![CDATA[ >= ]]> to_date(#{startDate},'yyyy-mm-dd')
  667. GROUP BY t.CAR_GUID,t.FILLTIME
  668. ) tt1 on tt1.CAR_GUID = T1.CAR_GUID
  669. where t.CYLINDERTYPE in (0,1,2,3,4)
  670. and
  671. t1.DISTRICTNO LIKE CONCAT(#{authCode},'%')
  672. GROUP BY t.cylinder_Guid,tt1.FILLTIME
  673. ORDER BY t.cylinder_Guid,tt1.FILLTIME -->
  674. select sum(t1.installNum) as cylinder_Guid from V_CAR_ALL t1
  675. where
  676. t1.car_guid in
  677. (
  678. select t.CAR_GUID from v_cylinder_all t where t.CYLINDERTYPE in(0,1,2,3,4)
  679. )
  680. and t1.car_guid in
  681. (
  682. select t.CAR_GUID from tb_guidfillinfo t where
  683. t.FILLTIME <![CDATA[ <= ]]> to_date(#{endDate},'yyyy-mm-dd')
  684. and
  685. t.FILLTIME <![CDATA[ >= ]]> to_date(#{startDate},'yyyy-mm-dd')
  686. )
  687. and
  688. t1.DISTRICTNO LIKE CONCAT(#{authCode},'%')
  689. </select>
  690. <select id="getTrendInUseLngCylinderLsit" parameterType="com.runzhixing.bean.ReportFormBean" resultMap="inUseCngCylinderLsit">
  691. <!-- select t.cylinder_Guid,tt1.FILLTIME FROM V_CYLINDER_ALL t join
  692. V_CAR_ALL t1 on t1.CAR_GUID = t.CAR_GUID
  693. join
  694. (
  695. select t.CAR_GUID,t.FILLTIME from tb_guidfillinfo t where
  696. t.FILLTIME <![CDATA[ <= ]]> to_date(#{endDate},'yyyy-mm-dd')
  697. and
  698. t.FILLTIME <![CDATA[ >= ]]> to_date(#{startDate},'yyyy-mm-dd')
  699. GROUP BY t.CAR_GUID,t.FILLTIME
  700. ) tt1 on tt1.CAR_GUID = T1.CAR_GUID
  701. where t.CYLINDERTYPE =5
  702. and
  703. t1.DISTRICTNO LIKE CONCAT(#{authCode},'%')
  704. GROUP BY t.cylinder_Guid,tt1.FILLTIME
  705. ORDER BY t.cylinder_Guid,tt1.FILLTIME -->
  706. select sum(t1.installNum) as cylinder_Guid from V_CAR_ALL t1
  707. where
  708. t1.car_guid in
  709. (
  710. select t.CAR_GUID from v_cylinder_all t where t.CYLINDERTYPE = 5
  711. )
  712. and t1.car_guid in
  713. (
  714. select t.CAR_GUID from tb_guidfillinfo t where
  715. t.FILLTIME <![CDATA[ <= ]]> to_date(#{endDate},'yyyy-mm-dd')
  716. and
  717. t.FILLTIME <![CDATA[ >= ]]> to_date(#{startDate},'yyyy-mm-dd')
  718. )
  719. and
  720. t1.DISTRICTNO LIKE CONCAT(#{authCode},'%')
  721. </select>
  722. <resultMap id="gasStationNetworkInfoLsit" type="com.runzhixing.bean.ReportFormBean">
  723. <result column="stationname" property="stationName"/>
  724. <result column="connectDay" property="connectDay"/>
  725. </resultMap>
  726. <select id="getGasStationNetworkInfo" parameterType="com.runzhixing.bean.ReportFormBean" resultMap="gasStationNetworkInfoLsit">
  727. select stationname,
  728. (select count(STATIONNO) from (select t.STATIONNO from tb_CNGMACHINE_SUM t where t.SUMDATE <![CDATA[ <= ]]> to_date(#{endDate},'yyyy-mm-dd') and t.SUMDATE <![CDATA[ >= ]]> to_date(#{startDate},'yyyy-mm-dd') group by t.STATIONNO,t.SUMDATE) where STATIONNO=tt.STATIONNO) as connectDay
  729. from tb_cngstation tt
  730. where tt.STATIONNO like CONCAT(#{authCode},'%')
  731. order by connectDay desc ,stationname asc
  732. </select>
  733. <select id="getCheckedCylinderCount" parameterType="com.runzhixing.bean.ReportFormBean" resultType="Integer">
  734. select count(t.CYLINDER_GUID) from TB_CYLINDER t where
  735. t.CAR_GUID IN
  736. (
  737. select CAR_GUID from TB_CAR where DISTRICTNO like CONCAT(#{authCode},'%')
  738. )
  739. and
  740. t.NEXTCHECKDATE <![CDATA[ >= ]]> to_date(#{nowDate},'yyyy-mm-dd')
  741. </select>
  742. <select id="getNotCheckCylinderCount" parameterType="com.runzhixing.bean.ReportFormBean" resultType="Integer">
  743. select count(t.CYLINDER_GUID) from TB_CYLINDER t
  744. where t.NEXTCHECKDATE <![CDATA[ < ]]> to_date(#{endDate},'yyyy-mm-dd') and t.NEXTCHECKDATE <![CDATA[ >= ]]> to_date(#{startDate},'yyyy-mm-dd')
  745. and t.CAR_GUID IN
  746. (
  747. select CAR_GUID from TB_CAR where DISTRICTNO like CONCAT(#{authCode},'%')
  748. )
  749. AND
  750. t.CAR_GUID IN
  751. (
  752. select t1.CAR_GUID from tb_guidfillinfo t1 where
  753. t1.FILLTIME <![CDATA[ <= ]]> to_date(#{endDate},'yyyy-mm-dd')
  754. and
  755. t1.FILLTIME <![CDATA[ >= ]]> to_date(#{startDate},'yyyy-mm-dd')
  756. )
  757. </select>
  758. <select id="getAuthRegionName2" parameterType="String" resultType="String">
  759. select t.provincename from td_province t where t.provinceno=#{auth}
  760. </select>
  761. <select id="getAuthRegionName4" parameterType="String" resultType="String">
  762. select CONCAT(t.provincename,t1.CITYNAME) from td_province t join td_city t1 on t1.provinceno = t.provinceno
  763. where t1.provinceno=substr(#{auth},1,2) and t1.cityno = substr(#{auth},3,2)
  764. </select>
  765. <select id="getAuthRegionName6" parameterType="String" resultType="String">
  766. select concat(CONCAT(t.provincename,t1.CITYNAME),t2.countyname) from td_province t join td_city t1 on t1.provinceno = t.provinceno
  767. join TD_COUNTY t2 on t2.provinceno=t1.provinceno and t2.cityno=t1.cityno
  768. where t2.provinceno= substr(#{auth},1,2) and t2.cityno = substr(#{auth},3,2) and t2.countyno = substr(#{auth},5,2)
  769. </select>
  770. <delete id="remove_img" parameterType="com.runzhixing.bean.CylinderImg">
  771. <!-- delete from TB_CYLINDER_IMG where FILENAME = #{FILENAME} and OTHEROPERATOR=#{userGuid} -->
  772. delete from TB_CYLINDER_IMG where FILENAME = #{FILENAME} and OTHEROPERATOR=#{userGuid} and CYLINDER_GUID in (select CYLINDER_GUID from TB_CYLINDER where OPERSTATE in (0,6) )
  773. </delete>
  774. <update id="updateCar_userGuid" parameterType="com.runzhixing.bean.BindCar">
  775. update TB_CAR set USER_GUID=#{userGuid} where car_guid = #{carGuid}
  776. </update>
  777. <resultMap id="apiList" type="com.runzhixing.bean.TPAPI">
  778. <result column="DISTNO" property="DISTNO"/>
  779. <result column="APIKEY" property="APIKEY"/>
  780. </resultMap>
  781. <select id="getAPIStationNo" parameterType="com.runzhixing.bean.TPAPI" resultMap="apiList">
  782. select t.DISTNO,t.APIKEY from TP_API t where t.USERNAME=#{USERNAME} and t.PWD=#{PWD} and t.STATE=#{STATE}
  783. </select>
  784. </mapper>