123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899 |
- <?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.supplier.mapper.ReleaseMapper">
- <!-- 供应商发布路线 -->
- <insert id="addReleaseVal" parameterType="SupplierRoute">
- insert into bus_supplier_route(code,origin,destination,start_time,end_time,look_num,title_img,offer_name,price_all,people_num,uuid,jdrq,update_date,title_day_name,state_type)
- values(#{code},#{origin},#{destination},#{startTime},#{endTime},0,#{titleImg},#{offerName},#{priceAll},#{peopleNum},#{uuid},CONVERT(VARCHAR(100), SYSDATETIME(), 20),CONVERT(VARCHAR(100), SYSDATETIME(), 20),#{titleDayName},'1')
- </insert>
- <!-- 查询路线发布 -->
- <select id="getRelease" parameterType="SupplierRoute" resultType="SupplierRoute">
- select top ${limit} * from bus_supplier_route
- <trim prefix="WHERE" prefixOverrides="and | or">
- <if test="startTime != null and startTime !=''">
- and CONVERT (datetime, start_time) <![CDATA[ >= ]]> #{startTime} and CONVERT(datetime, end_time) <![CDATA[ <= ]]> #{endTime}
- </if>
- <if test="destination != null and destination !=''">
- and destination = #{destination}
- </if>
- <if test="code != null and code !=''">
- and code = #{code}
- </if>
- and state_type = '1'
- and id not in (select top ${page} id from bus_supplier_route
- <trim prefix="WHERE" prefixOverrides="and | or">
- <if test="startTime != null and startTime !=''">
- and CONVERT (datetime, start_time) <![CDATA[ >= ]]> #{startTime} and CONVERT(datetime, end_time) <![CDATA[ <= ]]> #{endTime}
- </if>
- <if test="destination != null and destination !=''">
- and destination = #{destination}
- </if>
- <if test="code != null and code !=''">
- and code = #{code}
- </if>
- </trim>
- order by id desc
- ) order by id desc
- </trim>
- </select>
- <!-- 查询路线条数 -->
- <select id="getReleaseCount" resultType="int" parameterType="SupplierRoute">
- select count(*) as count from bus_supplier_route
- <trim prefix="WHERE" prefixOverrides="and | or">
- <if test="startTime != null and startTime !=''">
- and CONVERT (datetime, start_time) <![CDATA[ >= ]]> #{startTime} and CONVERT(datetime, end_time) <![CDATA[ <= ]]> #{endTime}
- </if>
- <if test="destination != null and destination !=''">
- and destination = #{destination}
- </if>
- <if test="code != null and code !=''">
- and code = #{code}
- </if>
- and state_type = '1'
- </trim>
- </select>
- <!-- 查询路线条数 -->
- <select id="getReleaseVal" resultType="SupplierRoute" parameterType="SupplierRoute">
- select * from bus_supplier_route
- <trim prefix="WHERE" prefixOverrides="and | or">
- <if test="uuid != null and uuid !=''">
- and uuid = #{uuid}
- </if>
- </trim>
- </select>
- <!-- 修改路线 -->
- <update id="updateSupplierRoute" parameterType="SupplierRoute">
- update bus_supplier_route
- <set>
- <trim suffixOverrides=",">
- <if test="origin != null and origin != ''">
- origin = #{origin},
- </if>
- <if test="destination != null and destination != ''">
- destination = #{destination},
- </if>
- <if test="startTime != null and startTime != ''">
- start_time = #{startTime},
- </if>
- <if test="endTime != null and endTime != ''">
- end_time = #{endTime},
- </if>
- <if test="titleImg != null and titleImg != ''">
- title_img = #{titleImg},
- </if>
- <if test="offerName != null and offerName != ''">
- offer_name = #{offerName},
- </if>
- <if test="priceAll != null and priceAll != ''">
- price_all = #{priceAll},
- </if>
- <if test="peopleNum != null and peopleNum != ''">
- people_num = #{peopleNum},
- </if>
- update_date = SYSDATETIME(),
- </trim>
- where uuid = #{uuid}
- </set>
- </update>
- </mapper>
|