TpPTgsPassedcarSMapper.xml 2.81 KB
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.zteits.park.mapper.smapper.TpPTgsPassedcarSMapper">
  <resultMap id="BaseResultMap" type="com.zteits.park.domain.TpPTgsPassedcar">
    <id column="NID" jdbcType="INTEGER" property="nid" />
    <result column="CLICENSETYPE" jdbcType="VARCHAR" property="clicensetype" />
    <result column="CCARNUMBER" jdbcType="VARCHAR" property="ccarnumber" />
    <result column="DCOLLECTIONDATE" jdbcType="TIMESTAMP" property="dcollectiondate" />
    <result column="CADDRESSCODE" jdbcType="VARCHAR" property="caddresscode" />
    <result column="CCOLLECTIONADDRESS" jdbcType="VARCHAR" property="ccollectionaddress" />
    <result column="CCOLLECTIONAGENCIES" jdbcType="VARCHAR" property="ccollectionagencies" />
    <result column="CDATASOURCE" jdbcType="VARCHAR" property="cdatasource" />
    <result column="CSNAPTYPE" jdbcType="CHAR" property="csnaptype" />
    <result column="CDEVICECODE" jdbcType="VARCHAR" property="cdevicecode" />
    <result column="CLANENUMBER" jdbcType="VARCHAR" property="clanenumber" />
    <result column="NVEHICLESPEED" jdbcType="INTEGER" property="nvehiclespeed" />
    <result column="CPIC1PATH" jdbcType="VARCHAR" property="cpic1path" />
    <result column="CPIC2PATH" jdbcType="VARCHAR" property="cpic2path" />
    <result column="CPIC3PATH" jdbcType="VARCHAR" property="cpic3path" />
    <result column="NDERICTRION" jdbcType="INTEGER" property="nderictrion" />
    <result column="ISILL" jdbcType="CHAR" property="isill" />
  </resultMap>
  <sql id="Base_Column_List">
    NID, CLICENSETYPE, CCARNUMBER, DCOLLECTIONDATE, CADDRESSCODE, CCOLLECTIONADDRESS, 
    CCOLLECTIONAGENCIES, CDATASOURCE, CSNAPTYPE, CDEVICECODE, CLANENUMBER, NVEHICLESPEED, 
    CPIC1PATH, CPIC2PATH, CPIC3PATH, NDERICTRION, ISILL
  </sql>
   <select id="querygsPassedcarInfo" parameterType="com.zteits.clouds.api.dto.park.param.TpPTgsPassedcarRequest" resultMap="BaseResultMap">
    select 
    <include refid="Base_Column_List" />
    from tp_p_tgs_passedcar
     where 1 = 1
      <if test="ccarnumber != null and ccarnumber != ''">
       and CCARNUMBER LIKE CONCAT('%',#{ccarnumber},'%' )
      </if>
      <if test="clicensetype != null and clicensetype != '' ">
       and CLICENSETYPE = #{clicensetype,jdbcType=CHAR}
      </if>
      <if test="s_dcollectiondate != null">
      	<![CDATA[ and DCOLLECTIONDATE >=#{s_dcollectiondate} ]]>
  	</if>
	 <if test="e_dcollectiondate != null">
         <![CDATA[  and DCOLLECTIONDATE <=#{e_dcollectiondate} ]]>
     </if>
     <if test="cdevicecodes != null">
        	and CDEVICECODE IN 
	      <foreach collection="cdevicecodes" open="(" close=")" separator="," item="cdevicecode">
	         #{cdevicecode}
	      </foreach>
     </if>
  </select>
</mapper>