ShareholderFjMapper.xml 10 KB

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