智能仲裁后端服务

DeptIdentifyMapper.xml 4.9KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123
  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.DeptIdentifyMapper">
  6. <resultMap type="DeptIdentify" id="DeptIdentifyResult">
  7. <id property="id" column="id" />
  8. <result property="deptId" column="dept_id" />
  9. <result property="userId" column="user_id" />
  10. <result property="identifyStatus" column="identify_status" />
  11. <result property="identifyDate" column="identify_date" />
  12. <result property="isUse" column="is_use" />
  13. <result property="nickName" column="nick_name" />
  14. <result property="phonenumber" column="phonenumber" />
  15. <result property="deptName" column="dept_name" />
  16. <result property="sealName" column="seal_name" />
  17. <result property="orgId" column="org_id" />
  18. <result property="authFlowId" column="auth_flow_id" />
  19. <result property="sealId" column="seal_id" />
  20. <result property="sealStatus" column="seal_status" />
  21. </resultMap>
  22. <select id="selectDeptIdentify" parameterType="DeptIdentify" resultMap="DeptIdentifyResult">
  23. SELECT ud.user_id , ud.nick_name ,ud.phonenumber ,ud.dept_id ,d.dept_name
  24. FROM (SELECT u.user_id , u.nick_name ,u.phonenumber ,u.dept_id
  25. FROM sys_user_post up left join sys_user u on u.user_id = up.user_id
  26. left join sys_post sp on up.post_id = sp.post_id
  27. where sp.post_code = 'jbr') ud left join sys_dept d on ud.dept_id = d.dept_id
  28. WHERE d.dept_type = 1
  29. </select>
  30. <select id="selectDeptIdentifyBydeptid" parameterType="DeptIdentify" resultMap="DeptIdentifyResult">
  31. SELECT d.id ,d.dept_id ,d.user_id ,d.org_id ,d.auth_flow_id
  32. from dept_identify d
  33. <where>
  34. <if test="deptId != null">
  35. AND d.dept_id = #{deptId}
  36. </if>
  37. <if test="userId != null">
  38. AND d.user_id = #{userId}
  39. </if>
  40. </where>
  41. </select>
  42. <insert id="insertDeptIdentify" parameterType="DeptIdentify" useGeneratedKeys="true" keyProperty="id">
  43. insert into dept_identify(
  44. <if test="deptId != null">dept_id,</if>
  45. <if test="userId != null">user_id,</if>
  46. <if test="identifyStatus != null">identify_status</if>
  47. )values(
  48. <if test="deptId != null">#{deptId},</if>
  49. <if test="userId != null">#{userId},</if>
  50. <if test="identifyStatus != null">#{identifyStatus}</if>
  51. )
  52. </insert>
  53. <select id="selectDeptIdentifylist" parameterType="DeptIdentify" resultMap="DeptIdentifyResult">
  54. SELECT d.id ,d.dept_id ,d.user_id, d.identify_status ,d.identify_date ,d.is_use , d.seal_name,
  55. d.org_id , d.seal_id ,sd.dept_name , u.nick_name ,u.phonenumber
  56. from dept_identify d left join sys_dept sd on d.dept_id = sd.dept_id
  57. left join sys_user u on u.user_id = d.user_id
  58. <where>
  59. <if test="identifyStatus != null">
  60. AND d.identify_status = #{identifyStatus}
  61. </if>
  62. <if test="isUse != null">
  63. AND d.is_use = #{isUse}
  64. </if>
  65. <if test="id != null">
  66. AND d.id = #{id}
  67. </if>
  68. </where>
  69. </select>
  70. <select id="selectDeptIdentifylistother" parameterType="DeptIdentify" resultMap="DeptIdentifyResult">
  71. SELECT d.id ,d.dept_id ,d.user_id,d.identify_status ,d.is_use ,d.sealName ,d.sealId ,d.annexId
  72. from dept_identify d
  73. <where>
  74. <if test="identifyStatus != null">
  75. AND d.identify_status = #{identifyStatus}
  76. </if>
  77. <if test="id != null">
  78. AND d.id = #{id}
  79. </if>
  80. <if test="sealStatus != null">
  81. AND d.seal_status = #{sealStatus}
  82. </if>
  83. <if test="deptId != null">
  84. AND d.dept_id = #{deptId}
  85. </if>
  86. </where>
  87. </select>
  88. <update id="updateDeptIdentify" parameterType="DeptIdentify">
  89. update dept_identify
  90. <set>
  91. <if test="identifyDate != null">identify_date = #{identifyDate},</if>
  92. <if test="isUse != null">is_use = #{isUse},</if>
  93. <if test="identifyStatus != null ">identify_status = #{identifyStatus},</if>
  94. <if test="sealName != null and sealName != ''">seal_name = #{sealName},</if>
  95. <if test="sealId != null and sealId != ''">seal_id = #{sealId},</if>
  96. <if test="sealStatus != null ">seal_status = #{sealStatus},</if>
  97. </set>
  98. <where>
  99. <if test="id != null">
  100. AND d.id = #{id}
  101. </if>
  102. <if test="sealId != null">
  103. AND seal_id = #{sealId}
  104. </if>
  105. </where>
  106. </update>
  107. </mapper>