|
@@ -1,137 +1,143 @@
|
|
|
<?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">
|
|
|
+ "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
|
|
<!-- namespace必须指向DAO接口 -->
|
|
|
<mapper namespace="com.jpsoft.bus.modules.bus.dao.PassengerInfoDAO">
|
|
|
- <resultMap id="PassengerInfoMap" type="com.jpsoft.bus.modules.bus.entity.PassengerInfo">
|
|
|
- <id property="id" column="id_" />
|
|
|
- <result property="vehicleShiftId" column="vehicle_shift_id" />
|
|
|
- <result property="vehiclePersonId" column="vehicle_person_id" />
|
|
|
- <result property="userId" column="user_id" />
|
|
|
- <result property="imageUrl" column="image_url" />
|
|
|
- <result property="upTime" column="up_time" />
|
|
|
- <result property="downTime" column="down_time" />
|
|
|
- <result property="upStationId" column="up_station_id" />
|
|
|
- <result property="downStationId" column="down_station_id" />
|
|
|
- <result property="upStationName" column="up_station_name"/>
|
|
|
- <result property="downStationName" column="down_station_name"/>
|
|
|
- <result property="status" column="status_" />
|
|
|
- <result property="payStatus" column="pay_status" />
|
|
|
- <result property="createBy" column="create_by" />
|
|
|
- <result property="createTime" column="create_time" />
|
|
|
- <result property="updateBy" column="update_by" />
|
|
|
- <result property="updateTime" column="update_time" />
|
|
|
- <result property="delFlag" column="del_flag" />
|
|
|
- <result property="userName" column="user_name" />
|
|
|
- <result property="ticketUpStationId" column="ticket_up_station_id"/>
|
|
|
- <result property="ticketDownStationId" column="ticket_down_station_id"/>
|
|
|
- <result property="ticketUpStationName" column="ticket_up_station_name"/>
|
|
|
- <result property="ticketDownStationName" column="ticket_down_station_name"/>
|
|
|
- </resultMap>
|
|
|
- <insert id="insert" parameterType="com.jpsoft.bus.modules.bus.entity.PassengerInfo">
|
|
|
- <!--
|
|
|
- <selectKey resultType="java.lang.String" order="BEFORE" keyProperty="id">
|
|
|
- select sys_guid() from dual
|
|
|
- </selectKey>
|
|
|
- -->
|
|
|
- <![CDATA[
|
|
|
+ <resultMap id="PassengerInfoMap" type="com.jpsoft.bus.modules.bus.entity.PassengerInfo">
|
|
|
+ <id property="id" column="id_"/>
|
|
|
+ <result property="vehicleShiftId" column="vehicle_shift_id"/>
|
|
|
+ <result property="vehicleLibId" column="vehicle_lib_id"/>
|
|
|
+ <result property="vehiclePersonId" column="vehicle_person_id"/>
|
|
|
+ <result property="userId" column="user_id"/>
|
|
|
+ <result property="imageUrl" column="image_url"/>
|
|
|
+ <result property="upTime" column="up_time"/>
|
|
|
+ <result property="downTime" column="down_time"/>
|
|
|
+ <result property="upStationId" column="up_station_id"/>
|
|
|
+ <result property="downStationId" column="down_station_id"/>
|
|
|
+ <result property="upStationName" column="up_station_name"/>
|
|
|
+ <result property="downStationName" column="down_station_name"/>
|
|
|
+ <result property="status" column="status_"/>
|
|
|
+ <result property="payStatus" column="pay_status"/>
|
|
|
+ <result property="createBy" column="create_by"/>
|
|
|
+ <result property="createTime" column="create_time"/>
|
|
|
+ <result property="updateBy" column="update_by"/>
|
|
|
+ <result property="updateTime" column="update_time"/>
|
|
|
+ <result property="delFlag" column="del_flag"/>
|
|
|
+ <result property="userName" column="user_name"/>
|
|
|
+ <result property="ticketUpStationId" column="ticket_up_station_id"/>
|
|
|
+ <result property="ticketDownStationId" column="ticket_down_station_id"/>
|
|
|
+ <result property="ticketUpStationName" column="ticket_up_station_name"/>
|
|
|
+ <result property="ticketDownStationName" column="ticket_down_station_name"/>
|
|
|
+ </resultMap>
|
|
|
+ <insert id="insert" parameterType="com.jpsoft.bus.modules.bus.entity.PassengerInfo">
|
|
|
+ <!--
|
|
|
+ <selectKey resultType="java.lang.String" order="BEFORE" keyProperty="id">
|
|
|
+ select sys_guid() from dual
|
|
|
+ </selectKey>
|
|
|
+ -->
|
|
|
+ <![CDATA[
|
|
|
insert into bus_passenger_info
|
|
|
- (id_,vehicle_shift_id,vehicle_person_id,user_id,image_url,up_time,down_time,up_station_id,down_station_id,status_,pay_status,create_by,create_time,update_by,update_time,del_flag,ticket_up_station_id,ticket_down_station_id)
|
|
|
+ (id_,vehicle_shift_id,vehicle_lib_id,vehicle_person_id,user_id,image_url,up_time,down_time,up_station_id,
|
|
|
+ down_station_id,status_,pay_status,create_by,create_time,update_by,update_time,del_flag,ticket_up_station_id,ticket_down_station_id)
|
|
|
values
|
|
|
(
|
|
|
-#{id,jdbcType=VARCHAR}
|
|
|
-,#{vehicleShiftId,jdbcType=VARCHAR}
|
|
|
-,#{vehiclePersonId,jdbcType= NUMERIC }
|
|
|
-,#{userId,jdbcType= NUMERIC }
|
|
|
-,#{imageUrl,jdbcType=VARCHAR}
|
|
|
-,#{upTime,jdbcType= TIMESTAMP }
|
|
|
-,#{downTime,jdbcType= TIMESTAMP }
|
|
|
-,#{upStationId,jdbcType=VARCHAR}
|
|
|
-,#{downStationId,jdbcType=VARCHAR}
|
|
|
-,#{status,jdbcType=VARCHAR}
|
|
|
-,#{payStatus,jdbcType=VARCHAR}
|
|
|
-,#{createBy,jdbcType=VARCHAR}
|
|
|
-,#{createTime,jdbcType= TIMESTAMP }
|
|
|
-,#{updateBy,jdbcType=VARCHAR}
|
|
|
-,#{updateTime,jdbcType= TIMESTAMP }
|
|
|
-,#{delFlag,jdbcType= NUMERIC }
|
|
|
-,#{ticketUpStationId,jdbcType=VARCHAR}
|
|
|
-,#{ticketDownStationId,jdbcType=VARCHAR}
|
|
|
+ #{id,jdbcType=VARCHAR}
|
|
|
+ ,#{vehicleShiftId,jdbcType=VARCHAR}
|
|
|
+ ,#{vehicleLibId,jdbcType= NUMERIC}
|
|
|
+ ,#{vehiclePersonId,jdbcType= NUMERIC}
|
|
|
+ ,#{userId,jdbcType= NUMERIC}
|
|
|
+ ,#{imageUrl,jdbcType=VARCHAR}
|
|
|
+ ,#{upTime,jdbcType= TIMESTAMP }
|
|
|
+ ,#{downTime,jdbcType= TIMESTAMP }
|
|
|
+ ,#{upStationId,jdbcType=VARCHAR}
|
|
|
+ ,#{downStationId,jdbcType=VARCHAR}
|
|
|
+ ,#{status,jdbcType=VARCHAR}
|
|
|
+ ,#{payStatus,jdbcType=VARCHAR}
|
|
|
+ ,#{createBy,jdbcType=VARCHAR}
|
|
|
+ ,#{createTime,jdbcType= TIMESTAMP }
|
|
|
+ ,#{updateBy,jdbcType=VARCHAR}
|
|
|
+ ,#{updateTime,jdbcType= TIMESTAMP }
|
|
|
+ ,#{delFlag,jdbcType= NUMERIC }
|
|
|
+ ,#{ticketUpStationId,jdbcType=VARCHAR}
|
|
|
+ ,#{ticketDownStationId,jdbcType=VARCHAR}
|
|
|
)
|
|
|
]]>
|
|
|
- </insert>
|
|
|
- <delete id="delete" parameterType="string">
|
|
|
- delete from bus_passenger_info where id_=#{id,jdbcType=VARCHAR}
|
|
|
- </delete>
|
|
|
- <update id="update" parameterType="com.jpsoft.bus.modules.bus.entity.PassengerInfo">
|
|
|
- update bus_passenger_info
|
|
|
- <set>
|
|
|
- <if test="vehicleShiftId!=null">
|
|
|
- vehicle_shift_id=#{vehicleShiftId,jdbcType=VARCHAR},
|
|
|
- </if>
|
|
|
- <if test="vehiclePersonId!=null">
|
|
|
- vehicle_person_id=#{vehiclePersonId,jdbcType= NUMERIC },
|
|
|
- </if>
|
|
|
- <if test="userId!=null">
|
|
|
- user_id=#{userId,jdbcType= NUMERIC },
|
|
|
- </if>
|
|
|
- <if test="imageUrl!=null">
|
|
|
- image_url=#{imageUrl,jdbcType=VARCHAR},
|
|
|
- </if>
|
|
|
- <if test="upTime!=null">
|
|
|
- up_time=#{upTime,jdbcType= TIMESTAMP },
|
|
|
- </if>
|
|
|
- <if test="downTime!=null">
|
|
|
- down_time=#{downTime,jdbcType= TIMESTAMP },
|
|
|
- </if>
|
|
|
- <if test="upStationId!=null">
|
|
|
- up_station_id=#{upStationId,jdbcType=VARCHAR},
|
|
|
- </if>
|
|
|
- <if test="downStationId!=null">
|
|
|
- down_station_id=#{downStationId,jdbcType=VARCHAR},
|
|
|
- </if>
|
|
|
- <if test="status!=null">
|
|
|
- status_=#{status,jdbcType=VARCHAR},
|
|
|
- </if>
|
|
|
- <if test="payStatus!=null">
|
|
|
- pay_status=#{payStatus,jdbcType=VARCHAR},
|
|
|
- </if>
|
|
|
- <if test="createBy!=null">
|
|
|
- create_by=#{createBy,jdbcType=VARCHAR},
|
|
|
- </if>
|
|
|
- <if test="createTime!=null">
|
|
|
- create_time=#{createTime,jdbcType= TIMESTAMP },
|
|
|
- </if>
|
|
|
- <if test="updateBy!=null">
|
|
|
- update_by=#{updateBy,jdbcType=VARCHAR},
|
|
|
- </if>
|
|
|
- <if test="updateTime!=null">
|
|
|
- update_time=#{updateTime,jdbcType= TIMESTAMP },
|
|
|
- </if>
|
|
|
- <if test="delFlag!=null">
|
|
|
- del_flag=#{delFlag,jdbcType= NUMERIC },
|
|
|
- </if>
|
|
|
- <if test="ticketUpStationId!=null">
|
|
|
- ticket_up_station_id=#{ticketUpStationId,jdbcType=VARCHAR},
|
|
|
- </if>
|
|
|
- <if test="ticketDownStationId!=null">
|
|
|
- ticket_down_station_id=#{ticketDownStationId,jdbcType=VARCHAR},
|
|
|
- </if>
|
|
|
+ </insert>
|
|
|
+ <delete id="delete" parameterType="string">
|
|
|
+ delete from bus_passenger_info where id_=#{id,jdbcType=VARCHAR}
|
|
|
+ </delete>
|
|
|
+ <update id="update" parameterType="com.jpsoft.bus.modules.bus.entity.PassengerInfo">
|
|
|
+ update bus_passenger_info
|
|
|
+ <set>
|
|
|
+ <if test="vehicleShiftId!=null">
|
|
|
+ vehicle_shift_id=#{vehicleShiftId,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="vehicleLibId!=null">
|
|
|
+ vehicle_person_id=#{vehiclePersonId,jdbcType= NUMERIC },
|
|
|
+ </if>
|
|
|
+ <if test="vehiclePersonId!=null">
|
|
|
+ vehicle_person_id=#{vehiclePersonId,jdbcType= NUMERIC },
|
|
|
+ </if>
|
|
|
+ <if test="userId!=null">
|
|
|
+ user_id=#{userId,jdbcType= NUMERIC },
|
|
|
+ </if>
|
|
|
+ <if test="imageUrl!=null">
|
|
|
+ image_url=#{imageUrl,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="upTime!=null">
|
|
|
+ up_time=#{upTime,jdbcType= TIMESTAMP },
|
|
|
+ </if>
|
|
|
+ <if test="downTime!=null">
|
|
|
+ down_time=#{downTime,jdbcType= TIMESTAMP },
|
|
|
+ </if>
|
|
|
+ <if test="upStationId!=null">
|
|
|
+ up_station_id=#{upStationId,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="downStationId!=null">
|
|
|
+ down_station_id=#{downStationId,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="status!=null">
|
|
|
+ status_=#{status,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="payStatus!=null">
|
|
|
+ pay_status=#{payStatus,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="createBy!=null">
|
|
|
+ create_by=#{createBy,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="createTime!=null">
|
|
|
+ create_time=#{createTime,jdbcType= TIMESTAMP },
|
|
|
+ </if>
|
|
|
+ <if test="updateBy!=null">
|
|
|
+ update_by=#{updateBy,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="updateTime!=null">
|
|
|
+ update_time=#{updateTime,jdbcType= TIMESTAMP },
|
|
|
+ </if>
|
|
|
+ <if test="delFlag!=null">
|
|
|
+ del_flag=#{delFlag,jdbcType= NUMERIC },
|
|
|
+ </if>
|
|
|
+ <if test="ticketUpStationId!=null">
|
|
|
+ ticket_up_station_id=#{ticketUpStationId,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="ticketDownStationId!=null">
|
|
|
+ ticket_down_station_id=#{ticketDownStationId,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
|
|
|
- </set>
|
|
|
- where id_=#{id}
|
|
|
- </update>
|
|
|
- <select id="get" parameterType="string" resultMap="PassengerInfoMap">
|
|
|
- select * from bus_passenger_info where id_=#{0}
|
|
|
- </select>
|
|
|
- <select id="exist" parameterType="string" resultType="int">
|
|
|
- select count(*) from bus_passenger_info where id_=#{0}
|
|
|
- </select>
|
|
|
- <select id="list" resultMap="PassengerInfoMap">
|
|
|
- select * from bus_passenger_info
|
|
|
- </select>
|
|
|
- <select id="search" parameterType="hashmap" resultMap="PassengerInfoMap">
|
|
|
- <![CDATA[
|
|
|
+ </set>
|
|
|
+ where id_=#{id}
|
|
|
+ </update>
|
|
|
+ <select id="get" parameterType="string" resultMap="PassengerInfoMap">
|
|
|
+ select * from bus_passenger_info where id_=#{0}
|
|
|
+ </select>
|
|
|
+ <select id="exist" parameterType="string" resultType="int">
|
|
|
+ select count(*) from bus_passenger_info where id_=#{0}
|
|
|
+ </select>
|
|
|
+ <select id="list" resultMap="PassengerInfoMap">
|
|
|
+ select * from bus_passenger_info
|
|
|
+ </select>
|
|
|
+ <select id="search" parameterType="hashmap" resultMap="PassengerInfoMap">
|
|
|
+ <![CDATA[
|
|
|
SELECT
|
|
|
a.*,
|
|
|
b.name_ AS user_name,
|
|
@@ -147,61 +153,61 @@
|
|
|
LEFT JOIN bus_station_info e ON a.ticket_up_station_id = e.id_
|
|
|
LEFT JOIN bus_station_info f ON a.ticket_down_station_id = f.id_
|
|
|
]]>
|
|
|
- <where>
|
|
|
- a.del_flag = 0
|
|
|
- <if test="searchParams.id != null">
|
|
|
- and a.ID_ like #{searchParams.id}
|
|
|
- </if>
|
|
|
- <if test="searchParams.vehiclePersonId != null">
|
|
|
- and a.vehicle_person_id = #{searchParams.vehiclePersonId}
|
|
|
- </if>
|
|
|
- <if test="searchParams.userId != null">
|
|
|
- and a.user_id = #{searchParams.userId
|
|
|
- </if>
|
|
|
- <if test="searchParams.userName != null">
|
|
|
- and b.name_ like #{searchParams.userName}
|
|
|
- </if>
|
|
|
- <if test="searchParams.payStatus != null">
|
|
|
- and a.pay_status = #{searchParams.payStatus}
|
|
|
- </if>
|
|
|
- <if test="searchParams.vehicleShiftId != null">
|
|
|
- and a.vehicle_shift_id = #{searchParams.vehicleShiftId}
|
|
|
- </if>
|
|
|
- <if test="searchParams.status != null">
|
|
|
- and a.status_ = #{searchParams.status}
|
|
|
- </if>
|
|
|
- <if test="searchParams.statusList != null">
|
|
|
- and a.status_ in
|
|
|
- <foreach collection="searchParams.statusList" item="status" open="(" separator="," close=")">
|
|
|
- #{status}
|
|
|
- </foreach>
|
|
|
- </if>
|
|
|
- <if test="searchParams.notPayStatus != null">
|
|
|
- and a.pay_status != #{searchParams.notPayStatus}
|
|
|
- </if>
|
|
|
- <if test="searchParams.downStationId != null">
|
|
|
- and a.down_station_id = #{searchParams.downStationId}
|
|
|
- </if>
|
|
|
- </where>
|
|
|
- <foreach item="sort" collection="sortList" open="order by" separator=",">
|
|
|
- ${sort.name} ${sort.order}
|
|
|
- </foreach>
|
|
|
- </select>
|
|
|
+ <where>
|
|
|
+ a.del_flag = 0
|
|
|
+ <if test="searchParams.id != null">
|
|
|
+ and a.ID_ like #{searchParams.id}
|
|
|
+ </if>
|
|
|
+ <if test="searchParams.vehiclePersonId != null">
|
|
|
+ and a.vehicle_person_id = #{searchParams.vehiclePersonId}
|
|
|
+ </if>
|
|
|
+ <if test="searchParams.userId != null">
|
|
|
+ and a.user_id = #{searchParams.userId
|
|
|
+ </if>
|
|
|
+ <if test="searchParams.userName != null">
|
|
|
+ and b.name_ like #{searchParams.userName}
|
|
|
+ </if>
|
|
|
+ <if test="searchParams.payStatus != null">
|
|
|
+ and a.pay_status = #{searchParams.payStatus}
|
|
|
+ </if>
|
|
|
+ <if test="searchParams.vehicleShiftId != null">
|
|
|
+ and a.vehicle_shift_id = #{searchParams.vehicleShiftId}
|
|
|
+ </if>
|
|
|
+ <if test="searchParams.status != null">
|
|
|
+ and a.status_ = #{searchParams.status}
|
|
|
+ </if>
|
|
|
+ <if test="searchParams.statusList != null">
|
|
|
+ and a.status_ in
|
|
|
+ <foreach collection="searchParams.statusList" item="status" open="(" separator="," close=")">
|
|
|
+ #{status}
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
+ <if test="searchParams.notPayStatus != null">
|
|
|
+ and a.pay_status != #{searchParams.notPayStatus}
|
|
|
+ </if>
|
|
|
+ <if test="searchParams.downStationId != null">
|
|
|
+ and a.down_station_id = #{searchParams.downStationId}
|
|
|
+ </if>
|
|
|
+ </where>
|
|
|
+ <foreach item="sort" collection="sortList" open="order by" separator=",">
|
|
|
+ ${sort.name} ${sort.order}
|
|
|
+ </foreach>
|
|
|
+ </select>
|
|
|
|
|
|
- <select id="findByPersonIdShiftIdStatus" resultMap="PassengerInfoMap">
|
|
|
- <![CDATA[
|
|
|
+ <select id="findByPersonIdShiftIdStatus" resultMap="PassengerInfoMap">
|
|
|
+ <![CDATA[
|
|
|
select * from bus_passenger_info
|
|
|
where del_flag = 0
|
|
|
and vehicle_person_id = #{personId}
|
|
|
and vehicle_shift_id = #{shiftId}
|
|
|
]]>
|
|
|
- <if test="status!=null">
|
|
|
- and status_ = #{status}
|
|
|
- </if>
|
|
|
- </select>
|
|
|
+ <if test="status!=null">
|
|
|
+ and status_ = #{status}
|
|
|
+ </if>
|
|
|
+ </select>
|
|
|
|
|
|
- <select id="findByShiftStatusPayStatusNotTicketDown" resultMap="PassengerInfoMap">
|
|
|
- <![CDATA[
|
|
|
+ <select id="findByShiftStatusPayStatusNotTicketDown" resultMap="PassengerInfoMap">
|
|
|
+ <![CDATA[
|
|
|
select * from bus_passenger_info
|
|
|
where del_flag = 0
|
|
|
and vehicle_shift_id = #{shiftId}
|
|
@@ -209,5 +215,5 @@
|
|
|
and pay_status = #{payStatus}
|
|
|
and ticket_down_station_id <> #{ticketDownStationId}
|
|
|
]]>
|
|
|
- </select>
|
|
|
+ </select>
|
|
|
</mapper>
|