CustomerRecMapper.xml 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402
  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.customer.CustomerRecMapper" >
  4. <resultMap id="BaseResultMap" type="com.jkcredit.invoice.model.entity.customer.CustomerRec" >
  5. <id column="id" property="id" jdbcType="INTEGER" />
  6. <result column="customerName" property="customerName" jdbcType="VARCHAR" />
  7. <result column="company_leader" property="companyLeader" jdbcType="VARCHAR" />
  8. <result column="company_leader_Phone" property="companyLeaderPhone" jdbcType="VARCHAR" />
  9. <result column="company_name" property="companyName" jdbcType="VARCHAR" />
  10. <result column="company_referenceNum" property="companyReferencenum" jdbcType="VARCHAR" />
  11. <result column="company_openbank" property="companyOpenbank" jdbcType="VARCHAR" />
  12. <result column="company_openbank_acc" property="companyOpenbankAcc" jdbcType="VARCHAR" />
  13. <result column="company_adress" property="companyAdress" jdbcType="VARCHAR" />
  14. <result column="company_phone" property="companyPhone" jdbcType="VARCHAR" />
  15. <result column="createTime" property="createtime" jdbcType="VARCHAR" />
  16. <result column="company_belong_name" property="companyBelongName" jdbcType="VARCHAR" />
  17. <result column="rec_status" property="recStatus" jdbcType="INTEGER" />
  18. <result column="inter_type" property="interType" jdbcType="INTEGER" />
  19. <result column="bussiness_type" property="bussinessType" jdbcType="INTEGER" />
  20. <result column="company_type" property="companyType" jdbcType="INTEGER" />
  21. <result column="operating_rangeType" property="operatingRangeType" jdbcType="INTEGER" />
  22. <result column="company_num" property="companyNum" jdbcType="VARCHAR" />
  23. <result column="service_startTime" property="serviceStartTime" jdbcType="VARCHAR" />
  24. <result column="service_endTime" property="serviceEndTime" jdbcType="VARCHAR" />
  25. <result column="service_type" property="serviceType" jdbcType="INTEGER" />
  26. <result column="contractFileName" property="contractFileName" jdbcType="VARCHAR" />
  27. <result column="contractSuc" property="contractSuc" jdbcType="INTEGER" />
  28. <result column="base64Str" property="base64Str" jdbcType="VARCHAR" />
  29. <result column="contrantNum" property="contrantNum" jdbcType="VARCHAR" />
  30. <result column="lowerFileName" property="lowerFileName" jdbcType="VARCHAR" />
  31. <result column="lowerBase64Str" property="lowerBase64Str" jdbcType="VARCHAR" />
  32. </resultMap>
  33. <sql id="Base_Column_List" >
  34. id, customerName,company_leader, company_leader_Phone, company_name, company_referenceNum, company_openbank,
  35. company_openbank_acc, company_adress, company_phone, createTime, company_belong_name,
  36. rec_status, inter_type,bussiness_type,company_type,operating_rangeType,company_num,service_startTime
  37. ,service_endTime,service_type,contractFileName,contractSuc,contrantNum,lowerFileName,fileMessage
  38. </sql>
  39. <select id="selectAllByPage" resultMap="BaseResultMap">
  40. select
  41. <include refid="Base_Column_List" />
  42. from t_customer_rec
  43. <where>
  44. <if test="customerRec.customerName != null and customerRec.customerName != ''">
  45. AND customerName = BINARY #{customerRec.customerName}
  46. </if>
  47. <if test="customerRec.companyLeaderPhone != null and customerRec.companyLeaderPhone != ''">
  48. and company_leader_Phone = BINARY #{customerRec.companyLeaderPhone}
  49. </if>
  50. <if test="customerRec.companyReferencenum != null and customerRec.companyReferencenum != ''">
  51. and company_referenceNum = BINARY #{customerRec.companyReferencenum}
  52. </if>
  53. <if test="customerRec.companyName != null and customerRec.companyName != ''">
  54. and company_name LIKE BINARY CONCAT('%',#{customerRec.companyName},'%')
  55. </if>
  56. <if test="customerRec.companyBelongName != null and customerRec.companyBelongName != ''">
  57. and company_belong_name LIKE CONCAT('%',#{customerRec.companyBelongName},'%')
  58. </if>
  59. <if test="customerRec.serviceEndTimeStart != null and customerRec.serviceEndTimeStart != ''">
  60. and service_endTime BETWEEN #{customerRec.serviceEndTimeStart} and #{customerRec.serviceEndTimeEnd}
  61. </if>
  62. </where>
  63. order by id DESC
  64. </select>
  65. <select id="selectAllByPageExport" resultMap="BaseResultMap">
  66. select
  67. <include refid="Base_Column_List" />
  68. from t_customer_rec
  69. <where>
  70. <if test="customerRec.customerName != null and customerRec.customerName != ''">
  71. AND customerName = BINARY #{customerRec.customerName}
  72. </if>
  73. <if test="customerRec.companyName != null and customerRec.companyName != ''">
  74. and company_name LIKE BINARY CONCAT('%',#{customerRec.companyName},'%')
  75. </if>
  76. <if test="customerRec.companyBelongName != null and customerRec.companyBelongName != ''">
  77. and company_belong_name LIKE BINARY CONCAT('%',#{customerRec.companyBelongName},'%')
  78. </if>
  79. </where>
  80. ORDER by customerName
  81. </select>
  82. <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.String" >
  83. select
  84. <include refid="Base_Column_List" />
  85. from t_customer_rec
  86. where company_num = #{id,jdbcType=INTEGER}
  87. </select>
  88. <select id="selectByPrimaryKeyHasBase64" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
  89. select
  90. <include refid="Base_Column_List" />,base64Str,lowerBase64Str
  91. from t_customer_rec
  92. where id = #{id,jdbcType=INTEGER}
  93. </select>
  94. <select id="selectByCustomerName" resultMap="BaseResultMap" parameterType="java.lang.String" >
  95. select
  96. <include refid="Base_Column_List" />
  97. from t_customer_rec
  98. where customerName = BINARY #{customerName,jdbcType=VARCHAR} and rec_status =1
  99. </select>
  100. <select id="selectByCustomerNameAll" resultMap="BaseResultMap" parameterType="java.lang.String" >
  101. select
  102. <include refid="Base_Column_List" />
  103. from t_customer_rec
  104. where customerName = BINARY #{customerName,jdbcType=VARCHAR}
  105. </select>
  106. <select id="selectByCustomerNameCpAll" resultMap="BaseResultMap" parameterType="com.jkcredit.invoice.model.entity.customer.CustomerRec" >
  107. select
  108. <include refid="Base_Column_List" />
  109. from t_customer_rec
  110. where customerName = BINARY #{customerRec.customerName,jdbcType=VARCHAR}
  111. <if test="customerRec.companyName != null and customerRec.companyName != ''">
  112. and company_name LIKE BINARY CONCAT('%',#{customerRec.companyName},'%')
  113. </if>
  114. </select>
  115. <select id="selectByCustomerNameAndCompany" resultMap="BaseResultMap" parameterType="com.jkcredit.invoice.model.entity.customer.CustomerRec" >
  116. select
  117. <include refid="Base_Column_List" />
  118. from t_customer_rec
  119. where customerName = BINARY #{customerName,jdbcType=VARCHAR} AND company_name = BINARY #{companyName,jdbcType=VARCHAR}
  120. </select>
  121. <select id="selectByCustomerNameAndCompanyReference" resultMap="BaseResultMap" parameterType="com.jkcredit.invoice.model.entity.customer.CustomerRec" >
  122. select
  123. <include refid="Base_Column_List" />
  124. from t_customer_rec
  125. where customerName = BINARY #{customerName,jdbcType=VARCHAR} AND company_referenceNum = BINARY #{companyReferencenum,jdbcType=VARCHAR} and rec_status =1
  126. </select>
  127. <select id="selectByCustomerNameAndCompanyReferenceAll" resultMap="BaseResultMap" parameterType="com.jkcredit.invoice.model.entity.customer.CustomerRec" >
  128. select
  129. <include refid="Base_Column_List" />
  130. from t_customer_rec
  131. where customerName = BINARY #{customerName,jdbcType=VARCHAR} AND company_referenceNum = BINARY #{companyReferencenum,jdbcType=VARCHAR}
  132. </select>
  133. <select id="selectByCompanyReference" resultMap="BaseResultMap" parameterType="java.lang.String" >
  134. select
  135. <include refid="Base_Column_List" />
  136. from t_customer_rec
  137. where company_referenceNum = BINARY #{companyReferencenum,jdbcType=VARCHAR} and rec_status =1
  138. </select>
  139. <select id="selectByCustomerNameAndCompanyConcat" resultMap="BaseResultMap" parameterType="com.jkcredit.invoice.model.entity.customer.CustomerRec" >
  140. select
  141. <include refid="Base_Column_List" />,base64Str
  142. from t_customer_rec
  143. where customerName = BINARY #{customerName,jdbcType=VARCHAR} AND BINARY company_name = #{companyName,jdbcType=VARCHAR}
  144. </select>
  145. <select id="selectByCustomerNameAndCompanyNum" resultMap="BaseResultMap" parameterType="com.jkcredit.invoice.model.entity.customer.CustomerRec" >
  146. select
  147. <include refid="Base_Column_List" />
  148. from t_customer_rec
  149. where customerName = BINARY #{customerName,jdbcType=VARCHAR} AND company_num = #{companyNum,jdbcType=VARCHAR}
  150. </select>
  151. <select id="selectByCompanyNum" resultMap="BaseResultMap" parameterType="com.jkcredit.invoice.model.entity.customer.CustomerRec" >
  152. select
  153. <include refid="Base_Column_List" />
  154. from t_customer_rec
  155. where company_num = #{companyNum,jdbcType=VARCHAR} and rec_status =1
  156. </select>
  157. <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer" >
  158. delete from t_customer_rec
  159. where id = #{id,jdbcType=INTEGER}
  160. </delete>
  161. <insert id="insert" parameterType="com.jkcredit.invoice.model.entity.customer.CustomerRec" >
  162. insert into t_customer_rec (customerName,company_leader, company_leader_Phone,
  163. company_name, company_referenceNum, company_openbank,
  164. company_openbank_acc, company_adress, company_phone,
  165. createTime, company_belong_name, rec_status,
  166. inter_type,bussiness_type,company_type,operating_rangeType,company_num,
  167. service_startTime,service_endTime,service_type,contractFileName,base64Str,contractSuc,lowerFileName,lowerBase64Str
  168. )
  169. values (#{customerName,jdbcType=VARCHAR}, #{companyLeader,jdbcType=VARCHAR}, #{companyLeaderPhone,jdbcType=VARCHAR},
  170. #{companyName,jdbcType=VARCHAR}, #{companyReferencenum,jdbcType=VARCHAR}, #{companyOpenbank,jdbcType=VARCHAR},
  171. #{companyOpenbankAcc,jdbcType=VARCHAR}, #{companyAdress,jdbcType=VARCHAR}, #{companyPhone,jdbcType=VARCHAR},
  172. #{createtime,jdbcType=TIMESTAMP}, #{companyBelongName,jdbcType=VARCHAR}, #{recStatus,jdbcType=INTEGER},
  173. #{interType,jdbcType=INTEGER}, #{bussinessType,jdbcType=INTEGER},#{companyType,jdbcType=INTEGER},#{operatingRangeType,jdbcType=INTEGER},#{companyNum,jdbcType=VARCHAR},
  174. #{serviceStartTime,jdbcType=VARCHAR},#{serviceEndTime,jdbcType=VARCHAR},#{serviceType,jdbcType=INTEGER},#{contractFileName,jdbcType=VARCHAR},#{base64Str,jdbcType=VARCHAR},#{contractSuc,jdbcType=INTEGER},#{lowerFileName,jdbcType=VARCHAR},#{lowerBase64Str,jdbcType=VARCHAR}
  175. )
  176. </insert>
  177. <insert id="insertSelective" parameterType="com.jkcredit.invoice.model.entity.customer.CustomerRec" >
  178. insert into t_customer_rec
  179. <trim prefix="(" suffix=")" suffixOverrides="," >
  180. <if test="id != null" >
  181. id,
  182. </if>
  183. <if test="companyLeader != null" >
  184. company_leader,
  185. </if>
  186. <if test="companyLeaderPhone != null" >
  187. company_leader_Phone,
  188. </if>
  189. <if test="companyName != null" >
  190. company_name,
  191. </if>
  192. <if test="companyReferencenum != null" >
  193. company_referenceNum,
  194. </if>
  195. <if test="companyOpenbank != null" >
  196. company_openbank,
  197. </if>
  198. <if test="companyOpenbankAcc != null" >
  199. company_openbank_acc,
  200. </if>
  201. <if test="companyAdress != null" >
  202. company_adress,
  203. </if>
  204. <if test="companyPhone != null" >
  205. company_phone,
  206. </if>
  207. <if test="createtime != null" >
  208. createTime,
  209. </if>
  210. <if test="companyBelongName != null" >
  211. company_belong_name,
  212. </if>
  213. <if test="recStatus != null" >
  214. rec_status,
  215. </if>
  216. <if test="interType != null" >
  217. inter_type,
  218. </if>
  219. </trim>
  220. <trim prefix="values (" suffix=")" suffixOverrides="," >
  221. <if test="id != null" >
  222. #{id,jdbcType=INTEGER},
  223. </if>
  224. <if test="companyLeader != null" >
  225. #{companyLeader,jdbcType=VARCHAR},
  226. </if>
  227. <if test="companyLeaderPhone != null" >
  228. #{companyLeaderPhone,jdbcType=VARCHAR},
  229. </if>
  230. <if test="companyName != null" >
  231. #{companyName,jdbcType=VARCHAR},
  232. </if>
  233. <if test="companyReferencenum != null" >
  234. #{companyReferencenum,jdbcType=VARCHAR},
  235. </if>
  236. <if test="companyOpenbank != null" >
  237. #{companyOpenbank,jdbcType=VARCHAR},
  238. </if>
  239. <if test="companyOpenbankAcc != null" >
  240. #{companyOpenbankAcc,jdbcType=VARCHAR},
  241. </if>
  242. <if test="companyAdress != null" >
  243. #{companyAdress,jdbcType=VARCHAR},
  244. </if>
  245. <if test="companyPhone != null" >
  246. #{companyPhone,jdbcType=VARCHAR},
  247. </if>
  248. <if test="createtime != null" >
  249. #{createtime,jdbcType=TIMESTAMP},
  250. </if>
  251. <if test="companyBelongName != null" >
  252. #{companyBelongName,jdbcType=VARCHAR},
  253. </if>
  254. <if test="recStatus != null" >
  255. #{recStatus,jdbcType=INTEGER},
  256. </if>
  257. <if test="interType != null" >
  258. #{interType,jdbcType=INTEGER},
  259. </if>
  260. </trim>
  261. </insert>
  262. <update id="updateByPrimaryKeySelective" parameterType="com.jkcredit.invoice.model.entity.customer.CustomerRec" >
  263. update t_customer_rec
  264. <set >
  265. <if test="companyLeader != null" >
  266. company_leader = #{companyLeader,jdbcType=VARCHAR},
  267. </if>
  268. <if test="companyLeaderPhone != null" >
  269. company_leader_Phone = #{companyLeaderPhone,jdbcType=VARCHAR},
  270. </if>
  271. <if test="companyName != null" >
  272. company_name = #{companyName,jdbcType=VARCHAR},
  273. </if>
  274. <if test="companyReferencenum != null" >
  275. company_referenceNum = #{companyReferencenum,jdbcType=VARCHAR},
  276. </if>
  277. <if test="companyOpenbank != null" >
  278. company_openbank = #{companyOpenbank,jdbcType=VARCHAR},
  279. </if>
  280. <if test="companyOpenbankAcc != null" >
  281. company_openbank_acc = #{companyOpenbankAcc,jdbcType=VARCHAR},
  282. </if>
  283. <if test="companyAdress != null" >
  284. company_adress = #{companyAdress,jdbcType=VARCHAR},
  285. </if>
  286. <if test="companyPhone != null" >
  287. company_phone = #{companyPhone,jdbcType=VARCHAR},
  288. </if>
  289. <if test="createtime != null" >
  290. createTime = #{createtime,jdbcType=TIMESTAMP},
  291. </if>
  292. <if test="companyBelongName != null" >
  293. company_belong_name = #{companyBelongName,jdbcType=VARCHAR},
  294. </if>
  295. <if test="recStatus != null" >
  296. rec_status = #{recStatus,jdbcType=INTEGER},
  297. </if>
  298. <if test="interType != null" >
  299. inter_type = #{interType,jdbcType=INTEGER},
  300. </if>
  301. <if test="bussinessType != null" >
  302. bussiness_type = #{bussinessType,jdbcType=INTEGER},
  303. </if>
  304. <if test="companyType != null" >
  305. company_type = #{companyType,jdbcType=INTEGER},
  306. </if>
  307. <if test="operatingRangeType != null" >
  308. operating_rangeType = #{operatingRangeType,jdbcType=INTEGER},
  309. </if>
  310. <if test="companyNum != null" >
  311. company_num = #{companyNum,jdbcType=VARCHAR},
  312. </if>
  313. <if test="serviceStartTime != null" >
  314. service_startTime = #{serviceStartTime,jdbcType=VARCHAR},
  315. </if>
  316. <if test="serviceEndTime != null" >
  317. service_endTime = #{serviceEndTime,jdbcType=VARCHAR},
  318. </if>
  319. <if test="serviceType != null" >
  320. service_type = #{serviceType,jdbcType=INTEGER},
  321. </if>
  322. <if test="contractFileName != null" >
  323. contractFileName = #{contractFileName,jdbcType=VARCHAR},
  324. </if>
  325. <if test="base64Str != null" >
  326. base64Str = #{base64Str,jdbcType=VARCHAR},
  327. </if>
  328. <if test="contractSuc != null" >
  329. contractSuc = #{contractSuc,jdbcType=INTEGER},
  330. </if>
  331. <if test="contrantNum != null" >
  332. contrantNum = #{contrantNum,jdbcType=VARCHAR},
  333. </if>
  334. <if test="lowerFileName != null" >
  335. lowerFileName = #{lowerFileName,jdbcType=VARCHAR},
  336. </if>
  337. <if test="lowerBase64Str != null" >
  338. lowerBase64Str = #{lowerBase64Str,jdbcType=VARCHAR},
  339. </if>
  340. <if test="fileMessage != null" >
  341. fileMessage = #{fileMessage,jdbcType=VARCHAR},
  342. </if>
  343. </set>
  344. where company_name = BINARY #{companyName,jdbcType=VARCHAR} and bussiness_type = #{bussinessType,jdbcType=INTEGER} and company_referenceNum = #{companyReferencenum,jdbcType=VARCHAR}
  345. </update>
  346. <update id="updateByPrimaryKey" parameterType="com.jkcredit.invoice.model.entity.customer.CustomerRec" >
  347. update t_customer_rec
  348. set company_leader = #{companyLeader,jdbcType=VARCHAR},
  349. company_leader_Phone = #{companyLeaderPhone,jdbcType=VARCHAR},
  350. company_name = #{companyName,jdbcType=VARCHAR},
  351. company_referenceNum = #{companyReferencenum,jdbcType=VARCHAR},
  352. company_openbank = #{companyOpenbank,jdbcType=VARCHAR},
  353. company_openbank_acc = #{companyOpenbankAcc,jdbcType=VARCHAR},
  354. company_adress = #{companyAdress,jdbcType=VARCHAR},
  355. company_phone = #{companyPhone,jdbcType=VARCHAR},
  356. createTime = #{createtime,jdbcType=TIMESTAMP},
  357. company_belong_name = #{companyBelongName,jdbcType=VARCHAR},
  358. rec_status = #{recStatus,jdbcType=INTEGER},
  359. inter_type = #{interType,jdbcType=INTEGER},
  360. bussiness_type = #{bussinessType,jdbcType=INTEGER},
  361. company_type = #{companyType,jdbcType=INTEGER},
  362. operating_rangeType = #{operatingRangeType,jdbcType=INTEGER},
  363. company_num = #{companyNum,jdbcType=VARCHAR},
  364. service_startTime = #{serviceStartTime,jdbcType=VARCHAR},
  365. service_endTime = #{serviceEndTime,jdbcType=VARCHAR},
  366. service_type = #{serviceType,jdbcType=INTEGER},
  367. contractFileName = #{contractFileName,jdbcType=VARCHAR},
  368. base64Str = #{base64Str,jdbcType=VARCHAR},
  369. contractSuc = #{contractSuc,jdbcType=INTEGER},
  370. contrantNum = #{contrantNum,jdbcType=VARCHAR}
  371. where id = #{id,jdbcType=INTEGER}
  372. </update>
  373. <update id="updateByCompany" parameterType="com.jkcredit.invoice.model.entity.customer.CustomerRec" >
  374. update t_customer_rec
  375. set company_leader = #{companyLeader,jdbcType=VARCHAR},
  376. company_leader_Phone = #{companyLeaderPhone,jdbcType=VARCHAR},
  377. company_name = #{companyName,jdbcType=VARCHAR},
  378. company_referenceNum = #{companyReferencenum,jdbcType=VARCHAR},
  379. company_openbank = #{companyOpenbank,jdbcType=VARCHAR},
  380. company_openbank_acc = #{companyOpenbankAcc,jdbcType=VARCHAR},
  381. company_adress = #{companyAdress,jdbcType=VARCHAR},
  382. company_phone = #{companyPhone,jdbcType=VARCHAR},
  383. createTime = #{createtime,jdbcType=TIMESTAMP},
  384. company_belong_name = #{companyBelongName,jdbcType=VARCHAR},
  385. rec_status = #{recStatus,jdbcType=INTEGER},
  386. inter_type = #{interType,jdbcType=INTEGER},
  387. bussiness_type = #{bussinessType,jdbcType=INTEGER},
  388. company_type = #{companyType,jdbcType=INTEGER},
  389. operating_rangeType = #{operatingRangeType,jdbcType=INTEGER},
  390. company_num = #{companyNum,jdbcType=VARCHAR},
  391. service_startTime = #{serviceStartTime,jdbcType=VARCHAR},
  392. service_endTime = #{serviceEndTime,jdbcType=VARCHAR},
  393. service_type = #{serviceType,jdbcType=INTEGER},
  394. contractFileName = #{contractFileName,jdbcType=VARCHAR},
  395. base64Str = #{base64Str,jdbcType=VARCHAR},
  396. contractSuc = #{contractSuc,jdbcType=INTEGER},
  397. contrantNum = #{contrantNum,jdbcType=VARCHAR}
  398. where company_name = BINARY #{companyName,jdbcType=VARCHAR} and bussiness_type = #{bussinessType,jdbcType=INTEGER} and company_referenceNum = #{companyReferencenum,jdbcType=VARCHAR}
  399. </update>
  400. </mapper>