智能仲裁后端服务

IdentityAuthenticationMapper.xml 3.8KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  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.wisdomarbitrate.mapper.IdentityAuthenticationMapper">
  6. <resultMap type="IdentityAuthentication" id="IdentityAuthenticationResult">
  7. <id property="id" column="id" />
  8. <result property="name" column="name" />
  9. <result property="identityNo" column="identity_no" />
  10. <result property="certificationTime" column="certification_time" />
  11. <result property="certificationStatus" column="certification_status" />
  12. <result property="userId" column="user_id" />
  13. <result property="userName" column="user_name" />
  14. <result property="idAddress" column="id_address" />
  15. </resultMap>
  16. <insert id="insertIdentityAuthentication" parameterType="IdentityAuthentication" useGeneratedKeys="true" keyProperty="id">
  17. insert into identi_authenti(
  18. <if test="userId != null">user_id,</if>
  19. <if test="idAddress != null and idAddress != ''">id_address,</if>
  20. <if test="name != null and name != ''">name,</if>
  21. <if test="identityNo != null and identityNo != ''">identity_no,</if>
  22. certification_time,
  23. <if test="certificationStatus != null">certification_status,</if>
  24. <if test="userName != null and userName != ''">user_name,</if>
  25. <if test="createBy != null and createBy != ''">create_by,</if>
  26. create_time
  27. )values(
  28. <if test="userId != null ">#{userId},</if>
  29. <if test="idAddress != null and idAddress != ''">#{idAddress},</if>
  30. <if test="name != null and name != ''">#{name},</if>
  31. <if test="identityNo != null and identityNo != ''">#{identityNo},</if>
  32. sysdate(),
  33. <if test="certificationStatus != null ">#{certificationStatus},</if>
  34. <if test="userName != null and userName != ''">#{userName},</if>
  35. <if test="createBy != null and createBy != ''">#{createBy},</if>
  36. sysdate()
  37. )
  38. </insert>
  39. <update id="updateIdentityAuthentication">
  40. update identi_authenti
  41. <set>
  42. <if test="userId != null ">user_id = #{userId},</if>
  43. <if test="userName != null and userName != ''">user_name = #{userName},</if>
  44. <if test="identityNo != null and identityNo != ''">identity_no = #{identityNo},</if>
  45. <if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
  46. update_time = sysdate()
  47. </set>
  48. where id = #{id}
  49. </update>
  50. <select id="selectIdentityAuthentication" parameterType="IdentityAuthentication" resultMap="IdentityAuthenticationResult">
  51. SELECT i.id ,i.name ,i.identity_no ,i.certification_time ,i.certification_status ,i.user_id ,i.user_name
  52. from identi_authenti i
  53. <where>
  54. certification_status=0
  55. <if test="userName != null and userName != '' ">
  56. AND i.user_name = #{userName}
  57. </if>
  58. <if test="userId != null ">
  59. AND i.user_id = #{userId}
  60. </if>
  61. <if test="identityNo != null and identityNo != '' ">
  62. AND i.identity_no = #{identityNo}
  63. </if>
  64. </where>
  65. limit 1
  66. </select>
  67. <select id="selectCountIdentityAuthentication" resultType="Integer">
  68. select count(1) from identi_authenti i
  69. <where>
  70. <if test="userName != null and userName != '' ">
  71. AND i.user_name = #{userName}
  72. </if>
  73. <if test="userId != null ">
  74. AND i.user_id = #{userId}
  75. </if>
  76. </where>
  77. </select>
  78. </mapper>