123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135 |
- <?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.jkcredit.invoice.mapper.waybill.SellCarTradeMapper">
- <!-- 通用查询映射结果 -->
- <resultMap id="BaseResultMap" type="com.jkcredit.invoice.model.entity.waybill.SelfCarTrade">
- <id column="id" property="id"/>
- <result column="customId" property="customId"/>
- <result column="companyNum" property="companyNum"/>
- <result column="cardId" property="cardId"/>
- <result column="tradeId" property="tradeId"/>
- <result column="exTime" property="exTime"/>
- <result column="aclTime" property="aclTime"/>
- <result column="fee" property="fee"/>
- <result column="status" property="status"/>
- <result column="applId" property="applId"/>
- <result column="companyName" property="companyName"/>
- <result column="companyReferencenum" property="companyReferencenum"/>
- </resultMap>
- <sql id="baseSql">
- id,
- customId,
- companyNum,
- cardId,
- tradeId,
- exTime,
- fee,
- status,
- applId,
- aclTime,
- companyName,
- companyReferencenum
- </sql>
- <select id="selectAllByPage" resultMap="BaseResultMap">
- select
- <include refid="baseSql" />
- from t_SellCarTrade
- <where>
- <if test="sellCarTrade.companyName != null and sellCarTrade.companyName != ''">
- and companyName LIKE CONCAT('%',#{sellCarTrade.companyName},'%')
- </if>
- <if test="sellCarTrade.cardId != null and sellCarTrade.cardId != ''">
- and cardId = #{sellCarTrade.cardId}
- </if>
- <if test="sellCarTrade.companyReferencenum != null and sellCarTrade.companyReferencenum != ''">
- and companyReferencenum = #{sellCarTrade.companyReferencenum}
- </if>
- <if test="sellCarTrade.tradeId != null and sellCarTrade.tradeId != ''">
- and tradeId = #{sellCarTrade.tradeId}
- </if>
- <if test="sellCarTrade.status != null and sellCarTrade.status != ''">
- and status = #{sellCarTrade.status}
- </if>
- <if test="sellCarTrade.exTimeBegin != null and sellCarTrade.exTimeBegin != ''">
- and exTime BETWEEN #{sellCarTrade.exTimeBegin} and #{sellCarTrade.exTimeEnd}
- </if>
- <if test="sellCarTrade.aclTimeBegin != null and sellCarTrade.aclTimeBegin != ''">
- and aclTime BETWEEN #{sellCarTrade.aclTimeBegin} and #{sellCarTrade.aclTimeEnd}
- </if>
- <if test="sellCarTrade.exceptionFlag != null and sellCarTrade.exceptionFlag != ''">
- and date_add(aclTime,interval 10 day)>now() and status=2
- </if>
- </where>
- </select>
- <select id="selectByTradeId" resultMap="BaseResultMap" parameterType="java.lang.String">
- select
- <include refid="baseSql" />
- from t_SellCarTrade where tradeId = #{tradeId,jdbcType=VARCHAR}
- </select>
- <insert id="insert" parameterType="com.jkcredit.invoice.model.entity.waybill.SelfCarTrade" >
- insert into t_SellCarTrade (
- customId,
- companyNum,
- cardId,
- tradeId,
- exTime,
- fee,
- status,
- applId,
- aclTime,
- companyName,
- companyReferencenum
- )
- values ( #{customId,jdbcType=VARCHAR}, #{companyNum,jdbcType=VARCHAR},
- #{cardId,jdbcType=VARCHAR}, #{tradeId,jdbcType=VARCHAR}, #{exTime,jdbcType=VARCHAR},
- #{fee,jdbcType=INTEGER}, #{status,jdbcType=INTEGER}, #{applId,jdbcType=VARCHAR},#{aclTime,jdbcType=VARCHAR},
- #{companyName,jdbcType=VARCHAR},#{companyReferencenum,jdbcType=VARCHAR}
- )
- </insert>
- <update id="updateByPrimaryKey" parameterType="com.jkcredit.invoice.model.entity.waybill.SelfCarTrade" >
- update t_SellCarTrade
- set customId = #{customId,jdbcType=VARCHAR},
- companyNum = #{companyNum,jdbcType=VARCHAR},
- cardId = #{cardId,jdbcType=VARCHAR},
- tradeId = #{tradeId,jdbcType=VARCHAR},
- exTime = #{exTime,jdbcType=VARCHAR},
- fee = #{fee,jdbcType=INTEGER},
- status = #{status,jdbcType=INTEGER},
- applId = #{applId,jdbcType=VARCHAR},
- aclTime = #{aclTime,jdbcType=VARCHAR},
- companyName = #{companyName,jdbcType=VARCHAR},
- companyReferencenum = #{companyReferencenum,jdbcType=VARCHAR}
- where id = #{id,jdbcType=INTEGER}
- </update>
- <update id="updateByTradeId" parameterType="com.jkcredit.invoice.model.entity.waybill.SelfCarTrade" >
- update t_SellCarTrade
- set customId = #{customId,jdbcType=VARCHAR},
- companyNum = #{companyNum,jdbcType=VARCHAR},
- cardId = #{cardId,jdbcType=VARCHAR},
- tradeId = #{tradeId,jdbcType=VARCHAR},
- exTime = #{exTime,jdbcType=VARCHAR},
- fee = #{fee,jdbcType=INTEGER},
- status = #{status,jdbcType=INTEGER},
- applId = #{applId,jdbcType=VARCHAR},
- aclTime = #{aclTime,jdbcType=VARCHAR},
- companyName = #{companyName,jdbcType=VARCHAR},
- companyReferencenum = #{companyReferencenum,jdbcType=VARCHAR}
- where tradeId = #{tradeId,jdbcType=INTEGER}
- </update>
- <select id="selectByCardId" resultMap="BaseResultMap" parameterType="java.lang.String" >
- select
- <include refid="baseSql" />
- from t_SellCarTrade
- where cardId = #{cardId,jdbcType=VARCHAR}
- </select>
- </mapper>
|