| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467 |
- <?xml version="1.0" encoding="UTF-8" ?>
- <!--
- Copyright 2009-2012 the original author or authors.
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
- http://www.apache.org/licenses/LICENSE-2.0
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
- -->
- <!DOCTYPE mapper
- PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
- "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
- <mapper namespace="com.runzhixing.dao.interf.AuthorityRegionInterface">
- <select id="getImgPath" parameterType="String" resultType="String">
- select t.PARAMVALUE from TB_PARAM t where t.PARAMID=#{paramID}
- </select>
- <update id="updateWxLogin" parameterType="com.runzhixing.bean.WXLOGIN">
- update TB_REG_USER set
- nickname=#{nickname} where WXID=#{openid}
- </update>
-
- <select id="getStationNo" parameterType="String" resultType="String">
- select t.stationno from v_operator_all t where t.operatorno=#{userOperatorNo}
- </select>
- <select id="getPreCarNo" parameterType="String" resultType="String">
- select t.CITYAB from TD_CITY t where concat(t.provinceno,t.cityno)=#{districtNo}
- </select>
- <update id="register" parameterType="com.runzhixing.bean.Register">
- update TB_REG_USER set
- DISTRICTNO=#{districtNo},
- UNITNAME=#{UNITNAME},
- UNITAB=#{UNITAB},
- UNITMANA=#{UNITMANA},
- UNITPHONE=#{UNITPHONE},
- USERNAME=#{USERNAME},
- USCC=#{USCC},
- UNITSAFEMANA=#{UNITSAFEMANA},
- UNITSAFEPHONE=#{UNITSAFEPHONE},
- MOBILE=#{MOBILE},
- POST=#{POST},
- ADDR=#{ADDR},
- USERID=#{USERID},
- USERTYPE=#{USERTYPE},
- EMAIL=#{EMAIL},
- REGTIME=to_date(#{REGTIME},'yyyy-mm-dd hh24:mi:ss'),
- WXVERIFY=1,
- REGSTATE=1
- where WXID=#{openid}
- </update>
- <update id="examineCar" parameterType="com.runzhixing.bean.Car">
- update tb_car set OPERSTATE = #{operState},AUDITSTATIONNO=#{auditStationNo},AUDITOPERATORNO=#{auditOperatorNo},AUDITOPERTIME=to_date(#{auditOperTime1},'yyyy-mm-dd hh24:mi:ss') where car_guid=#{carGuid}
- </update>
-
- <insert id="insertImgInfo" parameterType="com.runzhixing.bean.CylinderImg">
- <!--
- insert into TB_CYLINDER_IMG(CYLINDER_GUID,IMGTYPE,IMGINDEX,IMGDIR,FILENAME,FROMTYPE,EDITOPERTIME,OTHEROPERATOR)
- values
- (#{CYLINDER_GUID},#{IMGTYPE},#{IMGINDEX},#{IMGDIR},#{FILENAME},#{FROMTYPE},to_date(#{EDITOPERTIME},'yyyy-mm-dd hh24:mi:ss'),#{userGuid})
- -->
- <!-- INSERT INTO TB_CYLINDER_IMG
- (IMGINDEX,CYLINDER_GUID,IMGTYPE)
- SELECT '202020',CYLINDER_GUID,12
- FROM TB_CYLINDER_IMG where rownum=1 and CYLINDER_GUID='2EF95B3B855F4FF49BA351AFD0981C79' -->
- insert into TB_CYLINDER_IMG
- (CYLINDER_GUID,IMGTYPE,IMGINDEX,IMGDIR,FILENAME,FROMTYPE,EDITOPERTIME,OTHEROPERATOR)
- SELECT CYLINDER_GUID,#{IMGTYPE},#{IMGINDEX},#{IMGDIR},#{FILENAME},#{FROMTYPE},to_date(#{EDITOPERTIME},'yyyy-mm-dd hh24:mi:ss'),#{userGuid}
- FROM TB_CYLINDER where rownum=1 and CYLINDER_GUID=#{CYLINDER_GUID}
- </insert>
-
- <update id="updateImgInfo" parameterType="com.runzhixing.bean.CylinderImg">
- update TB_CYLINDER_IMG
- set
- IMGDIR=#{IMGDIR},FILENAME=#{FILENAME},FROMTYPE=#{FROMTYPE},EDITOPERTIME=to_date(#{EDITOPERTIME},'yyyy-mm-dd hh24:mi:ss'),OTHEROPERATOR=#{userGuid}
- where
- CYLINDER_GUID=#{CYLINDER_GUID} and IMGTYPE=#{IMGTYPE} and IMGINDEX=#{IMGINDEX}
- and CYLINDER_GUID in (SELECT t.CYLINDER_GUID from TB_CYLINDER t where t.CYLINDER_GUID=#{CYLINDER_GUID} )
- </update>
-
- <resultMap id="CylinderProductList" type="com.runzhixing.bean.CityPlace">
- <result column="productno" property="id"/>
- <result column="productab" property="name"/>
- </resultMap>
- <select id="getCylinderProduct" resultMap="CylinderProductList">
- select t.productno,t.productab from tb_cylinderproduct t order by t.productab asc
- </select>
- <delete id="deleteCar" parameterType="String">
- delete from tb_car t where t.CAR_GUID=#{carGuid}
- </delete>
-
- <delete id="deleteCylinder" parameterType="String">
- delete from tb_cylinder t where t.CAR_GUID=#{carGuid}
- </delete>
-
- <resultMap id="countryList123" type="com.runzhixing.bean.CountryPlace">
- <result column="countyno" property="id"/>
- <result column="countyname" property="name"/>
- </resultMap>
- <select id="getCounty123" parameterType="com.runzhixing.bean.CountryPlace" resultMap="countryList123">
- select t.countyno,t.countyname from td_county t
- <where>
- <if test="provinceNO!=null">
- and t.provinceno=#{provinceNO}
- </if>
- <if test="cityNO!=null">
- and t.cityno=#{cityNO}
- </if>
- <if test="id!=null">
- and t.countyno=#{id}
- </if>
- </where>
-
- </select>
- <resultMap id="cityList123" type="com.runzhixing.bean.CityPlace">
- <result column="cityno" property="id"/>
- <result column="cityname" property="name"/>
- </resultMap>
- <select id="getCity" parameterType="com.runzhixing.bean.CityPlace" resultMap="cityList123">
- select t.cityno,t.cityname from td_city t
- <where>
- <if test="cprovinceNo!=null">
- and t.provinceno=#{cprovinceNo}
- </if>
- <if test="id!=null">
- and t.cityno=#{id}
- </if>
- </where>
-
- </select>
-
- <insert id="insertWXLogin" parameterType="com.runzhixing.bean.WXLOGIN">
-
- insert into TB_REG_USER(WXID,REGTIME,NICKNAME) values(#{openid},to_date(#{registertime},'yyyy-mm-dd hh24:mi:ss'),#{nickname})
-
- </insert>
- <select id="firstWXLogin" parameterType="String" resultType="Integer">
- select count(t.WXID) from TB_REG_USER t where t.WXID=#{openid}
- </select>
-
- <select id="WXRigster" parameterType="String" resultType="String">
- select t.DISTRICTNO from TB_REG_USER t where t.WXID=#{openid}
- </select>
- <select id="WXRigster1" parameterType="String" resultType="com.runzhixing.bean.Register">
- select t.USER_GUID as userGuid,t.UNITNAME,t.UNITAB,t.UNITMANA,t.UNITPHONE,t.USCC,t.UNITSAFEMANA,t.UNITSAFEPHONE,t.USERNAME,t.MOBILE,t.POST,t.ADDR,t.USERID,t.EMAIL,t.REGTIME,t.USERTYPE from TB_REG_USER t where t.WXID=#{openid}
- </select>
- <resultMap id="valveList" type="com.runzhixing.bean.Valve">
- <result column="CYLINDER_GUID" property="CYLINDER_GUID"/>
- <result column="CAR_GUID" property="CAR_GUID"/>
- <result column="STATIONNO" property="STATIONNO"/>
- <result column="OTHERSTATION" property="OTHERSTATION"/>
- <result column="VALVEPRODUCT" property="VALVEPRODUCT"/>
- <result column="VALVETYPE" property="VALVETYPE"/>
- <result column="VALVEBATCH" property="VALVEBATCH"/>
- <result column="OPERDATE" property="OPERDATE"/>
- <result column="OPERTYPE" property="OPERTYPE"/>
- <result column="REMARK" property="REMARK"/>
- </resultMap>
- <select id="getValveHistory" parameterType="com.runzhixing.bean.Valve" resultMap="valveList">
- select t.CYLINDER_GUID,t.CAR_GUID,t.STATIONNO,t.OTHERSTATION,t.VALVEPRODUCT,t.VALVETYPE,t.VALVEBATCH,t.OPERDATE,t.OPERTYPE,t.REMARK from TB_VALVE_TRACK t
- where t.CYLINDER_GUID=#{CYLINDER_GUID} order by t.OPERDATE DESC
- </select>
- <resultMap id="CylinderImgList" type="com.runzhixing.bean.CylinderImg">
- <result column="CYLINDER_GUID" property="CYLINDER_GUID"/>
- <result column="IMGTYPE" property="IMGTYPE"/>
- <result column="IMGINDEX" property="IMGINDEX"/>
- <result column="IMGDIR" property="IMGDIR"/>
- <result column="FILENAME" property="FILENAME"/>
- <result column="FROMTYPE" property="FROMTYPE"/>
- <result column="OTHEROPERATOR" property="OTHEROPERATOR"/>
- <result column="EDITSTATIONNO" property="EDITSTATIONNO"/>
- <result column="EDITOPERATORNO" property="EDITOPERATORNO"/>
- <result column="EDITOPERTIME" property="EDITOPERTIME"/>
- </resultMap>
- <select id="getCylinderImg" parameterType="com.runzhixing.bean.CylinderImg" resultMap="CylinderImgList">
- select t.CYLINDER_GUID,t.IMGTYPE,t.IMGINDEX,t.IMGDIR,t.FILENAME,t.FROMTYPE,t.OTHEROPERATOR,t.EDITSTATIONNO,t.EDITOPERATORNO,t.EDITOPERTIME from TB_CYLINDER_IMG t
- where t.CYLINDER_GUID=#{CYLINDER_GUID} order by t.IMGTYPE ASC,t.IMGINDEX ASC
- </select>
- <resultMap id="CylinderTypeList" type="com.runzhixing.bean.CylinderType">
- <result column="TYPE" property="TYPE"/>
- <result column="DETAIL" property="DETAIL"/>
- <result column="CYLINDERAB" property="CYLINDERAB"/>
- </resultMap>
- <select id="getCylinderType" resultMap="CylinderTypeList">
- select t.TYPE,t.DETAIL,t.CYLINDERAB from td_cylindertype t
- </select>
-
- <resultMap id="ProductTypeList" type="com.runzhixing.bean.ProductType">
- <result column="PRODUCTNO" property="PRODUCTNO"/>
- <result column="PRODUCTAB" property="PRODUCTAB"/>
- <result column="PRODUCTNAME" property="PRODUCTNAME"/>
- <result column="PRODUCTADDR" property="PRODUCTADDR"/>
- <result column="LICENCE" property="LICENCE"/>
- </resultMap>
-
- <select id="getProductType" resultMap="ProductTypeList">
- select t.PRODUCTNO,t.PRODUCTAB,t.PRODUCTNAME,t.PRODUCTADDR,t.LICENCE from TB_CYLINDERPRODUCT t
- </select>
-
- <resultMap id="CarList" type="com.runzhixing.bean.Car">
- <result column="WEIGHT" property="weight"/>
- </resultMap>
- <select id="getCar" parameterType="com.runzhixing.bean.Car" resultMap="CarList">
- select t.WEIGHT from tb_car t
- <where>
- <if test="carNo != null and !"".equals(carNo.trim())">
- and t.CARNO like CONCAT('%',#{carNo},'%')
- </if>
- <if test="regNo != null and !"".equals(regNo.trim())">
- and t.REGNO like CONCAT('%',#{carNo},'%')
- </if>
- </where>
- </select>
-
- <!-- 结果集 -->
- <resultMap id="stationMap" type="com.runzhixing.bean.CheckStation">
- <result property="id" column="STATIONNO"/>
- <result property="name" column="STATIONNAME"/>
- <result property="licence" column="LICENCE"/>
- <result property="licenceOrg" column="LICENCEORG"/>
- <result property="licenceDate1" column="LICENCEDATE"/>
- <result property="validity1" column="VALIDITY"/>
- <result property="manager" column="MANAGER"/>
- <result property="phone" column="PHONE"/>
- <result property="mobile" column="MOBILE"/>
- <result property="fax" column="FAX"/>
- <result property="addr" column="ADDR"/>
- <result property="post" column="POST"/>
- <result property="remark" column="REMARK"/>
- </resultMap>
-
- <!-- sql配置文件 -->
- <!-- 查询指定检验站-->
- <select id="getCheckStationByNo" parameterType="com.runzhixing.util.bean.ConditionParameter" resultMap="stationMap">
- select
- STATIONNO,
- STATIONNAME,
- LICENCE,
- LICENCEORG,
- LICENCEDATE,
- VALIDITY,
- ADDR,
- MANAGER,
- PHONE,
- MOBILE,
- FAX,
- ADDR,
- POST,
- REMARK
- from tb_checkstation t
- <where>
- <if test="1==1">
- and t.stationno like '%' || #{cpstring1} || '%'
- </if>
- </where>
- </select>
-
- <update id="updateMachine" parameterType="com.runzhixing.bean.Machine">
- update TB_CNGMACHINE set WORKSTATE=#{state} where STATIONNO=#{stationNo} and MACHINENO=#{machineNo}
- </update>
-
- <update id="updateFillCheckOper" parameterType="com.runzhixing.bean.Machine">
- update TB_CNGMACHINE set FILLCHECKNO1=#{fillCheckNo1},FILLCHECKNO2=#{fillCheckNo2} where STATIONNO=#{stationNo} and MACHINENO=#{machineNo}
- </update>
-
- <select id="getFillCheckOper2" parameterType="String" resultType="com.runzhixing.bean.Machine">
- select t.stationNo,t.machineNo,t.FILLCHECKNO2 from TB_CNGMACHINE t
- where t.stationNo = #{stationNo}
- </select>
- <!-- 新注册/注销的cng车辆数量 -->
- <select id="getCarNum" parameterType="com.runzhixing.bean.CarCyNumStatictis" resultType="com.runzhixing.bean.CarCyNumStatictis">
- <!-- select t.operState,count(t.CAR_GUID) as carNum from TB_CAR t
- <where>
- (
- t.operState = 0
- <if test="startTime != null and !"".equals(startTime.trim())">
- and t.regTime <![CDATA[ >= ]]> to_date(#{startTime},'yyyy-mm-dd')
- </if>
- <if test="endTime != null and !"".equals(endTime.trim())">
- and t.regTime <![CDATA[ <= ]]> to_date(#{endTime},'yyyy-mm-dd')
- </if>
- )
- or
- (
- t.operState = 41
- <if test="startTime != null and !"".equals(startTime.trim())">
- and t.EDITOPERTIME <![CDATA[ >= ]]> to_date(#{startTime},'yyyy-mm-dd')
- </if>
- <if test="endTime != null and !"".equals(endTime.trim())">
- and t.EDITOPERTIME <![CDATA[ <= ]]> to_date(#{endTime},'yyyy-mm-dd')
- </if>
- )
- </where>
- GROUP BY t.OPERSTATE -->
-
- select
- t.operState,count(t.CAR_GUID) as carNum,sum(t.INSTALLNUM) as cyNum
- from V_CAR_ALL t
- join (select t1.CAR_GUID from V_CYLINDER_ALL t1 where t1.CYLINDERTYPE in (0,1,2,3,4) GROUP BY t1.CAR_GUID) temp on TEMP.CAR_GUID = t.CAR_GUID
- <where>
- (
- t.operState = 0
- <if test="startTime != null and !"".equals(startTime.trim())">
- and t.regTime <![CDATA[ >= ]]> to_date(#{startTime},'yyyy-mm-dd')
- </if>
- <if test="endTime != null and !"".equals(endTime.trim())">
- and t.regTime <![CDATA[ <= ]]> to_date(#{endTime},'yyyy-mm-dd')
- </if>
- )
- or
- (
- t.operState = 41
- <if test="startTime != null and !"".equals(startTime.trim())">
- and t.EDITOPERTIME <![CDATA[ >= ]]> to_date(#{startTime},'yyyy-mm-dd')
- </if>
- <if test="endTime != null and !"".equals(endTime.trim())">
- and t.EDITOPERTIME <![CDATA[ <= ]]> to_date(#{endTime},'yyyy-mm-dd')
- </if>
- )
- </where>
- GROUP BY t.OPERSTATE
-
- </select>
- <!-- 新注册/注销的lng车辆数量 -->
- <select id="getCarNum1" parameterType="com.runzhixing.bean.CarCyNumStatictis" resultType="com.runzhixing.bean.CarCyNumStatictis">
- select
- t.operState,count(t.CAR_GUID) as carNum,sum(t.INSTALLNUM) as cyNum
- from V_CAR_ALL t
- join (select t1.CAR_GUID from V_CYLINDER_ALL t1 where t1.CYLINDERTYPE = 5 GROUP BY t1.CAR_GUID) temp on TEMP.CAR_GUID = t.CAR_GUID
- <where>
- (
- t.operState = 0
- <if test="startTime != null and !"".equals(startTime.trim())">
- and t.regTime <![CDATA[ >= ]]> to_date(#{startTime},'yyyy-mm-dd')
- </if>
- <if test="endTime != null and !"".equals(endTime.trim())">
- and t.regTime <![CDATA[ <= ]]> to_date(#{endTime},'yyyy-mm-dd')
- </if>
- )
- or
- (
- t.operState = 41
- <if test="startTime != null and !"".equals(startTime.trim())">
- and t.EDITOPERTIME <![CDATA[ >= ]]> to_date(#{startTime},'yyyy-mm-dd')
- </if>
- <if test="endTime != null and !"".equals(endTime.trim())">
- and t.EDITOPERTIME <![CDATA[ <= ]]> to_date(#{endTime},'yyyy-mm-dd')
- </if>
- )
- </where>
- GROUP BY t.OPERSTATE
-
- </select>
- <!-- 新注册/注销的cng气瓶数量 -->
- <select id="getCyNum" parameterType="com.runzhixing.bean.CarCyNumStatictis" resultType="com.runzhixing.bean.CarCyNumStatictis">
- <!-- select t1.operState,count(t1.CAR_GUID) as cyNum from v_cylinder_all t1 join TB_CAR t on t.CAR_GUID = t1.CAR_GUID
- <where>
- (
- t1.operState = 0
- <if test="startTime != null and !"".equals(startTime.trim())">
- and t.regTime <![CDATA[ >= ]]> to_date(#{startTime},'yyyy-mm-dd')
- </if>
- <if test="endTime != null and !"".equals(endTime.trim())">
- and t.regTime <![CDATA[ <= ]]> to_date(#{endTime},'yyyy-mm-dd')
- </if>
- )
- or
- (
- t1.operState = 41
- <if test="startTime != null and !"".equals(startTime.trim())">
- and t.EDITOPERTIME <![CDATA[ >= ]]> to_date(#{startTime},'yyyy-mm-dd')
- </if>
- <if test="endTime != null and !"".equals(endTime.trim())">
- and t.EDITOPERTIME <![CDATA[ <= ]]> to_date(#{endTime},'yyyy-mm-dd')
- </if>
- )
- </where>
- GROUP BY t1.OPERSTATE -->
-
- select t.operState,sum(t.INSTALLNUM) as cyNum from TB_CAR t
- join (select t1.CAR_GUID from V_CYLINDER_ALL t1 where t1.CYLINDERTYPE in (0,1,2,3,4) GROUP BY t1.CAR_GUID) temp on TEMP.CAR_GUID = t.CAR_GUID
- <where>
- (
- t.operState = 0
- <if test="startTime != null and !"".equals(startTime.trim())">
- and t.regTime <![CDATA[ >= ]]> to_date(#{startTime},'yyyy-mm-dd')
- </if>
- <if test="endTime != null and !"".equals(endTime.trim())">
- and t.regTime <![CDATA[ <= ]]> to_date(#{endTime},'yyyy-mm-dd')
- </if>
- )
- or
- (
- t.operState = 41
- <if test="startTime != null and !"".equals(startTime.trim())">
- and t.EDITOPERTIME <![CDATA[ >= ]]> to_date(#{startTime},'yyyy-mm-dd')
- </if>
- <if test="endTime != null and !"".equals(endTime.trim())">
- and t.EDITOPERTIME <![CDATA[ <= ]]> to_date(#{endTime},'yyyy-mm-dd')
- </if>
- )
- </where>
- GROUP BY t.OPERSTATE
- </select>
- <!-- 新注册/注销的lng气瓶数量 -->
- <select id="getCyNum1" parameterType="com.runzhixing.bean.CarCyNumStatictis" resultType="com.runzhixing.bean.CarCyNumStatictis">
-
- select t.operState,sum(t.INSTALLNUM) as cyNum from TB_CAR t
- join (select t1.CAR_GUID from V_CYLINDER_ALL t1 where t1.CYLINDERTYPE = 5 GROUP BY t1.CAR_GUID) temp on TEMP.CAR_GUID = t.CAR_GUID
- <where>
- (
- t.operState = 0
- <if test="startTime != null and !"".equals(startTime.trim())">
- and t.regTime <![CDATA[ >= ]]> to_date(#{startTime},'yyyy-mm-dd')
- </if>
- <if test="endTime != null and !"".equals(endTime.trim())">
- and t.regTime <![CDATA[ <= ]]> to_date(#{endTime},'yyyy-mm-dd')
- </if>
- )
- or
- (
- t.operState = 41
- <if test="startTime != null and !"".equals(startTime.trim())">
- and t.EDITOPERTIME <![CDATA[ >= ]]> to_date(#{startTime},'yyyy-mm-dd')
- </if>
- <if test="endTime != null and !"".equals(endTime.trim())">
- and t.EDITOPERTIME <![CDATA[ <= ]]> to_date(#{endTime},'yyyy-mm-dd')
- </if>
- )
- </where>
- GROUP BY t.OPERSTATE
- </select>
- <select id="getStationInfos" parameterType="String" resultType="com.runzhixing.bean.Station">
- select t.media,count(t.media) as count from tb_cngstation t where
- t.MEDIA is not null
- and
- t.STATIONNO like CONCAT(#{distNo},'%')
- GROUP BY t.MEDIA
- order by t.media
- </select>
-
- <select id="getMachineInfos" parameterType="String" resultType="com.runzhixing.bean.Station">
- select t.media,count(t.media) as count from TB_CNGMACHINE t where
- t.MEDIA is not null
- and
- t.STATIONNO like CONCAT(#{distNo},'%')
- GROUP BY t.MEDIA
- order by t.media
- </select>
-
- </mapper>
|