WfActivityMemberMapper.xml 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124
  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.zhyc.xps.bpm.mapper.WfActivityMemberMapper">
  4. <resultMap id="BaseResultMap" type="com.zhyc.xps.bpm.entity.WfActivityMember">
  5. <result column="oc_id" property="ocId" jdbcType="BIGINT" />
  6. <result column="wf_def_id" property="wfDefId" jdbcType="BIGINT" />
  7. <result column="activity_def_id" property="activityDefId" jdbcType="BIGINT" />
  8. <result column="group_id" property="groupId" jdbcType="BIGINT" />
  9. <result column="position_id" property="positionId" jdbcType="BIGINT" />
  10. <result column="account_id" property="accountId" jdbcType="BIGINT" />
  11. </resultMap>
  12. <resultMap id="WfActivityMemberDtoResultMap" type="com.zhyc.xps.bpm.dto.WfActivityMemberDto" extends="BaseResultMap">
  13. <result column="wf_def_title" property="wfDefTitle" jdbcType="VARCHAR"/>
  14. <result column="activity_def_title" property="activityDefTitle" jdbcType="VARCHAR"/>
  15. <result column="group_name" property="groupName" jdbcType="VARCHAR"/>
  16. <result column="position_name" property="positionName" jdbcType="VARCHAR"/>
  17. <result column="account_name" property="accountName" jdbcType="VARCHAR"/>
  18. </resultMap>
  19. <sql id="Base_Column_List">
  20. oc_id,
  21. wf_def_id,
  22. activity_def_id,
  23. group_id,
  24. position_id,
  25. account_id
  26. </sql>
  27. <sql id="Ext_Column_List">
  28. A.oc_id,
  29. A.wf_def_id,
  30. B.wf_def_title,
  31. A.activity_def_id,
  32. C.activity_def_title,
  33. A.group_id,
  34. D.group_name,
  35. A.position_id,
  36. E.position_name,
  37. A.account_id,
  38. F.account_name
  39. </sql>
  40. <!--查询信息-->
  41. <select id="getByList" parameterType="java.util.Map" resultMap="WfActivityMemberDtoResultMap">
  42. SELECT
  43. <include refid="Ext_Column_List"/>
  44. FROM wf_activity_member AS A
  45. LEFT JOIN wf_def AS B ON (A.wf_def_id = B.wf_def_id)
  46. LEFT JOIN wf_activity_def AS C ON (A.wf_def_id = C.wf_def_id AND A.activity_def_id = C.activity_def_id)
  47. LEFT JOIN s_group AS D ON (A.oc_id = D.oc_id AND A.group_id = D.group_id)
  48. LEFT JOIN s_position AS E ON (A.oc_id = E.oc_id AND A.position_id = E.position_id)
  49. LEFT JOIN account AS F ON (A.oc_id = F.oc_id AND A.account_id = F.account_id)
  50. WHERE 1 = 1
  51. <if test="ocId != null">
  52. AND A.oc_id = #{ocId ,jdbcType=BIGINT}
  53. </if>
  54. <if test="wfDefId != null">
  55. AND A.wf_def_id = #{wfDefId ,jdbcType=BIGINT}
  56. </if>
  57. ORDER BY A.activity_def_id ASC
  58. </select>
  59. <!--INSERT-->
  60. <insert id="create" parameterType="com.zhyc.xps.bpm.entity.WfActivityMember">
  61. INSERT INTO wf_activity_member
  62. <trim prefix="(" suffix=")" suffixOverrides=",">
  63. <if test="ocId != null">
  64. oc_id,
  65. </if>
  66. <if test="wfDefId != null">
  67. wf_def_id,
  68. </if>
  69. <if test="activityDefId != null">
  70. activity_def_id,
  71. </if>
  72. <if test="groupId != null">
  73. group_id,
  74. </if>
  75. <if test="positionId != null">
  76. position_id,
  77. </if>
  78. <if test="accountId != null">
  79. account_id,
  80. </if>
  81. </trim>
  82. <trim prefix="values (" suffix=")" suffixOverrides=",">
  83. <if test="ocId != null">
  84. #{ocId ,jdbcType=BIGINT},
  85. </if>
  86. <if test="wfDefId != null">
  87. #{wfDefId ,jdbcType=BIGINT},
  88. </if>
  89. <if test="activityDefId != null">
  90. #{activityDefId ,jdbcType=BIGINT},
  91. </if>
  92. <if test="groupId != null">
  93. #{groupId ,jdbcType=BIGINT},
  94. </if>
  95. <if test="positionId != null">
  96. #{positionId ,jdbcType=TIMESTAMP},
  97. </if>
  98. <if test="accountId != null">
  99. #{accountId ,jdbcType=TIMESTAMP},
  100. </if>
  101. </trim>
  102. </insert>
  103. <!--删除-->
  104. <delete id="delete" parameterType="java.util.Map">
  105. DELETE FROM wf_activity_member
  106. WHERE 1 = 1
  107. <if test="ocId != null">
  108. AND oc_id = #{ocId ,jdbcType=BIGINT}
  109. </if>
  110. <if test="wfDefId != null">
  111. AND wf_def_id = #{wfDefId ,jdbcType=BIGINT}
  112. </if>
  113. <if test="activityDefId != null">
  114. AND activity_def_id = #{activityDefId ,jdbcType=BIGINT}
  115. </if>
  116. </delete>
  117. </mapper>