LoanApplicationMapper.xml 42 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518
  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <!DOCTYPE mapper
  3. PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
  4. "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
  5. <mapper namespace="com.ruoyi.system.mapper.LoanApplicationMapper">
  6. <resultMap type="LoanApplication" id="LoanApplicationResult">
  7. <result property="loanApplicationId" column="loan_application_id" />
  8. <result property="loanApplicationNumber" column="loan_application_number" />
  9. <result property="applicationType" column="application_type" />
  10. <result property="applicationAmount" column="application_amount" />
  11. <result property="actuallyAmount" column="actually_amount" />
  12. <result property="applicationBank" column="application_bank" />
  13. <result property="usagePeriod" column="usage_period" />
  14. <result property="purposeFunds" column="purpose_funds" />
  15. <result property="repaymentSource" column="repayment_source" />
  16. <result property="enterpriseId" column="enterprise_id" />
  17. <result property="enterpriseName" column="enterprise_name" />
  18. <result property="categoryType" column="category_type" />
  19. <result property="isMake" column="is_make" />
  20. <result property="isNew" column="is_new" />
  21. <result property="isSmall" column="is_small" />
  22. <result property="isDuty" column="is_duty" />
  23. <result property="companyIntroduction" column="company_introduction" />
  24. <result property="customerType" column="customer_type" />
  25. <result property="corporationFront" column="corporation_front" />
  26. <result property="corporationBack" column="corporation_back" />
  27. <result property="corporationName" column="corporation_name" />
  28. <result property="corporationIdCard" column="corporation_id_card" />
  29. <result property="corporationPhone" column="corporation_phone" />
  30. <result property="corporationAddress" column="corporation_address" />
  31. <result property="corporationExpirationDate" column="corporation_expiration_date" />
  32. <result property="familyPopulation" column="family_population" />
  33. <result property="corporationJob" column="corporation_job" />
  34. <result property="isLoan" column="is_loan" />
  35. <result property="receivablePay" column="receivable_pay" />
  36. <result property="businessSituation" column="business_situation" />
  37. <result property="businessEfficiency" column="business_efficiency" />
  38. <result property="corporationMaritalStatus" column="corporation_marital_status" />
  39. <result property="spouseFront" column="spouse_front" />
  40. <result property="spouseBack" column="spouse_back" />
  41. <result property="spouseName" column="spouse_name" />
  42. <result property="spouseIdCard" column="spouse_id_card" />
  43. <result property="spousePhone" column="spouse_phone" />
  44. <result property="guaranteeType" column="guarantee_type" />
  45. <result property="guaranteeFront" column="guarantee_front" />
  46. <result property="guaranteeBack" column="guarantee_back" />
  47. <result property="guaranteeName" column="guarantee_name" />
  48. <result property="guaranteeIdCard" column="guarantee_id_card" />
  49. <result property="guaranteePhone" column="guarantee_phone" />
  50. <result property="guaranteeMaritalStatus" column="guarantee_marital_status" />
  51. <result property="guaranteeSpouseFront" column="guarantee_spouse_front" />
  52. <result property="guaranteeSpouseBack" column="guarantee_spouse_back" />
  53. <result property="guaranteeSpouseName" column="guarantee_spouse_name" />
  54. <result property="guaranteeSpouseIdCard" column="guarantee_spouse_id_card" />
  55. <result property="guaranteeSpousePhone" column="guarantee_spouse_phone" />
  56. <result property="guaranteeShareholderName" column="guarantee_shareholder_name" />
  57. <result property="guaranteeShareholderIdCard" column="guarantee_shareholder_id_card" />
  58. <result property="userId" column="user_id" />
  59. <result property="idCard" column="id_card" />
  60. <result property="applicationTime" column="application_time" />
  61. <result property="fileTime" column="file_time" />
  62. <result property="reviewTime" column="review_time" />
  63. <result property="loanSchedule" column="loan_schedule" />
  64. <result property="auditSchedule" column="audit_schedule" />
  65. <result property="auditType" column="audit_type" />
  66. <result property="loanApplicationType" column="loan_application_type" />
  67. <result property="reviewSchedule" column="review_schedule" />
  68. <result property="rejectionReason" column="rejection_reason" />
  69. <result property="aUserId" column="a_user_id" />
  70. <result property="aUserName" column="a_user_name" />
  71. <result property="aAuthorize" column="a_authorize" />
  72. <result property="bUserId" column="b_user_id" />
  73. <result property="bUserName" column="b_user_name" />
  74. <result property="fUserId" column="f_user_id" />
  75. <result property="fUserName" column="f_user_name" />
  76. <result property="createBy" column="create_by" />
  77. <result property="createTime" column="create_time" />
  78. <result property="updateBy" column="update_by" />
  79. <result property="updateTime" column="update_time" />
  80. <result property="remark" column="remark" />
  81. </resultMap>
  82. <sql id="selectLoanApplicationVo">
  83. select loan_application_id, loan_application_number, application_type,application_amount,actually_amount,enterprise_id,guarantee_shareholder_name,guarantee_shareholder_id_card, application_bank, usage_period, purpose_funds, repayment_source, enterprise_name, category_type, is_make, is_new, is_small, is_duty, company_introduction, customer_type, corporation_front, corporation_back, corporation_name, corporation_id_card, corporation_phone,corporation_address,corporation_expiration_date, family_population, corporation_job, is_loan, receivable_pay, business_situation, business_efficiency, corporation_marital_status, spouse_front, spouse_back, spouse_name, spouse_id_card, spouse_phone, guarantee_type, guarantee_front, guarantee_back, guarantee_name, guarantee_id_card, guarantee_phone, guarantee_marital_status, guarantee_spouse_front, guarantee_spouse_back, guarantee_spouse_name, guarantee_spouse_id_card, guarantee_spouse_phone, user_id, id_card, application_time, file_time,review_time, loan_schedule, audit_schedule, audit_type, loan_application_type,review_schedule,rejection_reason, a_user_id, a_user_name,a_authorize, b_user_id, b_user_name,f_user_id, f_user_name, create_by, create_time, update_by, update_time, remark from loan_application
  84. </sql>
  85. <select id="selectLoanApplicationList" parameterType="LoanApplication" resultMap="LoanApplicationResult">
  86. <include refid="selectLoanApplicationVo"/>
  87. <where>
  88. <if test="loanApplicationNumber != null and loanApplicationNumber != ''"> and loan_application_number = #{loanApplicationNumber}</if>
  89. <if test="applicationAmount != null "> and application_amount = #{applicationAmount}</if>
  90. <if test="actuallyAmount != null "> and actually_amount = #{actuallyAmount}</if>
  91. <if test="applicationType != null and applicationType != ''"> and application_type = #{applicationType}</if>
  92. <if test="applicationBank != null and applicationBank != ''"> and application_bank = #{applicationBank}</if>
  93. <if test="usagePeriod != null and usagePeriod != ''"> and usage_period = #{usagePeriod}</if>
  94. <if test="purposeFunds != null and purposeFunds != ''"> and purpose_funds = #{purposeFunds}</if>
  95. <if test="repaymentSource != null and repaymentSource != ''"> and repayment_source = #{repaymentSource}</if>
  96. <if test="enterpriseName != null and enterpriseName != ''"> and enterprise_name like concat('%', #{enterpriseName}, '%')</if>
  97. <if test="categoryType != null and categoryType != ''"> and category_type = #{categoryType}</if>
  98. <if test="isMake != null and isMake != ''"> and is_make = #{isMake}</if>
  99. <if test="isNew != null and isNew != ''"> and is_new = #{isNew}</if>
  100. <if test="isSmall != null and isSmall != ''"> and is_small = #{isSmall}</if>
  101. <if test="isDuty != null and isDuty != ''"> and is_duty = #{isDuty}</if>
  102. <if test="companyIntroduction != null and companyIntroduction != ''"> and company_introduction = #{companyIntroduction}</if>
  103. <if test="customerType != null and customerType != ''"> and customer_type = #{customerType}</if>
  104. <if test="corporationFront != null and corporationFront != ''"> and corporation_front = #{corporationFront}</if>
  105. <if test="corporationBack != null and corporationBack != ''"> and corporation_back = #{corporationBack}</if>
  106. <if test="corporationName != null and corporationName != ''"> and corporation_name like concat('%', #{corporationName}, '%')</if>
  107. <if test="corporationIdCard != null and corporationIdCard != ''"> and corporation_id_card = #{corporationIdCard}</if>
  108. <if test="corporationPhone != null and corporationPhone != ''"> and corporation_phone = #{corporationPhone}</if>
  109. <if test="familyPopulation != null and familyPopulation != ''"> and family_population = #{familyPopulation}</if>
  110. <if test="corporationJob != null and corporationJob != ''"> and corporation_job = #{corporationJob}</if>
  111. <if test="isLoan != null and isLoan != ''"> and is_loan = #{isLoan}</if>
  112. <if test="receivablePay != null and receivablePay != ''"> and receivable_pay = #{receivablePay}</if>
  113. <if test="businessSituation != null and businessSituation != ''"> and business_situation = #{businessSituation}</if>
  114. <if test="businessEfficiency != null and businessEfficiency != ''"> and business_efficiency = #{businessEfficiency}</if>
  115. <if test="corporationMaritalStatus != null and corporationMaritalStatus != ''"> and corporation_marital_status = #{corporationMaritalStatus}</if>
  116. <if test="spouseFront != null and spouseFront != ''"> and spouse_front = #{spouseFront}</if>
  117. <if test="spouseBack != null and spouseBack != ''"> and spouse_back = #{spouseBack}</if>
  118. <if test="spouseName != null and spouseName != ''"> and spouse_name like concat('%', #{spouseName}, '%')</if>
  119. <if test="spouseIdCard != null and spouseIdCard != ''"> and spouse_id_card = #{spouseIdCard}</if>
  120. <if test="spousePhone != null and spousePhone != ''"> and spouse_phone = #{spousePhone}</if>
  121. <if test="guaranteeType != null and guaranteeType != ''"> and FIND_IN_SET(guarantee_type,#{guaranteeType})</if>
  122. <if test="guaranteeFront != null and guaranteeFront != ''"> and guarantee_front = #{guaranteeFront}</if>
  123. <if test="guaranteeBack != null and guaranteeBack != ''"> and guarantee_back = #{guaranteeBack}</if>
  124. <if test="guaranteeName != null and guaranteeName != ''"> and guarantee_name like concat('%', #{guaranteeName}, '%')</if>
  125. <if test="guaranteeIdCard != null and guaranteeIdCard != ''"> and guarantee_id_card = #{guaranteeIdCard}</if>
  126. <if test="guaranteePhone != null and guaranteePhone != ''"> and guarantee_phone = #{guaranteePhone}</if>
  127. <if test="guaranteeMaritalStatus != null and guaranteeMaritalStatus != ''"> and guarantee_marital_status = #{guaranteeMaritalStatus}</if>
  128. <if test="guaranteeSpouseFront != null and guaranteeSpouseFront != ''"> and guarantee_spouse_front = #{guaranteeSpouseFront}</if>
  129. <if test="guaranteeSpouseBack != null and guaranteeSpouseBack != ''"> and guarantee_spouse_back = #{guaranteeSpouseBack}</if>
  130. <if test="guaranteeSpouseName != null and guaranteeSpouseName != ''"> and guarantee_spouse_name like concat('%', #{guaranteeSpouseName}, '%')</if>
  131. <if test="guaranteeSpouseIdCard != null and guaranteeSpouseIdCard != ''"> and guarantee_spouse_id_card = #{guaranteeSpouseIdCard}</if>
  132. <if test="guaranteeSpousePhone != null and guaranteeSpousePhone != ''"> and guarantee_spouse_phone = #{guaranteeSpousePhone}</if>
  133. <if test="idCard != null and idCard != ''"> and id_card = #{idCard}</if>
  134. <if test="applicationTime != null ">AND date_format(application_time,'%Y%m%d') &gt;= date_format(#{applicationTime},'%Y%m%d')</if>
  135. <if test="fileTime != null "> and file_time = #{fileTime}</if>
  136. <if test="reviewTime != null "> and review_time = #{reviewTime}</if>
  137. <if test="loanSchedule != null and loanSchedule != ''"> and loan_schedule = #{loanSchedule}</if>
  138. <if test="aAuthorize != null and aAuthorize != ''"> and a_authorize = #{aAuthorize}</if>
  139. <if test="auditSchedule != null and auditSchedule != ''"> and audit_schedule = #{auditSchedule}</if>
  140. <if test="auditType != null and auditType != ''"> and audit_type = #{auditType}</if>
  141. <if test="loanApplicationType != null and loanApplicationType != ''"> and loan_application_type = #{loanApplicationType}</if>
  142. <if test="reviewSchedule != null and reviewSchedule != ''"> and review_schedule = #{reviewSchedule}</if>
  143. <if test="userId != null "> and (a_user_id = #{userId} or (b_user_id = #{userId} and audit_schedule = '3') or user_id = #{userId} or f_user_id = #{userId})</if>
  144. <if test="params.beginTime != null and params.beginTime != ''"><!-- 开始时间检索 -->
  145. AND date_format(create_time,'%Y') = #{params.beginTime}
  146. </if>
  147. </where>
  148. order by create_time DESC
  149. </select>
  150. <select id="selectLoanApplicationListStatistics" parameterType="LoanApplication" resultMap="LoanApplicationResult">
  151. <include refid="selectLoanApplicationVo"/>
  152. <where>
  153. <if test="type != null and type == '1'.toString()"><!-- 开始时间检索 -->
  154. AND date_format(application_time,'%Y') = #{params.beginTime}
  155. </if>
  156. <if test="type != null and type == '2'.toString()"><!-- 开始时间检索 -->
  157. AND date_format(application_time,'%Y%m') = #{params.beginTime}
  158. </if>
  159. </where>
  160. </select>
  161. <select id="selectLoanApplicationByLoanApplicationId" parameterType="Long" resultMap="LoanApplicationResult">
  162. <include refid="selectLoanApplicationVo"/>
  163. where loan_application_id = #{loanApplicationId}
  164. </select>
  165. <!-- <select id="conferenceList" parameterType="LoanApplication" resultMap="LoanApplicationResult">
  166. SELECT
  167. l.loan_application_id, l.loan_application_number, l.application_type,l.application_amount,l.enterprise_id,l.guarantee_shareholder_name,l.guarantee_shareholder_id_card, l.application_bank, l.usage_period, l.purpose_funds, l.repayment_source, l.enterprise_name, l.category_type, l.is_make, l.is_new, l.is_small,
  168. l.is_duty, l.company_introduction, l.customer_type, l.corporation_front, l.corporation_back, l.corporation_name, l.corporation_id_card, l.corporation_phone,l.corporation_address,l.corporation_expiration_date, l.family_population, l.corporation_job, l.is_loan, l.receivable_pay, l.business_situation, l.business_efficiency,
  169. l.corporation_marital_status, l.spouse_front, l.spouse_back, l.spouse_name, l.spouse_id_card, l.spouse_phone, l.guarantee_type, l.guarantee_front, l.guarantee_back, l.guarantee_name, l.guarantee_id_card, l.guarantee_phone, l.guarantee_marital_status, l.guarantee_spouse_front, l.guarantee_spouse_back, l.guarantee_spouse_name,
  170. l.guarantee_spouse_id_card, l.guarantee_spouse_phone, l.user_id, l.id_card, l.application_time, l.file_time,l.review_time, l.loan_schedule, l.audit_schedule, l.audit_type, l.loan_application_type,l.review_schedule, l.a_user_id, l.a_user_name,l.a_authorize, l.b_user_id, l.b_user_name,l.f_user_id, l.f_user_name,
  171. l.create_by, l.create_time, l.update_by, l.update_time, l.remark
  172. from sys_user_conference s
  173. LEFT JOIN loan_application l on l.loan_application_id = s.loan_application_id
  174. where l.loan_application_id is not null
  175. <if test="userId != null "> and s.user_id = #{userId} = #{userId}</if>
  176. <if test="enterpriseName != null and enterpriseName != ''"> and l.enterprise_name like concat('%', #{enterpriseName}, '%')</if>
  177. <if test="applicationAmount != null "> and l.application_amount = #{applicationAmount}</if>
  178. <if test="reviewTime != null "> and l.review_time = #{reviewTime}</if>
  179. GROUP BY l.loan_application_id
  180. ORDER BY review_time desc
  181. </select>-->
  182. <select id="conferenceList" parameterType="LoanApplication" resultMap="LoanApplicationResult">
  183. SELECT
  184. ANY_VALUE(l.loan_application_id) as loan_application_id,
  185. ANY_VALUE(l.loan_application_number) as loan_application_number,
  186. ANY_VALUE(l.application_type) as application_type,
  187. ANY_VALUE(l.application_amount) as application_amount,
  188. ANY_VALUE(l.enterprise_id) as enterprise_id,
  189. ANY_VALUE(l.guarantee_shareholder_name) as guarantee_shareholder_name,
  190. ANY_VALUE(l.guarantee_shareholder_id_card) as guarantee_shareholder_id_card,
  191. ANY_VALUE(l.application_bank) as application_bank,
  192. ANY_VALUE(l.usage_period) as usage_period,
  193. ANY_VALUE(l.purpose_funds) as purpose_funds,
  194. ANY_VALUE(l.repayment_source) as repayment_source,
  195. ANY_VALUE(l.enterprise_name) as enterprise_name,
  196. ANY_VALUE(l.category_type) as category_type,
  197. ANY_VALUE(l.is_make) as is_make,
  198. ANY_VALUE(l.is_new) as is_new,
  199. ANY_VALUE(l.is_small) as is_small,
  200. ANY_VALUE(l.is_duty) as is_duty,
  201. ANY_VALUE(l.company_introduction) as company_introduction,
  202. ANY_VALUE(l.customer_type) as customer_type,
  203. ANY_VALUE(l.corporation_front) as corporation_front,
  204. ANY_VALUE(l.corporation_back) as corporation_back,
  205. ANY_VALUE(l.corporation_name) as corporation_name,
  206. ANY_VALUE(l.corporation_id_card) as corporation_id_card,
  207. ANY_VALUE(l.corporation_phone) as corporation_phone,
  208. ANY_VALUE(l.corporation_address) as corporation_address,
  209. ANY_VALUE(l.corporation_expiration_date) as corporation_expiration_date,
  210. ANY_VALUE(l.family_population) as family_population,
  211. ANY_VALUE(l.corporation_job) as corporation_job,
  212. ANY_VALUE(l.is_loan) as is_loan,
  213. ANY_VALUE(l.receivable_pay) as receivable_pay,
  214. ANY_VALUE(l.business_situation) as business_situation,
  215. ANY_VALUE(l.business_efficiency) as business_efficiency,
  216. ANY_VALUE(l.corporation_marital_status) as corporation_marital_status,
  217. ANY_VALUE(l.spouse_front) as spouse_front,
  218. ANY_VALUE(l.spouse_back) as spouse_back,
  219. ANY_VALUE(l.spouse_name) as spouse_name,
  220. ANY_VALUE(l.spouse_id_card) as spouse_id_card,
  221. ANY_VALUE(l.spouse_phone) as spouse_phone,
  222. ANY_VALUE(l.guarantee_type) as guarantee_type,
  223. ANY_VALUE(l.guarantee_front) as guarantee_front,
  224. ANY_VALUE(l.guarantee_back) as guarantee_back,
  225. ANY_VALUE(l.guarantee_name) as guarantee_name,
  226. ANY_VALUE(l.guarantee_id_card) as guarantee_id_card,
  227. ANY_VALUE(l.guarantee_phone) as guarantee_phone,
  228. ANY_VALUE(l.guarantee_marital_status) as guarantee_marital_status,
  229. ANY_VALUE(l.guarantee_spouse_front) as guarantee_spouse_front,
  230. ANY_VALUE(l.guarantee_spouse_back) as guarantee_spouse_back,
  231. ANY_VALUE(l.guarantee_spouse_name) as guarantee_spouse_name,
  232. ANY_VALUE(l.guarantee_spouse_id_card) as guarantee_spouse_id_card,
  233. ANY_VALUE(l.guarantee_spouse_phone) as guarantee_spouse_phone,
  234. ANY_VALUE(l.user_id) as user_id,
  235. ANY_VALUE(l.id_card) as id_card,
  236. ANY_VALUE(l.application_time) as application_time,
  237. ANY_VALUE(l.file_time) as file_time,
  238. ANY_VALUE(l.review_time) as review_time,
  239. ANY_VALUE(l.loan_schedule) as loan_schedule,
  240. ANY_VALUE(l.audit_schedule) as audit_schedule,
  241. ANY_VALUE(l.audit_type) as audit_type,
  242. ANY_VALUE(l.loan_application_type) as loan_application_type,
  243. ANY_VALUE(l.review_schedule) as review_schedule,
  244. ANY_VALUE(l.a_user_id) as a_user_id,
  245. ANY_VALUE(l.a_user_name) as a_user_name,
  246. ANY_VALUE(l.a_authorize) as a_authorize,
  247. ANY_VALUE(l.b_user_id) as b_user_id,
  248. ANY_VALUE(l.b_user_name) as b_user_name,
  249. ANY_VALUE(l.f_user_id) as f_user_id,
  250. ANY_VALUE(l.f_user_name) as f_user_name,
  251. ANY_VALUE(l.create_by) as create_by,
  252. ANY_VALUE(l.create_time) as create_time,
  253. ANY_VALUE(l.update_by) as update_by,
  254. ANY_VALUE(l.update_time) as update_time,
  255. ANY_VALUE(l.remark) as remark
  256. from sys_user_conference s
  257. LEFT JOIN loan_application l on l.loan_application_id = s.loan_application_id
  258. where l.loan_application_id is not null
  259. <if test="userId != null "> and s.user_id = #{userId}</if>
  260. <if test="enterpriseName != null and enterpriseName != ''"> and l.enterprise_name like concat('%', #{enterpriseName}, '%')</if>
  261. <if test="applicationAmount != null "> and l.application_amount = #{applicationAmount}</if>
  262. <if test="reviewTime != null "> and l.review_time = #{reviewTime}</if>
  263. GROUP BY l.loan_application_id
  264. ORDER BY review_time desc
  265. </select>
  266. <insert id="insertLoanApplication" parameterType="LoanApplication" useGeneratedKeys="true" keyProperty="loanApplicationId">
  267. insert into loan_application
  268. <trim prefix="(" suffix=")" suffixOverrides=",">
  269. <if test="loanApplicationNumber != null">loan_application_number,</if>
  270. <if test="applicationType != null and applicationType != ''">application_type,</if>
  271. <if test="applicationAmount != null">application_amount,</if>
  272. <if test="actuallyAmount != null">actually_amount,</if>
  273. <if test="applicationBank != null and applicationBank != ''">application_bank,</if>
  274. <if test="usagePeriod != null and usagePeriod != ''">usage_period,</if>
  275. <if test="purposeFunds != null and purposeFunds != ''">purpose_funds,</if>
  276. <if test="repaymentSource != null and repaymentSource != ''">repayment_source,</if>
  277. <if test="enterpriseId != null and enterpriseId != ''">enterprise_id,</if>
  278. <if test="enterpriseName != null and enterpriseName != ''">enterprise_name,</if>
  279. <if test="categoryType != null and categoryType != ''">category_type,</if>
  280. <if test="isMake != null">is_make,</if>
  281. <if test="isNew != null">is_new,</if>
  282. <if test="isSmall != null">is_small,</if>
  283. <if test="isDuty != null">is_duty,</if>
  284. <if test="companyIntroduction != null">company_introduction,</if>
  285. <if test="customerType != null and customerType != ''">customer_type,</if>
  286. <if test="corporationFront != null and corporationFront != ''">corporation_front,</if>
  287. <if test="corporationBack != null and corporationBack != ''">corporation_back,</if>
  288. <if test="corporationName != null and corporationName != ''">corporation_name,</if>
  289. <if test="corporationIdCard != null and corporationIdCard != ''">corporation_id_card,</if>
  290. <if test="corporationPhone != null and corporationPhone != ''">corporation_phone,</if>
  291. <if test="corporationAddress != null and corporationAddress != ''">corporation_address,</if>
  292. <if test="corporationExpirationDate != null and corporationExpirationDate != ''">corporation_expiration_date,</if>
  293. <if test="familyPopulation != null and familyPopulation != ''">family_population,</if>
  294. <if test="corporationJob != null and corporationJob != ''">corporation_job,</if>
  295. <if test="isLoan != null">is_loan,</if>
  296. <if test="receivablePay != null">receivable_pay,</if>
  297. <if test="businessSituation != null">business_situation,</if>
  298. <if test="businessEfficiency != null">business_efficiency,</if>
  299. <if test="corporationMaritalStatus != null">corporation_marital_status,</if>
  300. <if test="spouseFront != null and spouseFront != ''">spouse_front,</if>
  301. <if test="spouseBack != null and spouseBack != ''">spouse_back,</if>
  302. <if test="spouseName != null and spouseName != ''">spouse_name,</if>
  303. <if test="spouseIdCard != null and spouseIdCard != ''">spouse_id_card,</if>
  304. <if test="spousePhone != null and spousePhone != ''">spouse_phone,</if>
  305. <if test="guaranteeType != null and guaranteeType != ''">guarantee_type,</if>
  306. <if test="guaranteeFront != null and guaranteeFront != ''">guarantee_front,</if>
  307. <if test="guaranteeBack != null and guaranteeBack != ''">guarantee_back,</if>
  308. <if test="guaranteeName != null and guaranteeName != ''">guarantee_name,</if>
  309. <if test="guaranteeIdCard != null and guaranteeIdCard != ''">guarantee_id_card,</if>
  310. <if test="guaranteePhone != null and guaranteePhone != ''">guarantee_phone,</if>
  311. <if test="guaranteeMaritalStatus != null">guarantee_marital_status,</if>
  312. <if test="guaranteeSpouseFront != null and guaranteeSpouseFront != ''">guarantee_spouse_front,</if>
  313. <if test="guaranteeSpouseBack != null and guaranteeSpouseBack != ''">guarantee_spouse_back,</if>
  314. <if test="guaranteeSpouseName != null and guaranteeSpouseName != ''">guarantee_spouse_name,</if>
  315. <if test="guaranteeSpouseIdCard != null and guaranteeSpouseIdCard != ''">guarantee_spouse_id_card,</if>
  316. <if test="guaranteeSpousePhone != null and guaranteeSpousePhone != ''">guarantee_spouse_phone,</if>
  317. <if test="guaranteeShareholderName != null and guaranteeShareholderName != ''">guarantee_shareholder_name,</if>
  318. <if test="guaranteeShareholderIdCard != null and guaranteeShareholderIdCard != ''">guarantee_shareholder_id_card,</if>
  319. <if test="userId != null">user_id,</if>
  320. <if test="idCard != null">id_card,</if>
  321. <if test="applicationTime != null">application_time,</if>
  322. <if test="fileTime != null">file_time,</if>
  323. <if test="reviewTime != null">review_time,</if>
  324. <if test="loanSchedule != null and loanSchedule != ''">loan_schedule,</if>
  325. <if test="auditSchedule != null and auditSchedule != ''">audit_schedule,</if>
  326. <if test="auditType != null and auditType != ''">audit_type,</if>
  327. <if test="loanApplicationType != null and loanApplicationType != ''">loan_application_type,</if>
  328. <if test="reviewSchedule != null and reviewSchedule != ''">review_schedule,</if>
  329. <if test="rejectionReason != null and rejectionReason != ''">rejection_reason,</if>
  330. <if test="aUserId != null">a_user_id,</if>
  331. <if test="aUserName != null">a_user_name,</if>
  332. <if test="aAuthorize != null and aAuthorize != ''">a_authorize,</if>
  333. <if test="bUserId != null">b_user_id,</if>
  334. <if test="bUserName != null">b_user_name,</if>
  335. <if test="fUserId != null">f_user_id,</if>
  336. <if test="fUserName != null">f_user_name,</if>
  337. <if test="createBy != null">create_by,</if>
  338. <if test="updateBy != null">update_by,</if>
  339. <if test="updateTime != null">update_time,</if>
  340. <if test="remark != null">remark,</if>
  341. create_time
  342. </trim>
  343. <trim prefix="values (" suffix=")" suffixOverrides=",">
  344. <if test="loanApplicationNumber != null">#{loanApplicationNumber},</if>
  345. <if test="applicationType != null and applicationType != ''">#{applicationType},</if>
  346. <if test="applicationAmount != null">#{applicationAmount},</if>
  347. <if test="actuallyAmount != null">#{actuallyAmount},</if>
  348. <if test="applicationBank != null and applicationBank != ''">#{applicationBank},</if>
  349. <if test="usagePeriod != null and usagePeriod != ''">#{usagePeriod},</if>
  350. <if test="purposeFunds != null and purposeFunds != ''">#{purposeFunds},</if>
  351. <if test="repaymentSource != null and repaymentSource != ''">#{repaymentSource},</if>
  352. <if test="enterpriseId != null and enterpriseId != ''">#{enterpriseId},</if>
  353. <if test="enterpriseName != null and enterpriseName != ''">#{enterpriseName},</if>
  354. <if test="categoryType != null and categoryType != ''">#{categoryType},</if>
  355. <if test="isMake != null">#{isMake},</if>
  356. <if test="isNew != null">#{isNew},</if>
  357. <if test="isSmall != null">#{isSmall},</if>
  358. <if test="isDuty != null">#{isDuty},</if>
  359. <if test="companyIntroduction != null">#{companyIntroduction},</if>
  360. <if test="customerType != null and customerType != ''">#{customerType},</if>
  361. <if test="corporationFront != null and corporationFront != ''">#{corporationFront},</if>
  362. <if test="corporationBack != null and corporationBack != ''">#{corporationBack},</if>
  363. <if test="corporationName != null and corporationName != ''">#{corporationName},</if>
  364. <if test="corporationIdCard != null and corporationIdCard != ''">#{corporationIdCard},</if>
  365. <if test="corporationPhone != null and corporationPhone != ''">#{corporationPhone},</if>
  366. <if test="corporationAddress != null and corporationAddress != ''">#{corporationAddress},</if>
  367. <if test="corporationExpirationDate != null and corporationExpirationDate != ''">#{corporationExpirationDate},</if>
  368. <if test="familyPopulation != null and familyPopulation != ''">#{familyPopulation},</if>
  369. <if test="corporationJob != null and corporationJob != ''">#{corporationJob},</if>
  370. <if test="isLoan != null">#{isLoan},</if>
  371. <if test="receivablePay != null">#{receivablePay},</if>
  372. <if test="businessSituation != null">#{businessSituation},</if>
  373. <if test="businessEfficiency != null">#{businessEfficiency},</if>
  374. <if test="corporationMaritalStatus != null">#{corporationMaritalStatus},</if>
  375. <if test="spouseFront != null and spouseFront != ''">#{spouseFront},</if>
  376. <if test="spouseBack != null and spouseBack != ''">#{spouseBack},</if>
  377. <if test="spouseName != null and spouseName != ''">#{spouseName},</if>
  378. <if test="spouseIdCard != null and spouseIdCard != ''">#{spouseIdCard},</if>
  379. <if test="spousePhone != null and spousePhone != ''">#{spousePhone},</if>
  380. <if test="guaranteeType != null and guaranteeType != ''">#{guaranteeType},</if>
  381. <if test="guaranteeFront != null and guaranteeFront != ''">#{guaranteeFront},</if>
  382. <if test="guaranteeBack != null and guaranteeBack != ''">#{guaranteeBack},</if>
  383. <if test="guaranteeName != null and guaranteeName != ''">#{guaranteeName},</if>
  384. <if test="guaranteeIdCard != null and guaranteeIdCard != ''">#{guaranteeIdCard},</if>
  385. <if test="guaranteePhone != null and guaranteePhone != ''">#{guaranteePhone},</if>
  386. <if test="guaranteeMaritalStatus != null">#{guaranteeMaritalStatus},</if>
  387. <if test="guaranteeSpouseFront != null and guaranteeSpouseFront != ''">#{guaranteeSpouseFront},</if>
  388. <if test="guaranteeSpouseBack != null and guaranteeSpouseBack != ''">#{guaranteeSpouseBack},</if>
  389. <if test="guaranteeSpouseName != null and guaranteeSpouseName != ''">#{guaranteeSpouseName},</if>
  390. <if test="guaranteeSpouseIdCard != null and guaranteeSpouseIdCard != ''">#{guaranteeSpouseIdCard},</if>
  391. <if test="guaranteeSpousePhone != null and guaranteeSpousePhone != ''">#{guaranteeSpousePhone},</if>
  392. <if test="guaranteeShareholderName != null and guaranteeShareholderName != ''">#{guaranteeShareholderName},</if>
  393. <if test="guaranteeShareholderIdCard != null and guaranteeShareholderIdCard != ''">#{guaranteeShareholderIdCard},</if>
  394. <if test="userId != null">#{userId},</if>
  395. <if test="idCard != null">#{idCard},</if>
  396. <if test="applicationTime != null">#{applicationTime},</if>
  397. <if test="fileTime != null">#{fileTime},</if>
  398. <if test="reviewTime != null">#{reviewTime},</if>
  399. <if test="loanSchedule != null and loanSchedule != ''">#{loanSchedule},</if>
  400. <if test="auditSchedule != null and auditSchedule != ''">#{auditSchedule},</if>
  401. <if test="auditType != null and auditType != ''">#{auditType},</if>
  402. <if test="loanApplicationType != null and loanApplicationType != ''">#{loanApplicationType},</if>
  403. <if test="reviewSchedule != null and reviewSchedule != ''">#{reviewSchedule},</if>
  404. <if test="rejectionReason != null and rejectionReason != ''">#{rejectionReason},</if>
  405. <if test="aUserId != null">#{aUserId},</if>
  406. <if test="aUserName != null">#{aUserName},</if>
  407. <if test="aAuthorize != null and aAuthorize != ''">#{aAuthorize},</if>
  408. <if test="bUserId != null">#{bUserId},</if>
  409. <if test="bUserName != null">#{bUserName},</if>
  410. <if test="fUserId != null">#{fUserId},</if>
  411. <if test="fUserName != null">#{fUserName},</if>
  412. <if test="createBy != null">#{createBy},</if>
  413. <if test="updateBy != null">#{updateBy},</if>
  414. <if test="updateTime != null">#{updateTime},</if>
  415. <if test="remark != null">#{remark},</if>
  416. sysdate()
  417. </trim>
  418. </insert>
  419. <update id="updateLoanApplication" parameterType="LoanApplication">
  420. update loan_application
  421. <trim prefix="SET" suffixOverrides=",">
  422. <if test="loanApplicationNumber != null">loan_application_number = #{loanApplicationNumber},</if>
  423. <if test="applicationType != null and applicationType != ''">application_type = #{applicationType},</if>
  424. <if test="applicationAmount != null">application_amount = #{applicationAmount},</if>
  425. <if test="actuallyAmount != null">actually_amount = #{actuallyAmount},</if>
  426. <if test="applicationBank != null and applicationBank != ''">application_bank = #{applicationBank},</if>
  427. <if test="usagePeriod != null and usagePeriod != ''">usage_period = #{usagePeriod},</if>
  428. <if test="purposeFunds != null and purposeFunds != ''">purpose_funds = #{purposeFunds},</if>
  429. <if test="repaymentSource != null and repaymentSource != ''">repayment_source = #{repaymentSource},</if>
  430. <if test="enterpriseId != null and enterpriseId != ''">enterprise_id = #{enterpriseId},</if>
  431. <if test="enterpriseName != null and enterpriseName != ''">enterprise_name = #{enterpriseName},</if>
  432. <if test="categoryType != null and categoryType != ''">category_type = #{categoryType},</if>
  433. <if test="isMake != null">is_make = #{isMake},</if>
  434. <if test="isNew != null">is_new = #{isNew},</if>
  435. <if test="isSmall != null">is_small = #{isSmall},</if>
  436. <if test="isDuty != null">is_duty = #{isDuty},</if>
  437. <if test="companyIntroduction != null">company_introduction = #{companyIntroduction},</if>
  438. <if test="customerType != null and customerType != ''">customer_type = #{customerType},</if>
  439. <if test="corporationFront != null and corporationFront != ''">corporation_front = #{corporationFront},</if>
  440. <if test="corporationBack != null and corporationBack != ''">corporation_back = #{corporationBack},</if>
  441. <if test="corporationName != null and corporationName != ''">corporation_name = #{corporationName},</if>
  442. <if test="corporationIdCard != null and corporationIdCard != ''">corporation_id_card = #{corporationIdCard},</if>
  443. <if test="corporationPhone != null and corporationPhone != ''">corporation_phone = #{corporationPhone},</if>
  444. <if test="corporationAddress != null and corporationAddress != ''">corporation_address = #{corporationAddress},</if>
  445. <if test="corporationExpirationDate != null and corporationExpirationDate != ''">corporation_expiration_date = #{corporationExpirationDate},</if>
  446. <if test="familyPopulation != null and familyPopulation != ''">family_population = #{familyPopulation},</if>
  447. <if test="corporationJob != null and corporationJob != ''">corporation_job = #{corporationJob},</if>
  448. <if test="isLoan != null">is_loan = #{isLoan},</if>
  449. <if test="receivablePay != null">receivable_pay = #{receivablePay},</if>
  450. <if test="businessSituation != null">business_situation = #{businessSituation},</if>
  451. <if test="businessEfficiency != null">business_efficiency = #{businessEfficiency},</if>
  452. <if test="corporationMaritalStatus != null">corporation_marital_status = #{corporationMaritalStatus},</if>
  453. <if test="spouseFront != null and spouseFront != ''">spouse_front = #{spouseFront},</if>
  454. <if test="spouseBack != null and spouseBack != ''">spouse_back = #{spouseBack},</if>
  455. <if test="spouseName != null and spouseName != ''">spouse_name = #{spouseName},</if>
  456. <if test="spouseIdCard != null and spouseIdCard != ''">spouse_id_card = #{spouseIdCard},</if>
  457. <if test="spousePhone != null and spousePhone != ''">spouse_phone = #{spousePhone},</if>
  458. <if test="guaranteeType != null and guaranteeType != ''">guarantee_type = #{guaranteeType},</if>
  459. <if test="guaranteeFront != null and guaranteeFront != ''">guarantee_front = #{guaranteeFront},</if>
  460. <if test="guaranteeBack != null and guaranteeBack != ''">guarantee_back = #{guaranteeBack},</if>
  461. <if test="guaranteeName != null and guaranteeName != ''">guarantee_name = #{guaranteeName},</if>
  462. <if test="guaranteeIdCard != null and guaranteeIdCard != ''">guarantee_id_card = #{guaranteeIdCard},</if>
  463. <if test="guaranteePhone != null and guaranteePhone != ''">guarantee_phone = #{guaranteePhone},</if>
  464. <if test="guaranteeMaritalStatus != null">guarantee_marital_status = #{guaranteeMaritalStatus},</if>
  465. <if test="guaranteeSpouseFront != null and guaranteeSpouseFront != ''">guarantee_spouse_front = #{guaranteeSpouseFront},</if>
  466. <if test="guaranteeSpouseBack != null and guaranteeSpouseBack != ''">guarantee_spouse_back = #{guaranteeSpouseBack},</if>
  467. <if test="guaranteeSpouseName != null and guaranteeSpouseName != ''">guarantee_spouse_name = #{guaranteeSpouseName},</if>
  468. <if test="guaranteeSpouseIdCard != null and guaranteeSpouseIdCard != ''">guarantee_spouse_id_card = #{guaranteeSpouseIdCard},</if>
  469. <if test="guaranteeSpousePhone != null and guaranteeSpousePhone != ''">guarantee_spouse_phone = #{guaranteeSpousePhone},</if>
  470. <if test="guaranteeShareholderName != null and guaranteeShareholderName != ''">guarantee_shareholder_name = #{guaranteeShareholderName},</if>
  471. <if test="guaranteeShareholderIdCard != null and guaranteeShareholderIdCard != ''">guarantee_shareholder_id_card = #{guaranteeShareholderIdCard},</if>
  472. <if test="userId != null">user_id = #{userId},</if>
  473. <if test="idCard != null">id_card = #{idCard},</if>
  474. <if test="applicationTime != null">application_time = #{applicationTime},</if>
  475. <if test="fileTime != null">file_time = #{fileTime},</if>
  476. <if test="reviewTime != null">review_time = #{reviewTime},</if>
  477. <if test="loanSchedule != null and loanSchedule != ''">loan_schedule = #{loanSchedule},</if>
  478. <if test="auditSchedule != null and auditSchedule != ''">audit_schedule = #{auditSchedule},</if>
  479. <if test="auditType != null and auditType != ''">audit_type = #{auditType},</if>
  480. <if test="loanApplicationType != null and loanApplicationType != ''">loan_application_type = #{loanApplicationType},</if>
  481. <if test="reviewSchedule != null and reviewSchedule != ''">review_schedule = #{reviewSchedule},</if>
  482. <if test="rejectionReason != null and rejectionReason != ''">rejection_reason = #{rejectionReason},</if>
  483. <if test="aUserId != null">a_user_id = #{aUserId},</if>
  484. <if test="aUserName != null">a_user_name = #{aUserName},</if>
  485. <if test="aAuthorize != null and aAuthorize != ''">a_authorize = #{aAuthorize},</if>
  486. <if test="bUserId != null">b_user_id = #{bUserId},</if>
  487. <if test="bUserName != null">b_user_name = #{bUserName},</if>
  488. <if test="fUserId != null">f_user_id = #{fUserId},</if>
  489. <if test="fUserName != null">f_user_name = #{fUserName},</if>
  490. <if test="createBy != null">create_by = #{createBy},</if>
  491. <if test="createTime != null">create_time = #{createTime},</if>
  492. <if test="updateBy != null">update_by = #{updateBy},</if>
  493. <if test="remark != null">remark = #{remark},</if>
  494. update_time = sysdate(),
  495. </trim>
  496. where loan_application_id = #{loanApplicationId}
  497. </update>
  498. <delete id="deleteLoanApplicationByLoanApplicationId" parameterType="Long">
  499. delete from loan_application where loan_application_id = #{loanApplicationId}
  500. </delete>
  501. <delete id="deleteLoanApplicationByLoanApplicationIds" parameterType="String">
  502. delete from loan_application where loan_application_id in
  503. <foreach item="loanApplicationId" collection="array" open="(" separator="," close=")">
  504. #{loanApplicationId}
  505. </foreach>
  506. </delete>
  507. </mapper>