ShareholderFjMapper.xml 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144
  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.ShareholderFjMapper">
  6. <resultMap type="ShareholderFj" id="ShareholderFjResult">
  7. <result property="shareholderFjId" column="shareholder_fj_id" />
  8. <result property="loanApplicationId" column="loan_application_id" />
  9. <result property="loanApplicationNumber" column="loan_application_number" />
  10. <result property="shareholderIdCard" column="shareholder_id_card" />
  11. <result property="shareholderName" column="shareholder_name" />
  12. <result property="shareholderFrontName" column="shareholder_front_name" />
  13. <result property="shareholderFrontUrl" column="shareholder_front_url" />
  14. <result property="shareholderBackName" column="shareholder_back_name" />
  15. <result property="shareholderBackUrl" column="shareholder_back_url" />
  16. <result property="shareholderZxName" column="shareholder_zx_name" />
  17. <result property="shareholderZxUrl" column="shareholder_zx_url" />
  18. <result property="shareholderZxUrlPdf" column="shareholder_zx_url_pdf" />
  19. <result property="shareholderBusinessUrl" column="shareholder_business_url" />
  20. <result property="createBy" column="create_by" />
  21. <result property="createTime" column="create_time" />
  22. <result property="updateBy" column="update_by" />
  23. <result property="updateTime" column="update_time" />
  24. <result property="remark" column="remark" />
  25. </resultMap>
  26. <sql id="selectShareholderFjVo">
  27. select shareholder_fj_id, loan_application_id, loan_application_number, shareholder_id_card, shareholder_name,shareholder_front_name, shareholder_front_url,shareholder_back_name, shareholder_back_url,shareholder_zx_name, shareholder_zx_url,shareholder_zx_url_pdf,shareholder_business_url, create_by, create_time, update_by, update_time, remark from shareholder_fj
  28. </sql>
  29. <select id="selectShareholderFjList" parameterType="ShareholderFj" resultMap="ShareholderFjResult">
  30. <include refid="selectShareholderFjVo"/>
  31. <where>
  32. <if test="loanApplicationId != null "> and loan_application_id = #{loanApplicationId}</if>
  33. <if test="loanApplicationNumber != null and loanApplicationNumber != ''"> and loan_application_number = #{loanApplicationNumber}</if>
  34. <if test="shareholderIdCard != null and shareholderIdCard != ''"> and shareholder_id_card = #{shareholderIdCard}</if>
  35. <if test="shareholderName != null and shareholderName != ''"> and shareholder_name like concat('%', #{shareholderName}, '%')</if>
  36. <if test="shareholderFrontUrl != null and shareholderFrontUrl != ''"> and shareholder_front_url = #{shareholderFrontUrl}</if>
  37. <if test="shareholderBackUrl != null and shareholderBackUrl != ''"> and shareholder_back_url = #{shareholderBackUrl}</if>
  38. <if test="shareholderZxUrl != null and shareholderZxUrl != ''"> and shareholder_zx_url = #{shareholderZxUrl}</if>
  39. </where>
  40. order by create_time
  41. </select>
  42. <select id="selectShareholderFjLoanApplicationId" parameterType="ShareholderFj" resultMap="ShareholderFjResult">
  43. <include refid="selectShareholderFjVo"/>
  44. <where>
  45. <if test="loanApplicationId != null "> and loan_application_id = #{loanApplicationId}</if>
  46. </where>
  47. order by create_time
  48. </select>
  49. <select id="selectShareholderFjByShareholderFjId" parameterType="Long" resultMap="ShareholderFjResult">
  50. <include refid="selectShareholderFjVo"/>
  51. where shareholder_fj_id = #{shareholderFjId}
  52. </select>
  53. <insert id="insertShareholderFj" parameterType="ShareholderFj" useGeneratedKeys="true" keyProperty="shareholderFjId">
  54. insert into shareholder_fj
  55. <trim prefix="(" suffix=")" suffixOverrides=",">
  56. <if test="loanApplicationId != null">loan_application_id,</if>
  57. <if test="loanApplicationNumber != null and loanApplicationNumber != ''">loan_application_number,</if>
  58. <if test="shareholderIdCard != null and shareholderIdCard != ''">shareholder_id_card,</if>
  59. <if test="shareholderName != null and shareholderName != ''">shareholder_name,</if>
  60. <if test="shareholderFrontName != null and shareholderFrontName != ''">shareholder_front_name,</if>
  61. <if test="shareholderFrontUrl != null and shareholderFrontUrl != ''">shareholder_front_url,</if>
  62. <if test="shareholderBackName != null and shareholderBackName != ''">shareholder_back_name,</if>
  63. <if test="shareholderBackUrl != null and shareholderBackUrl != ''">shareholder_back_url,</if>
  64. <if test="shareholderZxName != null and shareholderZxName != ''" >shareholder_zx_name,</if>
  65. <if test="shareholderZxUrl != null and shareholderZxUrl != ''">shareholder_zx_url,</if>
  66. <if test="shareholderZxUrlPdf != null and shareholderZxUrlPdf != ''">shareholder_zx_url_pdf,</if>
  67. <if test="shareholderBusinessUrl != null and shareholderBusinessUrl != ''">shareholder_business_url,</if>
  68. <if test="createBy != null">create_by,</if>
  69. <if test="updateBy != null">update_by,</if>
  70. <if test="updateTime != null">update_time,</if>
  71. <if test="remark != null">remark,</if>
  72. create_time
  73. </trim>
  74. <trim prefix="values (" suffix=")" suffixOverrides=",">
  75. <if test="loanApplicationId != null">#{loanApplicationId},</if>
  76. <if test="loanApplicationNumber != null and loanApplicationNumber != ''">#{loanApplicationNumber},</if>
  77. <if test="shareholderIdCard != null and shareholderIdCard != ''">#{shareholderIdCard},</if>
  78. <if test="shareholderName != null and shareholderName != ''">#{shareholderName},</if>
  79. <if test="shareholderFrontName != null and shareholderFrontName != ''">#{shareholderFrontName},</if>
  80. <if test="shareholderFrontUrl != null and shareholderFrontUrl != ''">#{shareholderFrontUrl},</if>
  81. <if test="shareholderBackName != null and shareholderBackName != ''">#{shareholderBackName},</if>
  82. <if test="shareholderBackUrl != null and shareholderBackUrl != ''">#{shareholderBackUrl},</if>
  83. <if test="shareholderZxName != null and shareholderZxName != ''">#{shareholderZxName},</if>
  84. <if test="shareholderZxUrl != null and shareholderZxUrl != ''">#{shareholderZxUrl},</if>
  85. <if test="shareholderZxUrlPdf != null and shareholderZxUrlPdf != ''">#{shareholderZxUrlPdf},</if>
  86. <if test="shareholderBusinessUrl != null and shareholderBusinessUrl != ''">#{shareholderBusinessUrl},</if>
  87. <if test="createBy != null">#{createBy},</if>
  88. <if test="updateBy != null">#{updateBy},</if>
  89. <if test="updateTime != null">#{updateTime},</if>
  90. <if test="remark != null">#{remark},</if>
  91. sysdate()
  92. </trim>
  93. </insert>
  94. <insert id="batchShareholderFj">
  95. insert into shareholder_fj(loan_application_id, loan_application_number, shareholder_front_url, shareholder_back_url, shareholder_zx_url,shareholder_zx_url_pdf,shareholder_business_url, create_time) values
  96. <foreach item="item" index="index" collection="list" separator=",">
  97. (#{item.loanApplicationId},#{item.loanApplicationNumber},#{item.shareholderFrontUrl},#{item.shareholderBackUrl},#{item.shareholderZxUrl},#{item.shareholderZxUrlPdf},#{item.shareholderBusinessUrl},sysdate())
  98. </foreach>
  99. </insert>
  100. <update id="updateShareholderFj" parameterType="ShareholderFj">
  101. update shareholder_fj
  102. <trim prefix="SET" suffixOverrides=",">
  103. <if test="loanApplicationId != null">loan_application_id = #{loanApplicationId},</if>
  104. <if test="loanApplicationNumber != null and loanApplicationNumber != ''">loan_application_number = #{loanApplicationNumber},</if>
  105. <if test="shareholderIdCard != null and shareholderIdCard != ''">shareholder_id_card = #{shareholderIdCard},</if>
  106. <if test="shareholderName != null ">shareholder_name = #{shareholderName},</if>
  107. <if test="shareholderFrontName != null ">shareholder_front_name = #{shareholderFrontName},</if>
  108. <if test="shareholderFrontUrl != null ">shareholder_front_url = #{shareholderFrontUrl},</if>
  109. <if test="shareholderBackName != null ">shareholder_back_name = #{shareholderBackName},</if>
  110. <if test="shareholderBackUrl != null ">shareholder_back_url = #{shareholderBackUrl},</if>
  111. <if test="shareholderZxName != null and shareholderZxName != ''">shareholder_zx_name = #{shareholderZxName},</if>
  112. <if test="shareholderZxUrl != null and shareholderZxUrl != ''">shareholder_zx_url = #{shareholderZxUrl},</if>
  113. <if test="shareholderZxUrlPdf != null and shareholderZxUrlPdf != ''">shareholder_zx_url_pdf = #{shareholderZxUrlPdf},</if>
  114. <if test="shareholderBusinessUrl != null ">shareholder_business_url = #{shareholderBusinessUrl},</if>
  115. <if test="createBy != null">create_by = #{createBy},</if>
  116. <if test="createTime != null">create_time = #{createTime},</if>
  117. <if test="updateBy != null">update_by = #{updateBy},</if>
  118. <if test="updateTime != null">update_time = #{updateTime},</if>
  119. <if test="remark != null">remark = #{remark},</if>
  120. </trim>
  121. where shareholder_fj_id = #{shareholderFjId}
  122. </update>
  123. <delete id="deleteShareholderFjByShareholderFjId" parameterType="Long">
  124. delete from shareholder_fj where shareholder_fj_id = #{shareholderFjId}
  125. </delete>
  126. <delete id="deleteShareholderFjByShareholderFjIds" parameterType="String">
  127. delete from shareholder_fj where shareholder_fj_id in
  128. <foreach item="shareholderFjId" collection="array" open="(" separator="," close=")">
  129. #{shareholderFjId}
  130. </foreach>
  131. </delete>
  132. <delete id="deleteShareholderFjByLoanApplicationId" parameterType="Long">
  133. delete from shareholder_fj where loan_application_id = #{LoanApplicationId}
  134. </delete>
  135. </mapper>