<?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.hzya.frame.plugin.cinvoice.lexmis.dao.impl.LexmiscivPlaneticketsDaoImpl">
	<resultMap id="get-LexmiscivPlaneticketsEntity-result" type="com.hzya.frame.plugin.cinvoice.lexmis.entity.LexmiscivPlaneticketsEntity">
		<!--无备注 -->
		<result property="PTS_ID" column="PTS_ID" />
		<!--无备注 -->
		<result property="PTS_MAINID" column="PTS_MAINID" />
		<!--无备注 -->
		<result property="PTS_SORTNUM" column="PTS_SORTNUM" />
		<!--无备注 -->
		<result property="PTS_DATE" column="PTS_DATE" />
		<!--无备注 -->
		<result property="PTS_TIME" column="PTS_TIME" />
		<!--无备注 -->
		<result property="PTS_CLASS" column="PTS_CLASS" />
		<!--无备注 -->
		<result property="PTS_CARRIER" column="PTS_CARRIER" />
		<!--无备注 -->
		<result property="PTS_NO" column="PTS_NO" />
		<!--无备注 -->
		<result property="PTS_FSTATION" column="PTS_FSTATION" />
		<!--无备注 -->
		<result property="PTS_TSTATION" column="PTS_TSTATION" />
		<!--无备注 -->
		<result property="PTS_CLASSNAME" column="PTS_CLASSNAME" />
		<!--无备注 -->
		<result property="PTS_FAREBASIS" column="PTS_FAREBASIS" />
		<!--无备注 -->
		<result property="PTS_ALLOW" column="PTS_ALLOW" />
		<!--无备注 -->
		<result property="PTS_DATETIME" column="PTS_DATETIME" />
		<!--无备注 -->
		<result property="PTS_NOTVALIDAFTER" column="PTS_NOTVALIDAFTER" />
		<!--无备注 -->
		<result property="PTS_NOTVALIDBEFORE" column="PTS_NOTVALIDBEFORE" />
	</resultMap>

	<sql id="LexmiscivPlaneticketsEntity_Base_Column_List">
		PTS_ID,
		PTS_MAINID,
		PTS_SORTNUM,
		PTS_DATE,
		PTS_TIME,
		PTS_CLASS,
		PTS_CARRIER,
		PTS_NO,
		PTS_FSTATION,
		PTS_TSTATION,
		PTS_CLASSNAME,
		PTS_FAREBASIS,
		PTS_ALLOW,
		PTS_DATETIME,
		PTS_NOTVALIDAFTER,
		PTS_NOTVALIDBEFORE
	</sql>

	<!--通过ID获取数据 -->
	<select id="entity_get" resultMap="get-LexmiscivPlaneticketsEntity-result">
		select
		<include refid="LexmiscivPlaneticketsEntity_Base_Column_List" />
		from LEXMISCIV_PLANETICKETS where id = #{ id }
	</select>

	<!-- 查询 采用==查询 -->
	<select id="entity_list_base" resultMap="get-LexmiscivPlaneticketsEntity-result" parameterType="com.hzya.frame.plugin.cinvoice.lexmis.entity.LexmiscivPlaneticketsEntity">
		select
		<include refid="LexmiscivPlaneticketsEntity_Base_Column_List" />
		from LEXMISCIV_PLANETICKETS
		<trim prefix="where" prefixOverrides="and">
			<if test="PTS_ID != null ">PTS_ID=#{PTS_ID}</if>
			<if test="PTS_MAINID != null "> and PTS_MAINID = #{PTS_MAINID}</if>
			<if test="PTS_SORTNUM != null "> and PTS_SORTNUM = #{PTS_SORTNUM}</if>
			<if test="PTS_DATE != null "> and PTS_DATE = #{PTS_DATE}</if>
			<if test="PTS_TIME != null and PTS_TIME !='' "> and PTS_TIME = #{PTS_TIME}</if>
			<if test="PTS_CLASS != null and PTS_CLASS !='' "> and PTS_CLASS = #{PTS_CLASS}</if>
			<if test="PTS_CARRIER != null and PTS_CARRIER !='' "> and PTS_CARRIER = #{PTS_CARRIER}</if>
			<if test="PTS_NO != null and PTS_NO !='' "> and PTS_NO = #{PTS_NO}</if>
			<if test="PTS_FSTATION != null and PTS_FSTATION !='' "> and PTS_FSTATION = #{PTS_FSTATION}</if>
			<if test="PTS_TSTATION != null and PTS_TSTATION !='' "> and PTS_TSTATION = #{PTS_TSTATION}</if>
			<if test="PTS_CLASSNAME != null and PTS_CLASSNAME !='' "> and PTS_CLASSNAME = #{PTS_CLASSNAME}</if>
			<if test="PTS_FAREBASIS != null and PTS_FAREBASIS !='' "> and PTS_FAREBASIS = #{PTS_FAREBASIS}</if>
			<if test="PTS_ALLOW != null and PTS_ALLOW !='' "> and PTS_ALLOW = #{PTS_ALLOW}</if>
			<if test="PTS_DATETIME != null and PTS_DATETIME !='' "> and PTS_DATETIME = #{PTS_DATETIME}</if>
			<if test="PTS_NOTVALIDAFTER != null and PTS_NOTVALIDAFTER !='' "> and PTS_NOTVALIDAFTER = #{PTS_NOTVALIDAFTER}</if>
			<if test="PTS_NOTVALIDBEFORE != null and PTS_NOTVALIDBEFORE !='' "> and PTS_NOTVALIDBEFORE = #{PTS_NOTVALIDBEFORE}</if>

		</trim>
		<if test=" sort =='' "> order by id desc</if>
		<if test=" sort !='' and sort!=null and order !='' and order!=null ">order by ${sort} ${order}</if>
	</select>

	<!-- 查询符合条件的数量 -->
	<select id="LexmiscivPlaneticketsEntity_count" resultType="Integer" parameterType="com.hzya.frame.plugin.cinvoice.lexmis.entity.LexmiscivPlaneticketsEntity">
		select count(1) from LEXMISCIV_PLANETICKETS
		<trim prefix="where" prefixOverrides="and">
			<if test="PTS_ID != null ">PTS_ID = #{PTS_ID}</if>
			<if test="PTS_MAINID != null "> and PTS_MAINID = #{PTS_MAINID}  </if>
			<if test="PTS_SORTNUM != null "> and PTS_SORTNUM = #{PTS_SORTNUM}  </if>
			<if test="PTS_DATE != null "> and PTS_DATE = #{PTS_DATE}  </if>
			<if test="PTS_TIME != null and PTS_TIME !='' "> and PTS_TIME = #{PTS_TIME} </if>
			<if test="PTS_CLASS != null and PTS_CLASS !='' "> and PTS_CLASS = #{PTS_CLASS} </if>
			<if test="PTS_CARRIER != null and PTS_CARRIER !='' "> and PTS_CARRIER = #{PTS_CARRIER} </if>
			<if test="PTS_NO != null and PTS_NO !='' "> and PTS_NO = #{PTS_NO} </if>
			<if test="PTS_FSTATION != null and PTS_FSTATION !='' "> and PTS_FSTATION = #{PTS_FSTATION} </if>
			<if test="PTS_TSTATION != null and PTS_TSTATION !='' "> and PTS_TSTATION = #{PTS_TSTATION} </if>
			<if test="PTS_CLASSNAME != null and PTS_CLASSNAME !='' "> and PTS_CLASSNAME = #{PTS_CLASSNAME} </if>
			<if test="PTS_FAREBASIS != null and PTS_FAREBASIS !='' "> and PTS_FAREBASIS = #{PTS_FAREBASIS} </if>
			<if test="PTS_ALLOW != null and PTS_ALLOW !='' "> and PTS_ALLOW = #{PTS_ALLOW} </if>
			<if test="PTS_DATETIME != null and PTS_DATETIME !='' "> and PTS_DATETIME = #{PTS_DATETIME} </if>
			<if test="PTS_NOTVALIDAFTER != null and PTS_NOTVALIDAFTER !='' "> and PTS_NOTVALIDAFTER = #{PTS_NOTVALIDAFTER} </if>
			<if test="PTS_NOTVALIDBEFORE != null and PTS_NOTVALIDBEFORE !='' "> and PTS_NOTVALIDBEFORE = #{PTS_NOTVALIDBEFORE} </if>

		</trim>
		<if test=" sort =='' "> order by id desc</if>
		<if test=" sort !='' and sort!=null and order !='' and order!=null "> order by ${sort} ${order}</if>
	</select>

	<!-- 分页查询列表 采用like格式 -->
	<select id="LexmiscivPlaneticketsEntity_list_like" resultMap="get-LexmiscivPlaneticketsEntity-result" parameterType="com.hzya.frame.plugin.cinvoice.lexmis.entity.LexmiscivPlaneticketsEntity">
		select
		<include refid="LexmiscivPlaneticketsEntity_Base_Column_List" />
		from LEXMISCIV_PLANETICKETS
		<trim prefix="where" prefixOverrides="and">
			<if test="PTS_ID != null ">PTS_ID = #{PTS_ID}</if>
			<if test="PTS_MAINID != null "> and PTS_MAINID = #{PTS_MAINID}</if>
			<if test="PTS_SORTNUM != null "> and PTS_SORTNUM = #{PTS_SORTNUM}</if>
			<if test="PTS_DATE != null and PTS_DATE !='' "> and PTS_DATE like concat('%',#{PTS_DATE},'%') </if>
			<if test="PTS_TIME != null and PTS_TIME !='' "> and PTS_TIME like concat('%',#{PTS_TIME},'%') </if>
			<if test="PTS_CLASS != null and PTS_CLASS !='' "> and PTS_CLASS like concat('%',#{PTS_CLASS},'%') </if>
			<if test="PTS_CARRIER != null and PTS_CARRIER !='' "> and PTS_CARRIER like concat('%',#{PTS_CARRIER},'%') </if>
			<if test="PTS_NO != null and PTS_NO !='' "> and PTS_NO like concat('%',#{PTS_NO},'%') </if>
			<if test="PTS_FSTATION != null and PTS_FSTATION !='' "> and PTS_FSTATION like concat('%',#{PTS_FSTATION},'%') </if>
			<if test="PTS_TSTATION != null and PTS_TSTATION !='' "> and PTS_TSTATION like concat('%',#{PTS_TSTATION},'%') </if>
			<if test="PTS_CLASSNAME != null and PTS_CLASSNAME !='' "> and PTS_CLASSNAME like concat('%',#{PTS_CLASSNAME},'%') </if>
			<if test="PTS_FAREBASIS != null and PTS_FAREBASIS !='' "> and PTS_FAREBASIS like concat('%',#{PTS_FAREBASIS},'%') </if>
			<if test="PTS_ALLOW != null and PTS_ALLOW !='' "> and PTS_ALLOW like concat('%',#{PTS_ALLOW},'%') </if>
			<if test="PTS_DATETIME != null and PTS_DATETIME !='' "> and PTS_DATETIME like concat('%',#{PTS_DATETIME},'%') </if>
			<if test="PTS_NOTVALIDAFTER != null and PTS_NOTVALIDAFTER !='' "> and PTS_NOTVALIDAFTER like concat('%',#{PTS_NOTVALIDAFTER},'%') </if>
			<if test="PTS_NOTVALIDBEFORE != null and PTS_NOTVALIDBEFORE !='' "> and PTS_NOTVALIDBEFORE like concat('%',#{PTS_NOTVALIDBEFORE},'%') </if>

		</trim>
		<if test=" sort =='' "> order by id desc</if>
		<if test=" sort !='' and sort!=null and order !='' and order!=null ">order by  ${sort} ${order}</if>
	</select>

	<!-- 查询列表 字段采用or格式 -->
	<select id="LexmiscivPlaneticketsEntity_list_or" resultMap="get-LexmiscivPlaneticketsEntity-result" parameterType="com.hzya.frame.plugin.cinvoice.lexmis.entity.LexmiscivPlaneticketsEntity">
		select
		<include refid="LexmiscivPlaneticketsEntity_Base_Column_List" />
		from LEXMISCIV_PLANETICKETS
		<trim prefix="where" prefixOverrides="or">
			<if test="PTS_ID != null ">PTS_ID = #{PTS_ID}</if>
			<if test="PTS_MAINID != null "> or PTS_MAINID = #{PTS_MAINID}</if>
			<if test="PTS_SORTNUM != null "> or PTS_SORTNUM = #{PTS_SORTNUM}</if>
			<if test="PTS_DATE != null and PTS_DATE !='' "> or PTS_DATE = #{PTS_DATE} </if>
			<if test="PTS_TIME != null and PTS_TIME !='' "> or PTS_TIME = #{PTS_TIME} </if>
			<if test="PTS_CLASS != null and PTS_CLASS !='' "> or PTS_CLASS = #{PTS_CLASS} </if>
			<if test="PTS_CARRIER != null and PTS_CARRIER !='' "> or PTS_CARRIER = #{PTS_CARRIER} </if>
			<if test="PTS_NO != null and PTS_NO !='' "> or PTS_NO = #{PTS_NO} </if>
			<if test="PTS_FSTATION != null and PTS_FSTATION !='' "> or PTS_FSTATION = #{PTS_FSTATION} </if>
			<if test="PTS_TSTATION != null and PTS_TSTATION !='' "> or PTS_TSTATION = #{PTS_TSTATION} </if>
			<if test="PTS_CLASSNAME != null and PTS_CLASSNAME !='' "> or PTS_CLASSNAME = #{PTS_CLASSNAME} </if>
			<if test="PTS_FAREBASIS != null and PTS_FAREBASIS !='' "> or PTS_FAREBASIS = #{PTS_FAREBASIS} </if>
			<if test="PTS_ALLOW != null and PTS_ALLOW !='' "> or PTS_ALLOW = #{PTS_ALLOW} </if>
			<if test="PTS_DATETIME != null and PTS_DATETIME !='' "> or PTS_DATETIME = #{PTS_DATETIME} </if>
			<if test="PTS_NOTVALIDAFTER != null and PTS_NOTVALIDAFTER !='' "> or PTS_NOTVALIDAFTER = #{PTS_NOTVALIDAFTER} </if>
			<if test="PTS_NOTVALIDBEFORE != null and PTS_NOTVALIDBEFORE !='' "> or PTS_NOTVALIDBEFORE = #{PTS_NOTVALIDBEFORE} </if>

		</trim>
		<if test=" sort =='' "> order by id desc</if>
		<if test=" sort !='' and sort!=null and order !='' and order!=null ">order by  ${sort} ${order}</if>
	</select>

</mapper>
