SellCarTradeMapper.xml 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
  3. <mapper namespace="com.jkcredit.invoice.mapper.waybill.SellCarTradeMapper">
  4. <!-- 通用查询映射结果 -->
  5. <resultMap id="BaseResultMap" type="com.jkcredit.invoice.model.entity.waybill.SelfCarTrade">
  6. <id column="id" property="id"/>
  7. <result column="customId" property="customId"/>
  8. <result column="companyNum" property="companyNum"/>
  9. <result column="cardId" property="cardId"/>
  10. <result column="tradeId" property="tradeId"/>
  11. <result column="exTime" property="exTime"/>
  12. <result column="aclTime" property="aclTime"/>
  13. <result column="fee" property="fee"/>
  14. <result column="status" property="status"/>
  15. <result column="applId" property="applId"/>
  16. <result column="companyName" property="companyName"/>
  17. <result column="companyReferencenum" property="companyReferencenum"/>
  18. </resultMap>
  19. <sql id="baseSql">
  20. id,
  21. customId,
  22. companyNum,
  23. cardId,
  24. tradeId,
  25. exTime,
  26. fee,
  27. status,
  28. applId,
  29. aclTime,
  30. companyName,
  31. companyReferencenum
  32. </sql>
  33. <select id="selectAllByPage" resultMap="BaseResultMap">
  34. select
  35. <include refid="baseSql" />
  36. from t_SellCarTrade
  37. <where>
  38. <if test="sellCarTrade.companyName != null and sellCarTrade.companyName != ''">
  39. and companyName LIKE CONCAT('%',#{sellCarTrade.companyName},'%')
  40. </if>
  41. <if test="sellCarTrade.cardId != null and sellCarTrade.cardId != ''">
  42. and cardId = #{sellCarTrade.cardId}
  43. </if>
  44. <if test="sellCarTrade.companyReferencenum != null and sellCarTrade.companyReferencenum != ''">
  45. and companyReferencenum = #{sellCarTrade.companyReferencenum}
  46. </if>
  47. <if test="sellCarTrade.tradeId != null and sellCarTrade.tradeId != ''">
  48. and tradeId = #{sellCarTrade.tradeId}
  49. </if>
  50. <if test="sellCarTrade.status != null and sellCarTrade.status != ''">
  51. and status = #{sellCarTrade.status}
  52. </if>
  53. <if test="sellCarTrade.exTimeBegin != null and sellCarTrade.exTimeBegin != ''">
  54. and exTime BETWEEN #{sellCarTrade.exTimeBegin} and #{sellCarTrade.exTimeEnd}
  55. </if>
  56. <if test="sellCarTrade.aclTimeBegin != null and sellCarTrade.aclTimeBegin != ''">
  57. and aclTime BETWEEN #{sellCarTrade.aclTimeBegin} and #{sellCarTrade.aclTimeEnd}
  58. </if>
  59. <if test="sellCarTrade.exceptionFlag != null and sellCarTrade.exceptionFlag != ''">
  60. and date_add(aclTime,interval 10 day)>now() and status=2
  61. </if>
  62. </where>
  63. </select>
  64. <select id="selectByTradeId" resultMap="BaseResultMap" parameterType="java.lang.String">
  65. select
  66. <include refid="baseSql" />
  67. from t_SellCarTrade where tradeId = #{tradeId,jdbcType=VARCHAR}
  68. </select>
  69. <insert id="insert" parameterType="com.jkcredit.invoice.model.entity.waybill.SelfCarTrade" >
  70. insert into t_SellCarTrade (
  71. customId,
  72. companyNum,
  73. cardId,
  74. tradeId,
  75. exTime,
  76. fee,
  77. status,
  78. applId,
  79. aclTime,
  80. companyName,
  81. companyReferencenum
  82. )
  83. values ( #{customId,jdbcType=VARCHAR}, #{companyNum,jdbcType=VARCHAR},
  84. #{cardId,jdbcType=VARCHAR}, #{tradeId,jdbcType=VARCHAR}, #{exTime,jdbcType=VARCHAR},
  85. #{fee,jdbcType=INTEGER}, #{status,jdbcType=INTEGER}, #{applId,jdbcType=VARCHAR},#{aclTime,jdbcType=VARCHAR},
  86. #{companyName,jdbcType=VARCHAR},#{companyReferencenum,jdbcType=VARCHAR}
  87. )
  88. </insert>
  89. <update id="updateByPrimaryKey" parameterType="com.jkcredit.invoice.model.entity.waybill.SelfCarTrade" >
  90. update t_SellCarTrade
  91. set customId = #{customId,jdbcType=VARCHAR},
  92. companyNum = #{companyNum,jdbcType=VARCHAR},
  93. cardId = #{cardId,jdbcType=VARCHAR},
  94. tradeId = #{tradeId,jdbcType=VARCHAR},
  95. exTime = #{exTime,jdbcType=VARCHAR},
  96. fee = #{fee,jdbcType=INTEGER},
  97. status = #{status,jdbcType=INTEGER},
  98. applId = #{applId,jdbcType=VARCHAR},
  99. aclTime = #{aclTime,jdbcType=VARCHAR},
  100. companyName = #{companyName,jdbcType=VARCHAR},
  101. companyReferencenum = #{companyReferencenum,jdbcType=VARCHAR}
  102. where id = #{id,jdbcType=INTEGER}
  103. </update>
  104. <update id="updateByTradeId" parameterType="com.jkcredit.invoice.model.entity.waybill.SelfCarTrade" >
  105. update t_SellCarTrade
  106. set customId = #{customId,jdbcType=VARCHAR},
  107. companyNum = #{companyNum,jdbcType=VARCHAR},
  108. cardId = #{cardId,jdbcType=VARCHAR},
  109. tradeId = #{tradeId,jdbcType=VARCHAR},
  110. exTime = #{exTime,jdbcType=VARCHAR},
  111. fee = #{fee,jdbcType=INTEGER},
  112. status = #{status,jdbcType=INTEGER},
  113. applId = #{applId,jdbcType=VARCHAR},
  114. aclTime = #{aclTime,jdbcType=VARCHAR},
  115. companyName = #{companyName,jdbcType=VARCHAR},
  116. companyReferencenum = #{companyReferencenum,jdbcType=VARCHAR}
  117. where tradeId = #{tradeId,jdbcType=INTEGER}
  118. </update>
  119. <select id="selectByCardId" resultMap="BaseResultMap" parameterType="java.lang.String" >
  120. select
  121. <include refid="baseSql" />
  122. from t_SellCarTrade
  123. where cardId = #{cardId,jdbcType=VARCHAR}
  124. </select>
  125. </mapper>