TXinyiIndustryMapper.xml 28 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595
  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.slibra.business.mapper.TXinyiIndustryMapper">
  6. <resultMap type="TXinyiIndustry" id="TXinyiIndustryResult">
  7. <result property="ID" column="ID" />
  8. <result property="testDate" column="TEST_DATE" />
  9. <result property="testHour" column="TEST_HOUR" />
  10. <result property="testTime" column="TEST_TIME" />
  11. <result property="jsCod" column="JS_COD" />
  12. <result property="jsPh" column="JS_PH" />
  13. <result property="jsSs" column="JS_SS" />
  14. <result property="jsTp" column="JS_TP" />
  15. <result property="jsTn" column="JS_TN" />
  16. <result property="jsNh3" column="JS_NH3" />
  17. <result property="jsSwPh" column="JS_SW_PH" />
  18. <result property="jsBfyw" column="JS_BFYW" />
  19. <result property="csSlqc" column="CS_SLQC" />
  20. <result property="csCod" column="CS_COD" />
  21. <result property="csPh" column="CS_PH" />
  22. <result property="csSs" column="CS_SS" />
  23. <result property="csTn" column="CS_TN" />
  24. <result property="csTp" column="CS_TP" />
  25. <result property="csNh3" column="CS_NH3" />
  26. <result property="oneHyzdDo" column="ONE_HYZD_DO" />
  27. <result property="oneHymdDo" column="ONE_HYMD_DO" />
  28. <result property="twoHyzdDo" column="TWO_HYZD_DO" />
  29. <result property="twoHymdDo" column="TWO_HYMD_DO" />
  30. <result property="oneMlss" column="ONE_MLSS" />
  31. <result property="twoMlss" column="TWO_MLSS" />
  32. <result property="jsTds" column="JS_TDS" />
  33. <result property="jsSlq" column="JS_SLQ" />
  34. <result property="nHlbOneGp" column="N_HLB_ONE_GP" />
  35. <result property="nHlbTwoGp" column="N_HLB_TWO_GP" />
  36. <result property="nHlbThreeGp" column="N_HLB_THREE_GP" />
  37. <result property="nHlbFourGp" column="N_HLB_FOUR_GP" />
  38. <result property="nhlBFiveGp" column="NHL_B_FIVE_GP" />
  39. <result property="nHlbSixGp" column="N_HLB_SIX_GP" />
  40. <result property="wHlbOneGp" column="W_HLB_ONE_GP" />
  41. <result property="wHlbTwoGp" column="W_HLB_TWO_GP" />
  42. <result property="wHlbThreeGp" column="W_HLB_THREE_GP" />
  43. <result property="wHlbFourGp" column="W_HLB_FOUR_GP" />
  44. <result property="wHlbFiveGp" column="W_HLB_FIVE_GP" />
  45. <result property="fjOne" column="FJ_ONE" />
  46. <result property="fjTwo" column="FJ_TWO" />
  47. <result property="fjThree" column="FJ_THREE" />
  48. <result property="fjFour" column="FJ_FOUR" />
  49. <result property="fjFive" column="FJ_FIVE" />
  50. <result property="fjSix" column="FJ_SIX" />
  51. <result property="kqllOne" column="KQLL_ONE" />
  52. <result property="kqllTwo" column="KQLL_TWO" />
  53. <result property="kqllThree" column="KQLL_THREE" />
  54. <result property="kqllFour" column="KQLL_FOUR" />
  55. <result property="kqllFive" column="KQLL_FIVE" />
  56. <result property="kqllSix" column="KQLL_SIX" />
  57. <result property="SJTYJLY" column="SJTYJLY" />
  58. <result property="CLJYSSLL" column="CLJYSSLL" />
  59. <result property="hycRjyAll" column="HYC_RJY_ALL" />
  60. <result property="hycRjyZdAll" column="HYC_RJY_ZD_ALL" />
  61. <result property="hycWnndAll" column="HYC_WNND_ALL" />
  62. <result property="CLP04YCZ" column="CL_P04_YCZ" />
  63. <result property="createdTime" column="CREATED_TIME" />
  64. </resultMap>
  65. <sql id="selectTXinyiIndustryVo">
  66. select ID, TEST_DATE, TEST_HOUR, TEST_TIME, JS_COD, JS_PH, JS_SS, JS_TP, JS_TN, JS_NH3, JS_SW_PH, JS_BFYW, CS_SLQC, CS_COD, CS_PH, CS_SS, CS_TN, CS_TP, CS_NH3, ONE_HYZD_DO, ONE_HYMD_DO, TWO_HYZD_DO, TWO_HYMD_DO, ONE_MLSS, TWO_MLSS, JS_TDS, JS_SLQ, N_HLB_ONE_GP, N_HLB_TWO_GP, N_HLB_THREE_GP, N_HLB_FOUR_GP, NHL_B_FIVE_GP, N_HLB_SIX_GP, W_HLB_ONE_GP, W_HLB_TWO_GP, W_HLB_THREE_GP, W_HLB_FOUR_GP, W_HLB_FIVE_GP, FJ_ONE, FJ_TWO, FJ_THREE, FJ_FOUR, FJ_FIVE, FJ_SIX, KQLL_ONE, KQLL_TWO, KQLL_THREE, KQLL_FOUR, KQLL_FIVE, KQLL_SIX, SJTYJLY, CLJYSSLL, HYC_RJY_ALL, HYC_RJY_ZD_ALL, HYC_WNND_ALL, CL_P04_YCZ, CREATED_TIME from t_xinyi_industry
  67. </sql>
  68. <select id="selectTXinyiIndustryByID" parameterType="Long" resultMap="TXinyiIndustryResult">
  69. <include refid="selectTXinyiIndustryVo"/>
  70. where ID = #{ID}
  71. </select>
  72. <insert id="insertTXinyiIndustry" parameterType="TXinyiIndustry" useGeneratedKeys="true" keyProperty="ID">
  73. insert into t_xinyi_industry
  74. <trim prefix="(" suffix=")" suffixOverrides=",">
  75. <if test="testDate != null">TEST_DATE,</if>
  76. <if test="testHour != null">TEST_HOUR,</if>
  77. <if test="testTime != null">TEST_TIME,</if>
  78. <if test="jsCod != null">JS_COD,</if>
  79. <if test="jsPh != null">JS_PH,</if>
  80. <if test="jsSs != null">JS_SS,</if>
  81. <if test="jsTp != null">JS_TP,</if>
  82. <if test="jsTn != null">JS_TN,</if>
  83. <if test="jsNh3 != null">JS_NH3,</if>
  84. <if test="jsSwPh != null">JS_SW_PH,</if>
  85. <if test="jsBfyw != null">JS_BFYW,</if>
  86. <if test="csSlqc != null">CS_SLQC,</if>
  87. <if test="csCod != null">CS_COD,</if>
  88. <if test="csPh != null">CS_PH,</if>
  89. <if test="csSs != null">CS_SS,</if>
  90. <if test="csTn != null">CS_TN,</if>
  91. <if test="csTp != null">CS_TP,</if>
  92. <if test="csNh3 != null">CS_NH3,</if>
  93. <if test="oneHyzdDo != null">ONE_HYZD_DO,</if>
  94. <if test="oneHymdDo != null">ONE_HYMD_DO,</if>
  95. <if test="twoHyzdDo != null">TWO_HYZD_DO,</if>
  96. <if test="twoHymdDo != null">TWO_HYMD_DO,</if>
  97. <if test="oneMlss != null">ONE_MLSS,</if>
  98. <if test="twoMlss != null">TWO_MLSS,</if>
  99. <if test="jsTds != null">JS_TDS,</if>
  100. <if test="jsSlq != null">JS_SLQ,</if>
  101. <if test="nHlbOneGp != null">N_HLB_ONE_GP,</if>
  102. <if test="nHlbTwoGp != null">N_HLB_TWO_GP,</if>
  103. <if test="nHlbThreeGp != null">N_HLB_THREE_GP,</if>
  104. <if test="nHlbFourGp != null">N_HLB_FOUR_GP,</if>
  105. <if test="nhlBFiveGp != null">NHL_B_FIVE_GP,</if>
  106. <if test="nHlbSixGp != null">N_HLB_SIX_GP,</if>
  107. <if test="wHlbOneGp != null">W_HLB_ONE_GP,</if>
  108. <if test="wHlbTwoGp != null">W_HLB_TWO_GP,</if>
  109. <if test="wHlbThreeGp != null">W_HLB_THREE_GP,</if>
  110. <if test="wHlbFourGp != null">W_HLB_FOUR_GP,</if>
  111. <if test="wHlbFiveGp != null">W_HLB_FIVE_GP,</if>
  112. <if test="fjOne != null">FJ_ONE,</if>
  113. <if test="fjTwo != null">FJ_TWO,</if>
  114. <if test="fjThree != null">FJ_THREE,</if>
  115. <if test="fjFour != null">FJ_FOUR,</if>
  116. <if test="fjFive != null">FJ_FIVE,</if>
  117. <if test="fjSix != null">FJ_SIX,</if>
  118. <if test="kqllOne != null">KQLL_ONE,</if>
  119. <if test="kqllTwo != null">KQLL_TWO,</if>
  120. <if test="kqllThree != null">KQLL_THREE,</if>
  121. <if test="kqllFour != null">KQLL_FOUR,</if>
  122. <if test="kqllFive != null">KQLL_FIVE,</if>
  123. <if test="kqllSix != null">KQLL_SIX,</if>
  124. <if test="SJTYJLY != null">SJTYJLY,</if>
  125. <if test="CLJYSSLL != null">CLJYSSLL,</if>
  126. <if test="hycRjyAll != null">HYC_RJY_ALL,</if>
  127. <if test="hycRjyZdAll != null">HYC_RJY_ZD_ALL,</if>
  128. <if test="hycWnndAll != null">HYC_WNND_ALL,</if>
  129. <if test="CLP04YCZ != null">CL_P04_YCZ,</if>
  130. <if test="createdTime != null">CREATED_TIME,</if>
  131. </trim>
  132. <trim prefix="values (" suffix=")" suffixOverrides=",">
  133. <if test="testDate != null">#{testDate},</if>
  134. <if test="testHour != null">#{testHour},</if>
  135. <if test="testTime != null">#{testTime},</if>
  136. <if test="jsCod != null">#{jsCod},</if>
  137. <if test="jsPh != null">#{jsPh},</if>
  138. <if test="jsSs != null">#{jsSs},</if>
  139. <if test="jsTp != null">#{jsTp},</if>
  140. <if test="jsTn != null">#{jsTn},</if>
  141. <if test="jsNh3 != null">#{jsNh3},</if>
  142. <if test="jsSwPh != null">#{jsSwPh},</if>
  143. <if test="jsBfyw != null">#{jsBfyw},</if>
  144. <if test="csSlqc != null">#{csSlqc},</if>
  145. <if test="csCod != null">#{csCod},</if>
  146. <if test="csPh != null">#{csPh},</if>
  147. <if test="csSs != null">#{csSs},</if>
  148. <if test="csTn != null">#{csTn},</if>
  149. <if test="csTp != null">#{csTp},</if>
  150. <if test="csNh3 != null">#{csNh3},</if>
  151. <if test="oneHyzdDo != null">#{oneHyzdDo},</if>
  152. <if test="oneHymdDo != null">#{oneHymdDo},</if>
  153. <if test="twoHyzdDo != null">#{twoHyzdDo},</if>
  154. <if test="twoHymdDo != null">#{twoHymdDo},</if>
  155. <if test="oneMlss != null">#{oneMlss},</if>
  156. <if test="twoMlss != null">#{twoMlss},</if>
  157. <if test="jsTds != null">#{jsTds},</if>
  158. <if test="jsSlq != null">#{jsSlq},</if>
  159. <if test="nHlbOneGp != null">#{nHlbOneGp},</if>
  160. <if test="nHlbTwoGp != null">#{nHlbTwoGp},</if>
  161. <if test="nHlbThreeGp != null">#{nHlbThreeGp},</if>
  162. <if test="nHlbFourGp != null">#{nHlbFourGp},</if>
  163. <if test="nhlBFiveGp != null">#{nhlBFiveGp},</if>
  164. <if test="nHlbSixGp != null">#{nHlbSixGp},</if>
  165. <if test="wHlbOneGp != null">#{wHlbOneGp},</if>
  166. <if test="wHlbTwoGp != null">#{wHlbTwoGp},</if>
  167. <if test="wHlbThreeGp != null">#{wHlbThreeGp},</if>
  168. <if test="wHlbFourGp != null">#{wHlbFourGp},</if>
  169. <if test="wHlbFiveGp != null">#{wHlbFiveGp},</if>
  170. <if test="fjOne != null">#{fjOne},</if>
  171. <if test="fjTwo != null">#{fjTwo},</if>
  172. <if test="fjThree != null">#{fjThree},</if>
  173. <if test="fjFour != null">#{fjFour},</if>
  174. <if test="fjFive != null">#{fjFive},</if>
  175. <if test="fjSix != null">#{fjSix},</if>
  176. <if test="kqllOne != null">#{kqllOne},</if>
  177. <if test="kqllTwo != null">#{kqllTwo},</if>
  178. <if test="kqllThree != null">#{kqllThree},</if>
  179. <if test="kqllFour != null">#{kqllFour},</if>
  180. <if test="kqllFive != null">#{kqllFive},</if>
  181. <if test="kqllSix != null">#{kqllSix},</if>
  182. <if test="SJTYJLY != null">#{SJTYJLY},</if>
  183. <if test="CLJYSSLL != null">#{CLJYSSLL},</if>
  184. <if test="hycRjyAll != null">#{hycRjyAll},</if>
  185. <if test="hycRjyZdAll != null">#{hycRjyZdAll},</if>
  186. <if test="hycWnndAll != null">#{hycWnndAll},</if>
  187. <if test="CLP04YCZ != null">#{CLP04YCZ},</if>
  188. <if test="createdTime != null">#{createdTime},</if>
  189. </trim>
  190. </insert>
  191. <update id="updateTXinyiIndustry" parameterType="TXinyiIndustry">
  192. update t_xinyi_industry
  193. <trim prefix="SET" suffixOverrides=",">
  194. <if test="testDate != null">TEST_DATE = #{testDate},</if>
  195. <if test="testHour != null">TEST_HOUR = #{testHour},</if>
  196. <if test="testTime != null">TEST_TIME = #{testTime},</if>
  197. <if test="jsCod != null">JS_COD = #{jsCod},</if>
  198. <if test="jsPh != null">JS_PH = #{jsPh},</if>
  199. <if test="jsSs != null">JS_SS = #{jsSs},</if>
  200. <if test="jsTp != null">JS_TP = #{jsTp},</if>
  201. <if test="jsTn != null">JS_TN = #{jsTn},</if>
  202. <if test="jsNh3 != null">JS_NH3 = #{jsNh3},</if>
  203. <if test="jsSwPh != null">JS_SW_PH = #{jsSwPh},</if>
  204. <if test="jsBfyw != null">JS_BFYW = #{jsBfyw},</if>
  205. <if test="csSlqc != null">CS_SLQC = #{csSlqc},</if>
  206. <if test="csCod != null">CS_COD = #{csCod},</if>
  207. <if test="csPh != null">CS_PH = #{csPh},</if>
  208. <if test="csSs != null">CS_SS = #{csSs},</if>
  209. <if test="csTn != null">CS_TN = #{csTn},</if>
  210. <if test="csTp != null">CS_TP = #{csTp},</if>
  211. <if test="csNh3 != null">CS_NH3 = #{csNh3},</if>
  212. <if test="oneHyzdDo != null">ONE_HYZD_DO = #{oneHyzdDo},</if>
  213. <if test="oneHymdDo != null">ONE_HYMD_DO = #{oneHymdDo},</if>
  214. <if test="twoHyzdDo != null">TWO_HYZD_DO = #{twoHyzdDo},</if>
  215. <if test="twoHymdDo != null">TWO_HYMD_DO = #{twoHymdDo},</if>
  216. <if test="oneMlss != null">ONE_MLSS = #{oneMlss},</if>
  217. <if test="twoMlss != null">TWO_MLSS = #{twoMlss},</if>
  218. <if test="jsTds != null">JS_TDS = #{jsTds},</if>
  219. <if test="jsSlq != null">JS_SLQ = #{jsSlq},</if>
  220. <if test="nHlbOneGp != null">N_HLB_ONE_GP = #{nHlbOneGp},</if>
  221. <if test="nHlbTwoGp != null">N_HLB_TWO_GP = #{nHlbTwoGp},</if>
  222. <if test="nHlbThreeGp != null">N_HLB_THREE_GP = #{nHlbThreeGp},</if>
  223. <if test="nHlbFourGp != null">N_HLB_FOUR_GP = #{nHlbFourGp},</if>
  224. <if test="nhlBFiveGp != null">NHL_B_FIVE_GP = #{nhlBFiveGp},</if>
  225. <if test="nHlbSixGp != null">N_HLB_SIX_GP = #{nHlbSixGp},</if>
  226. <if test="wHlbOneGp != null">W_HLB_ONE_GP = #{wHlbOneGp},</if>
  227. <if test="wHlbTwoGp != null">W_HLB_TWO_GP = #{wHlbTwoGp},</if>
  228. <if test="wHlbThreeGp != null">W_HLB_THREE_GP = #{wHlbThreeGp},</if>
  229. <if test="wHlbFourGp != null">W_HLB_FOUR_GP = #{wHlbFourGp},</if>
  230. <if test="wHlbFiveGp != null">W_HLB_FIVE_GP = #{wHlbFiveGp},</if>
  231. <if test="fjOne != null">FJ_ONE = #{fjOne},</if>
  232. <if test="fjTwo != null">FJ_TWO = #{fjTwo},</if>
  233. <if test="fjThree != null">FJ_THREE = #{fjThree},</if>
  234. <if test="fjFour != null">FJ_FOUR = #{fjFour},</if>
  235. <if test="fjFive != null">FJ_FIVE = #{fjFive},</if>
  236. <if test="fjSix != null">FJ_SIX = #{fjSix},</if>
  237. <if test="kqllOne != null">KQLL_ONE = #{kqllOne},</if>
  238. <if test="kqllTwo != null">KQLL_TWO = #{kqllTwo},</if>
  239. <if test="kqllThree != null">KQLL_THREE = #{kqllThree},</if>
  240. <if test="kqllFour != null">KQLL_FOUR = #{kqllFour},</if>
  241. <if test="kqllFive != null">KQLL_FIVE = #{kqllFive},</if>
  242. <if test="kqllSix != null">KQLL_SIX = #{kqllSix},</if>
  243. <if test="SJTYJLY != null">SJTYJLY = #{SJTYJLY},</if>
  244. <if test="CLJYSSLL != null">CLJYSSLL = #{CLJYSSLL},</if>
  245. <if test="hycRjyAll != null">HYC_RJY_ALL = #{hycRjyAll},</if>
  246. <if test="hycRjyZdAll != null">HYC_RJY_ZD_ALL = #{hycRjyZdAll},</if>
  247. <if test="hycWnndAll != null">HYC_WNND_ALL = #{hycWnndAll},</if>
  248. <if test="CLP04YCZ != null">CL_P04_YCZ = #{CLP04YCZ},</if>
  249. <if test="createdTime != null">CREATED_TIME = #{createdTime},</if>
  250. </trim>
  251. where ID = #{ID}
  252. </update>
  253. <delete id="deleteTXinyiIndustryByID" parameterType="Long">
  254. delete from t_xinyi_industry where ID = #{ID}
  255. </delete>
  256. <delete id="deleteTXinyiIndustryByIDs" parameterType="String">
  257. delete from t_xinyi_industry where ID in
  258. <foreach item="ID" collection="array" open="(" separator="," close=")">
  259. #{ID}
  260. </foreach>
  261. </delete>
  262. <!-- 下面是新增的 -->
  263. <select id="getUniqueTXinyiIndustry" resultMap="TXinyiIndustryResult">
  264. <include refid="selectTXinyiIndustryVo"/>
  265. where TEST_TIME = #{testTime}
  266. </select>
  267. <update id="updateTXinyiIndustryCLByBetweenTime" >
  268. update t_xinyi_industry set CLJYSSLL = #{cljyssll}
  269. where TEST_TIME between #{beginTime} and #{endTime}
  270. </update>
  271. <update id="updateTXinyiIndustrySJByBetweenTime" >
  272. update t_xinyi_industry set SJTYJLY = #{sjtyjly}
  273. where TEST_TIME between #{beginTime} and #{endTime}
  274. </update>
  275. <select id="getLastHour" resultType="string">
  276. SELECT TEST_HOUR FROM t_xinyi_industry ORDER BY id DESC LIMIT 1
  277. </select>
  278. <select id="getLastMinute" resultType="string">
  279. SELECT TEST_TIME FROM t_xinyi_industry ORDER BY id DESC LIMIT 1
  280. </select>
  281. <select id="selectLast10RecordsForDecision" resultType="hashmap">
  282. SELECT
  283. a.ID ID,
  284. a.TEST_DATE TEST_DATE,
  285. a.TEST_HOUR TEST_HOUR,
  286. a.JS_COD COD_in,
  287. b.JSCOD_SJZ COD_in_name,
  288. a.CS_COD COD_off,
  289. b.CSCOD_BZZ COD_off_name,
  290. b.CSCOD_GKZ COD_off_con,
  291. a.JS_TP TP_in,
  292. b.JSZL_SJZ TP_in_name,
  293. a.CS_TP TP_off,
  294. b.CSZL_BZZ TP_off_name,
  295. b.CSZL_GKZ TP_off_con,
  296. a.JS_TN TN_in,
  297. b.JSZD_SJZ TN_in_name,
  298. a.CS_TN TN_off,
  299. b.CSZZ_BZZ TN_off_name,
  300. b.CSZZ_GKZ TN_off_con,
  301. a.JS_NH3 andan_in,
  302. b.JSAD_SJZ andan_in_name,
  303. a.CS_NH3 andan_off,
  304. b.CSAD_BZZ andan_off_name,
  305. b.CSAD_GKZ andan_off_con,
  306. a.JS_SS SS_in,
  307. b.JSSS_SJZ SS_in_name,
  308. a.CS_SS SS_off,
  309. b.CSSS_BZZ SS_off_name,
  310. b.CSSS_GKZ SS_off_con,
  311. a.JS_TDS TDS_in,
  312. b.JDTDS_GKZ TDS_in_name,
  313. c.JS_SW T,
  314. a.JS_PH pH,
  315. a.JS_SLQ Q_in,
  316. b.JSSL_SJZ Q_in_name,
  317. '' continuity,
  318. '' check_rise,
  319. '' time_tips,
  320. '' cs_continuity,
  321. c.WNTJZS_ALL SVI,
  322. b.WNTJZS_GKZ SVI_con,
  323. c.WNCJB_ALL SV,
  324. b.WNCJB_GKZ SV_con,
  325. c.HFXWNND_ALL MLVSS,
  326. a.HYC_WNND_ALL MLSS,
  327. '' MLVSS_wentai,
  328. '' MLSS_wentai,
  329. c.YYC_RJY_ALL DO_ana,
  330. a.HYC_RJY_ALL DO_O,
  331. c.QYC_RJY_ALL DO_que,
  332. '' DO_que_wentai,
  333. '' DO_ana_wentai,
  334. '' DO_O_wentai,
  335. c.JS_BOD5 BOD_in,
  336. c.JS_BOD5/a.JS_TP c,
  337. c.JS_BOD5/a.JS_TN b,
  338. '' BTP_wending,
  339. '' JS_TN_wentai,
  340. a.CL_P04_YCZ CL_P04_YCZ,
  341. (a.JS_TP - a.CL_P04_YCZ)/a.JS_TP TP_LV,
  342. '' TP_LV_continuity
  343. FROM
  344. t_xinyi_industry a
  345. LEFT JOIN t_xinyi_norm_config b on 1 = 1
  346. LEFT JOIN t_xinyi_daily c on a.TEST_DATE = c.TEST_DATE
  347. WHERE 1 = 1
  348. ORDER BY a.ID DESC
  349. LIMIT 10
  350. </select>
  351. <!-- todo 以后不用sql拼接实验室数据 处理历史数据并新增字段,直接获取 另外把关联查询改成在java代码中处理
  352. 不用再拼接了 SqlServer同步过来的机器人实验室数据已经有了新的字段
  353. -->
  354. <select id="selectLast10RecordsForDecisionOnlyIndustry" resultType="com.slibra.common.core.domain.DecisionReq">
  355. SELECT
  356. a.ID ID,
  357. a.TEST_DATE testDate,
  358. a.TEST_HOUR testHour,
  359. a.JS_COD codIn,
  360. b.JSCOD_SJZ codInName,
  361. a.CS_COD codOff,
  362. b.CSCOD_BZZ codOffName,
  363. b.CSCOD_GKZ codOffCon,
  364. a.JS_TP tpIn,
  365. b.JSZL_SJZ tpInName,
  366. a.CS_TP tpOff,
  367. b.CSZL_BZZ tpOffName,
  368. b.CSZL_GKZ tpOffCon,
  369. a.JS_TN tnIn,
  370. b.JSZD_SJZ tnInName,
  371. a.CS_TN tnOff,
  372. b.CSZZ_BZZ tnOffName,
  373. b.CSZZ_GKZ tnOffCon,
  374. a.JS_NH3 addanIn,
  375. b.JSAD_SJZ addanInName,
  376. a.CS_NH3 andanOff,
  377. b.CSAD_BZZ andanOffName,
  378. b.CSAD_GKZ andanOffCon,
  379. a.JS_SS ssIn,
  380. b.JSSS_SJZ ssInName,
  381. a.CS_SS ssOff,
  382. b.CSSS_BZZ ssOffName,
  383. b.CSSS_GKZ ssOffCon,
  384. a.JS_TDS tdsIn,
  385. b.JDTDS_GKZ tdsInName,
  386. a.JS_PH pH,
  387. a.JS_SLQ qIn,
  388. b.JSSL_SJZ qInName,
  389. b.WNTJZS_GKZ sviCon,
  390. b.WNCJB_GKZ svCon,
  391. a.CL_P04_YCZ clP04YCZ,
  392. ( a.JS_TP - a.CL_P04_YCZ )/ a.JS_TP tpLv,
  393. a.SJTYJLY tyjyl,
  394. a.CLJYSSLL cltjl,
  395. c.HYCXSY_ALL hycxsyAll,
  396. c.QYAN_ALL qyanAll,
  397. c.QYCKXSY_ALL qyckxsyAll,
  398. c.TP_RCC_JQR eccZl,
  399. c.HYZLSY_ALL hyzlsyAll
  400. FROM
  401. t_xinyi_industry a
  402. LEFT JOIN t_xinyi_norm_config b ON 1 = 1
  403. LEFT JOIN (
  404. SELECT
  405. TEST_HOUR,
  406. any_value ( HYCXSY_ALL ) HYCXSY_ALL,
  407. any_value ( QYAN_ALL ) QYAN_ALL,
  408. any_value ( QYCKXSY_ALL ) QYCKXSY_ALL,
  409. any_value ( TP_RCC_JQR ) TP_RCC_JQR,
  410. any_value ( HYZLSY_ALL ) HYZLSY_ALL
  411. FROM
  412. t_xinyi_robot
  413. GROUP BY
  414. TEST_HOUR
  415. ) c ON a.TEST_HOUR = c.TEST_HOUR
  416. WHERE
  417. 1 = 1
  418. ORDER BY
  419. a.ID DESC
  420. LIMIT 0,10
  421. </select>
  422. <select id="selectTXinyiIndustryNewest" resultMap="TXinyiIndustryResult">
  423. <include refid="selectTXinyiIndustryVo"/>
  424. order by id desc limit 1
  425. </select>
  426. <select id="selectNIndustry" resultMap="TXinyiIndustryResult">
  427. <include refid="selectTXinyiIndustryVo"/>
  428. order by id desc limit #{size}
  429. </select>
  430. <select id="selectIndustryAvgByDate" resultMap="TXinyiIndustryResult">
  431. SELECT
  432. AVG(JS_SLQ) JS_SLQ,
  433. AVG(JS_COD) JS_COD,
  434. AVG(JS_TN) JS_TN,
  435. AVG(JS_TP) JS_TP,
  436. AVG(JS_NH3) JS_NH3,
  437. AVG(JS_SS) JS_SS,
  438. AVG(CS_SLQC) CS_SLQC,
  439. AVG(CS_COD) CS_COD,
  440. AVG(CS_TN) CS_TN,
  441. AVG(CS_TP) CS_TP,
  442. AVG(CS_NH3) CS_NH3,
  443. AVG(CS_SS) CS_SS
  444. FROM
  445. t_xinyi_industry
  446. WHERE
  447. TEST_DATE = #{date}
  448. </select>
  449. <select id="getCount" resultType="java.lang.Integer">
  450. SELECT COUNT(*) FROM t_xinyi_industry
  451. </select>
  452. <select id="selectTXinyiIndustryListByPage" resultMap="TXinyiIndustryResult">
  453. <include refid="selectTXinyiIndustryVo"/>
  454. ORDER BY id LIMIT #{start}, #{end}
  455. </select>
  456. <select id="selectJSLByDate" resultType="com.slibra.business.res.ChartBasic">
  457. SELECT
  458. TEST_HOUR time,
  459. JS_SLQ val
  460. FROM
  461. t_xinyi_industry
  462. WHERE
  463. TEST_DATE BETWEEN #{start} AND #{end}
  464. ORDER BY
  465. ID ASC
  466. </select>
  467. <select id="selectJsCodByDate" resultType="com.slibra.business.res.ChartBasic">
  468. SELECT
  469. TEST_HOUR time,
  470. JS_COD val
  471. FROM
  472. t_xinyi_industry
  473. WHERE
  474. TEST_DATE BETWEEN #{start} AND #{end}
  475. ORDER BY
  476. ID ASC
  477. </select>
  478. <select id="selectJsTnByDate" resultType="com.slibra.business.res.ChartBasic">
  479. SELECT
  480. TEST_HOUR time,
  481. JS_TN val
  482. FROM
  483. t_xinyi_industry
  484. WHERE
  485. TEST_DATE BETWEEN #{start} AND #{end}
  486. ORDER BY
  487. ID ASC
  488. </select>
  489. <select id="selectTytzjlByDate" resultType="com.slibra.business.res.ChartBasic">
  490. SELECT
  491. TEST_HOUR time,
  492. SJTYJLY val
  493. FROM
  494. t_xinyi_industry
  495. WHERE
  496. TEST_DATE BETWEEN #{start} AND #{end}
  497. ORDER BY
  498. ID ASC
  499. </select>
  500. <select id="selectTXinyiIndustryList" parameterType="TXinyiIndustry" resultMap="TXinyiIndustryResult">
  501. <include refid="selectTXinyiIndustryVo"/>
  502. <where>
  503. <if test="testDate != null and testDate != ''"> and TEST_DATE = #{testDate}</if>
  504. <if test="testHour != null and testHour != ''"> and TEST_HOUR = #{testHour}</if>
  505. <if test="testTime != null and testTime != ''"> and TEST_TIME = #{testTime}</if>
  506. <if test="jsCod != null "> and JS_COD = #{jsCod}</if>
  507. <if test="jsPh != null "> and JS_PH = #{jsPh}</if>
  508. <if test="jsSs != null "> and JS_SS = #{jsSs}</if>
  509. <if test="jsTp != null "> and JS_TP = #{jsTp}</if>
  510. <if test="jsTn != null "> and JS_TN = #{jsTn}</if>
  511. <if test="jsNh3 != null "> and JS_NH3 = #{jsNh3}</if>
  512. <if test="jsSwPh != null "> and JS_SW_PH = #{jsSwPh}</if>
  513. <if test="jsBfyw != null "> and JS_BFYW = #{jsBfyw}</if>
  514. <if test="csSlqc != null "> and CS_SLQC = #{csSlqc}</if>
  515. <if test="csCod != null "> and CS_COD = #{csCod}</if>
  516. <if test="csPh != null "> and CS_PH = #{csPh}</if>
  517. <if test="csSs != null "> and CS_SS = #{csSs}</if>
  518. <if test="csTn != null "> and CS_TN = #{csTn}</if>
  519. <if test="csTp != null "> and CS_TP = #{csTp}</if>
  520. <if test="csNh3 != null "> and CS_NH3 = #{csNh3}</if>
  521. <if test="oneHyzdDo != null "> and ONE_HYZD_DO = #{oneHyzdDo}</if>
  522. <if test="oneHymdDo != null "> and ONE_HYMD_DO = #{oneHymdDo}</if>
  523. <if test="twoHyzdDo != null "> and TWO_HYZD_DO = #{twoHyzdDo}</if>
  524. <if test="twoHymdDo != null "> and TWO_HYMD_DO = #{twoHymdDo}</if>
  525. <if test="oneMlss != null "> and ONE_MLSS = #{oneMlss}</if>
  526. <if test="twoMlss != null "> and TWO_MLSS = #{twoMlss}</if>
  527. <if test="jsTds != null "> and JS_TDS = #{jsTds}</if>
  528. <if test="jsSlq != null "> and JS_SLQ = #{jsSlq}</if>
  529. <if test="nHlbOneGp != null "> and N_HLB_ONE_GP = #{nHlbOneGp}</if>
  530. <if test="nHlbTwoGp != null "> and N_HLB_TWO_GP = #{nHlbTwoGp}</if>
  531. <if test="nHlbThreeGp != null "> and N_HLB_THREE_GP = #{nHlbThreeGp}</if>
  532. <if test="nHlbFourGp != null "> and N_HLB_FOUR_GP = #{nHlbFourGp}</if>
  533. <if test="nhlBFiveGp != null "> and NHL_B_FIVE_GP = #{nhlBFiveGp}</if>
  534. <if test="nHlbSixGp != null "> and N_HLB_SIX_GP = #{nHlbSixGp}</if>
  535. <if test="wHlbOneGp != null "> and W_HLB_ONE_GP = #{wHlbOneGp}</if>
  536. <if test="wHlbTwoGp != null "> and W_HLB_TWO_GP = #{wHlbTwoGp}</if>
  537. <if test="wHlbThreeGp != null "> and W_HLB_THREE_GP = #{wHlbThreeGp}</if>
  538. <if test="wHlbFourGp != null "> and W_HLB_FOUR_GP = #{wHlbFourGp}</if>
  539. <if test="wHlbFiveGp != null "> and W_HLB_FIVE_GP = #{wHlbFiveGp}</if>
  540. <if test="fjOne != null "> and FJ_ONE = #{fjOne}</if>
  541. <if test="fjTwo != null "> and FJ_TWO = #{fjTwo}</if>
  542. <if test="fjThree != null "> and FJ_THREE = #{fjThree}</if>
  543. <if test="fjFour != null "> and FJ_FOUR = #{fjFour}</if>
  544. <if test="fjFive != null "> and FJ_FIVE = #{fjFive}</if>
  545. <if test="fjSix != null "> and FJ_SIX = #{fjSix}</if>
  546. <if test="kqllOne != null "> and KQLL_ONE = #{kqllOne}</if>
  547. <if test="kqllTwo != null "> and KQLL_TWO = #{kqllTwo}</if>
  548. <if test="kqllThree != null "> and KQLL_THREE = #{kqllThree}</if>
  549. <if test="kqllFour != null "> and KQLL_FOUR = #{kqllFour}</if>
  550. <if test="kqllFive != null "> and KQLL_FIVE = #{kqllFive}</if>
  551. <if test="kqllSix != null "> and KQLL_SIX = #{kqllSix}</if>
  552. <if test="SJTYJLY != null "> and SJTYJLY = #{SJTYJLY}</if>
  553. <if test="CLJYSSLL != null "> and CLJYSSLL = #{CLJYSSLL}</if>
  554. <if test="hycRjyAll != null and hycRjyAll != ''"> and HYC_RJY_ALL = #{hycRjyAll}</if>
  555. <if test="hycRjyZdAll != null and hycRjyZdAll != ''"> and HYC_RJY_ZD_ALL = #{hycRjyZdAll}</if>
  556. <if test="hycWnndAll != null and hycWnndAll != ''"> and HYC_WNND_ALL = #{hycWnndAll}</if>
  557. <if test="CLP04YCZ != null "> and CL_P04_YCZ = #{CLP04YCZ}</if>
  558. <if test="createdTime != null "> and CREATED_TIME = #{createdTime}</if>
  559. <!-- 下面是新增的SQL检索条件 -->
  560. <if test="timeBegin != null and timeBegin != ''"> and TEST_DATE &gt;= #{timeBegin}</if>
  561. <if test="timeEnd != null and timeEnd != ''"> and TEST_DATE &lt;= #{timeEnd}</if>
  562. </where>
  563. order by id desc
  564. </select>
  565. </mapper>