NoCarWaybillMapper.xml 10.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219
  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.NoCarWaybillMapper">
  4. <!-- 通用查询映射结果 -->
  5. <resultMap id="BaseResultMap" type="com.jkcredit.invoice.model.entity.waybill.NoCarWayBill">
  6. <id column="id" property="id"/>
  7. <result column="customerName" property="customerName"/>
  8. <result column="companyName" property="companyName"/>
  9. <result column="billNum" property="billNum"/>
  10. <result column="plateNum" property="plateNum"/>
  11. <result column="plateColor" property="plateColor"/>
  12. <result column="startTime" property="startTime"/>
  13. <result column="sourceAddr" property="sourceAddr"/>
  14. <result column="destAddr" property="destAddr"/>
  15. <result column="predictEndTime" property="predictEndTime"/>
  16. <result column="fee" property="fee"/>
  17. <result column="hisFlag" property="hisFlag"></result>
  18. <result column="billwayStatus" property="billwayStatus"></result>
  19. <result column="titleType" property="titleType"/>
  20. <result column="taxplayerCode" property="taxplayerCode"/>
  21. <result column="intfaceStartTime" property="intfaceStartTime"/>
  22. <result column="interfaceEndTime" property="interfaceEndTime"/>
  23. <result column="companyAdress" property="companyAdress"/>
  24. <result column="companyBank" property="companyBank"/>
  25. <result column="companyBankAcc" property="companyBankAcc"/>
  26. <result column="companyTel" property="companyTel"/>
  27. <result column="updateTime" property="updateTime"/>
  28. </resultMap>
  29. <sql id="baseSql">
  30. id,
  31. customerName,
  32. companyName,
  33. billNum,
  34. plateNum,
  35. plateColor,
  36. startTime,
  37. sourceAddr,
  38. destAddr,
  39. predictEndTime,
  40. fee,
  41. titleType,
  42. taxplayerCode,
  43. intfaceStartTime,
  44. interfaceEndTime,
  45. billwayStatus,
  46. hisFlag,
  47. companyAdress,
  48. companyBank,
  49. companyBankAcc,
  50. companyTel,companyNum,updateTime
  51. </sql>
  52. <select id="selectAllByPage" resultMap="BaseResultMap">
  53. select
  54. <include refid="baseSql" />
  55. from t_waybill_no
  56. <where>
  57. 1 = 1
  58. <if test="noCarWayBill.hisFlag != null">
  59. and hisFlag = #{noCarWayBill.hisFlag,jdbcType=INTEGER}
  60. </if>
  61. <if test="noCarWayBill.companyName != null and noCarWayBill.companyName != ''">
  62. and companyName LIKE CONCAT('%',#{noCarWayBill.companyName},'%')
  63. </if>
  64. <if test="noCarWayBill.billNum != null and noCarWayBill.billNum != ''">
  65. and billNum = #{noCarWayBill.billNum}
  66. </if>
  67. <if test="noCarWayBill.taxplayerCode != null and noCarWayBill.taxplayerCode != ''">
  68. and taxplayerCode = #{noCarWayBill.taxplayerCode}
  69. </if>
  70. <if test="noCarWayBill.billwayStatus != null and noCarWayBill.billwayStatus != ''">
  71. and billwayStatus = #{noCarWayBill.billwayStatus}
  72. </if>
  73. <if test="noCarWayBill.startBegin != null and noCarWayBill.startBegin != ''">
  74. and intfaceStartTime BETWEEN #{noCarWayBill.startBegin} and #{noCarWayBill.startEnd}
  75. </if>
  76. <if test="noCarWayBill.endBegin != null and noCarWayBill.endBegin != ''">
  77. and interfaceEndTime BETWEEN #{noCarWayBill.endBegin} and #{noCarWayBill.endEnd}
  78. </if>
  79. <if test="noCarWayBill.batchNum != null and noCarWayBill.batchNum != ''">
  80. and batchNumber = #{noCarWayBill.batchNum}
  81. </if>
  82. <if test="noCarWayBill.batchNumEnd != null and noCarWayBill.batchNumEnd != ''">
  83. and batchNumEnd = #{noCarWayBill.batchNumEnd}
  84. </if>
  85. </where>
  86. </select>
  87. <select id="selectAllByPageException" resultMap="BaseResultMap">
  88. select
  89. <include refid="baseSql" />
  90. from t_waybill_no
  91. <where>
  92. <if test="noCarWayBill.companyName != null and noCarWayBill.companyName != ''">
  93. and companyName LIKE CONCAT('%',#{noCarWayBill.companyName},'%')
  94. </if>
  95. <if test="noCarWayBill.billNum != null and noCarWayBill.billNum != ''">
  96. and billNum = #{noCarWayBill.billNum}
  97. </if>
  98. <if test="noCarWayBill.taxplayerCode != null and noCarWayBill.taxplayerCode != ''">
  99. and taxplayerCode = #{noCarWayBill.taxplayerCode}
  100. </if>
  101. <if test="noCarWayBill.startBegin != null and noCarWayBill.startBegin != ''">
  102. and intfaceStartTime BETWEEN #{noCarWayBill.startBegin} and #{noCarWayBill.startEnd}
  103. </if>
  104. <if test="noCarWayBill.endBegin != null and noCarWayBill.endBegin != ''">
  105. and interfaceEndTime BETWEEN #{noCarWayBill.endBegin} and #{noCarWayBill.endEnd}
  106. </if>
  107. and billwayStatus =4
  108. </where>
  109. </select>
  110. <insert id="insert" parameterType="com.jkcredit.invoice.model.entity.waybill.NoCarWayBill" >
  111. insert into t_waybill_no (
  112. customerName,
  113. companyName,
  114. billNum,
  115. plateNum,
  116. plateColor,
  117. startTime,
  118. sourceAddr,
  119. destAddr,
  120. predictEndTime,
  121. fee,
  122. titleType,
  123. taxplayerCode,
  124. intfaceStartTime,
  125. interfaceEndTime,
  126. billwayStatus,
  127. hisFlag,
  128. companyAdress,
  129. companyBank,
  130. companyBankAcc,
  131. companyTel,companyNum,updateTime,batchNumber,batchNumEnd
  132. )
  133. values ( #{customerName,jdbcType=VARCHAR}, #{companyName,jdbcType=VARCHAR},
  134. #{billNum,jdbcType=VARCHAR}, #{plateNum,jdbcType=VARCHAR}, #{plateColor,jdbcType=VARCHAR},
  135. #{startTime,jdbcType=VARCHAR}, #{sourceAddr,jdbcType=VARCHAR}, #{destAddr,jdbcType=VARCHAR},
  136. #{predictEndTime,jdbcType=VARCHAR}, #{fee,jdbcType=INTEGER}, #{titleType,jdbcType=INTEGER},
  137. #{taxplayerCode,jdbcType=VARCHAR},#{intfaceStartTime,jdbcType=VARCHAR},#{interfaceEndTime,jdbcType=VARCHAR},
  138. #{billwayStatus,jdbcType=INTEGER},#{hisFlag,jdbcType=INTEGER}, #{companyAdress,jdbcType=VARCHAR}, #{companyBank,jdbcType=VARCHAR}
  139. , #{companyBankAcc,jdbcType=VARCHAR}, #{companyTel,jdbcType=VARCHAR},#{companyNum,jdbcType=VARCHAR},#{updateTime,jdbcType=VARCHAR},#{batchNum,jdbcType=VARCHAR},#{batchNumEnd,jdbcType=VARCHAR}
  140. )
  141. </insert>
  142. <update id="updateByPrimaryKey" parameterType="com.jkcredit.invoice.model.entity.waybill.NoCarWayBill" >
  143. update t_waybill_no
  144. set customerName = #{customerName,jdbcType=VARCHAR},
  145. companyName = #{companyName,jdbcType=VARCHAR},
  146. billNum = #{billNum,jdbcType=VARCHAR},
  147. plateNum = #{plateNum,jdbcType=VARCHAR},
  148. plateColor = #{plateColor,jdbcType=VARCHAR},
  149. startTime = #{startTime,jdbcType=VARCHAR},
  150. sourceAddr = #{sourceAddr,jdbcType=VARCHAR},
  151. destAddr = #{destAddr,jdbcType=VARCHAR},
  152. predictEndTime = #{predictEndTime,jdbcType=VARCHAR},
  153. fee = #{fee,jdbcType=INTEGER},
  154. titleType = #{titleType,jdbcType=INTEGER},
  155. taxplayerCode = #{taxplayerCode,jdbcType=VARCHAR},
  156. intfaceStartTime = #{intfaceStartTime,jdbcType=VARCHAR},
  157. interfaceEndTime = #{interfaceEndTime,jdbcType=VARCHAR},
  158. billwayStatus = #{billwayStatus,jdbcType=INTEGER},
  159. hisFlag = #{hisFlag,jdbcType=INTEGER},
  160. companyAdress = #{companyAdress,jdbcType=VARCHAR},
  161. companyBank = #{companyBank,jdbcType=VARCHAR},
  162. companyBankAcc = #{companyBankAcc,jdbcType=VARCHAR},
  163. companyTel = #{companyTel,jdbcType=VARCHAR},
  164. companyNum = #{companyNum,jdbcType=VARCHAR}
  165. where id = #{id,jdbcType=INTEGER}
  166. </update>
  167. <update id="updateByBillNum" parameterType="com.jkcredit.invoice.model.entity.waybill.NoCarWayBill" >
  168. update t_waybill_no
  169. set customerName = #{customerName,jdbcType=VARCHAR},
  170. companyName = #{companyName,jdbcType=VARCHAR},
  171. billNum = #{billNum,jdbcType=VARCHAR},
  172. plateNum = #{plateNum,jdbcType=VARCHAR},
  173. plateColor = #{plateColor,jdbcType=VARCHAR},
  174. startTime = #{startTime,jdbcType=VARCHAR},
  175. sourceAddr = #{sourceAddr,jdbcType=VARCHAR},
  176. destAddr = #{destAddr,jdbcType=VARCHAR},
  177. predictEndTime = #{predictEndTime,jdbcType=VARCHAR},
  178. fee = #{fee,jdbcType=INTEGER},
  179. titleType = #{titleType,jdbcType=INTEGER},
  180. taxplayerCode = #{taxplayerCode,jdbcType=VARCHAR},
  181. intfaceStartTime = #{intfaceStartTime,jdbcType=VARCHAR},
  182. interfaceEndTime = #{interfaceEndTime,jdbcType=VARCHAR},
  183. billwayStatus = #{billwayStatus,jdbcType=INTEGER},
  184. hisFlag = #{hisFlag,jdbcType=INTEGER},
  185. companyAdress = #{companyAdress,jdbcType=VARCHAR},
  186. companyBank = #{companyBank,jdbcType=VARCHAR},
  187. companyBankAcc = #{companyBankAcc,jdbcType=VARCHAR},
  188. companyTel = #{companyTel,jdbcType=VARCHAR},
  189. companyNum = #{companyNum,jdbcType=VARCHAR}
  190. where billNum = #{billNum,jdbcType=VARCHAR}
  191. </update>
  192. <select id="selectByBillNum" resultMap="BaseResultMap" parameterType="java.lang.String" >
  193. select
  194. <include refid="baseSql" />
  195. from t_waybill_no
  196. where billNum = #{billNum,jdbcType=VARCHAR}
  197. </select>
  198. <select id="selectByHisFlagAndBillStatus" resultMap="BaseResultMap" parameterType="com.jkcredit.invoice.model.entity.waybill.NoCarWayBill" >
  199. select
  200. <include refid="baseSql" />
  201. from t_waybill_no
  202. where hisFlag = #{hisFlag,jdbcType=INTEGER} and billwayStatus = #{billwayStatus,jdbcType=INTEGER}
  203. </select>
  204. <select id="getNoCarNoVoiceQuery" resultMap="BaseResultMap" parameterType="java.lang.String" >
  205. select
  206. <include refid="baseSql" />
  207. from t_waybill_no
  208. where customerName = #{customerName,jdbcType=VARCHAR}
  209. </select>
  210. </mapper>