后台服务
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

WxFlowRecordMapper.xml 3.8 KiB

2 years ago
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
  3. <mapper namespace="com.iformall.mapper.WxFlowRecordMapper">
  4. <resultMap id="BaseResultMap" type="com.iformall.domain.po.WxFlowRecord">
  5. <id column="id" property="id" />
  6. <result column="tenant_id" jdbcType="VARCHAR" property="tenantId" />
  7. <result column="parent_tenant_id" jdbcType="VARCHAR" property="parentTenantId" />
  8. <result column="business_id" property="businessId" />
  9. <result column="business_type" property="businessType" />
  10. <result column="user_id" property="userId" />
  11. <result column="remark" property="remark" />
  12. <result column="status" property="status" />
  13. <result column="task_id" property="taskId" />
  14. <result column="process_instance_id" property="processInstanceId" />
  15. <result column="create_date" property="createDate" />
  16. <result column="update_date" property="updateDate" />
  17. <result column="tenant_id" property="tenantId" />
  18. <result column="user_name" property="userName" />
  19. <result column="task_key" property="taskKey" />
  20. <result column="task_name" property="taskName" />
  21. <result column="curr_status" property="currStatus" />
  22. <result column="variables" property="variables" />
  23. <result column="start_date" property="startDate" />
  24. <result column="contractType" property="contractType" />
  25. <result column="contractNumber" property="contractNumber" />
  26. <result column="endProperty" property="endProperty" />
  27. </resultMap>
  28. <sql id="allColumns">
  29. `id`,`tenant_id`,`parent_tenant_id`,`business_id`,`business_type`,`user_id`,`remark`,`status`,`task_id`,`process_instance_id`,`create_date`,`update_date`,`tenant_id`,`user_name`,task_key,task_name,curr_status,variables,
  30. REPLACE (JSON_EXTRACT(variables,'$.contractType'),'"','') contractType,
  31. REPLACE (JSON_EXTRACT(variables,'$.endProperty'),'"','') endProperty,
  32. REPLACE (JSON_EXTRACT(variables,'$.contractNumber'),'"','') contractNumber,
  33. start_date
  34. </sql>
  35. <sql id="dynamicWhereConditions">
  36. where 1 = 1
  37. <if test=" null != id ">
  38. and `id` = #{id}
  39. </if>
  40. <if test=" null != tenantId and '' != tenantId">
  41. and `tenant_id` = #{tenantId}
  42. </if>
  43. <if test=" null != parentTenantId and '' != parentTenantId">
  44. and `parent_tenant_id` = #{parentTenantId}
  45. </if>
  46. <if test=" null != businessId ">
  47. and `business_id` = #{businessId}
  48. </if>
  49. <if test=" null != userId ">
  50. and `user_id` = #{userId}
  51. </if>
  52. <if test=" null != status ">
  53. and `status` = #{status}
  54. </if>
  55. <if test=" null != businessType ">
  56. and `business_type` = #{businessType}
  57. </if>
  58. <if test=" null != ids ">
  59. and id in
  60. <foreach collection="ids" index="index" item="idItem" open="(" separator="," close=")">
  61. #{idItem}
  62. </foreach>
  63. </if>
  64. <if test=" null != approvalType ">
  65. and json_extract(variables,'$.approvalType') = #{approvalType}
  66. </if>
  67. order by create_date desc
  68. </sql>
  69. <select id="findList" parameterType="com.iformall.domain.po.WxFlowRecord" resultMap="BaseResultMap">
  70. select <include refid="allColumns" /> from wx_flow_record
  71. <include refid="dynamicWhereConditions" />
  72. </select>
  73. <select id="myHandelList" parameterType="com.iformall.domain.po.WxFlowRecord" resultMap="BaseResultMap">
  74. select f.* from wx_flow_record f
  75. where f.user_id = #{userId} and f.status not in(1,4,5)
  76. <if test=" null != businessType ">
  77. and `business_type` = #{businessType}
  78. </if>
  79. order by create_date desc
  80. </select>
  81. <update id="updateCurrStatus" parameterType="com.iformall.domain.po.WxFlowRecord">
  82. update wx_flow_record set curr_status=#{currStatus}
  83. <where>
  84. and status = 1
  85. <if test=" null != processInstanceId ">and process_instance_id=#{processInstanceId}</if>
  86. <if test=" null != businessId ">and business_id = #{businessId}</if>
  87. </where>
  88. </update>
  89. </mapper>