WfExampleMapper.xml 6.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162
  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.WfExampleMapper">
  4. <resultMap id="WfExampleInsDtoResultMap" type="com.zhyc.xps.bpm.dto.WfExampleInsDto" >
  5. <result column="oc_id" property="ocId" jdbcType="BIGINT" />
  6. <result column="example_id" property="exampleId" jdbcType="BIGINT" />
  7. <result column="example_title" property="exampleTitle" jdbcType="VARCHAR" />
  8. <result column="example_desc" property="exampleDesc" jdbcType="VARCHAR" />
  9. <result column="wf_def_id" property="wfDefId" jdbcType="BIGINT" />
  10. <result column="wf_ins_id" property="wfInsId" jdbcType="BIGINT" />
  11. <result column="cur_activity_ins_id" property="curActivityInsId" jdbcType="BIGINT" />
  12. <result column="cur_activity_code" property="curActivityCode" jdbcType="VARCHAR" />
  13. <result column="cur_activity_title" property="curActivityTitle" jdbcType="VARCHAR" />
  14. <result column="cur_activity_begin_time" property="curActivityBeginTime" jdbcType="TIMESTAMP"/>
  15. <result column="cur_form_code" property="curFormCode" jdbcType="VARCHAR" />
  16. <result column="cur_group_id" property="curGroupId" jdbcType="BIGINT" />
  17. <result column="cur_position_id" property="curPositionId" jdbcType="BIGINT" />
  18. <result column="cur_account_id" property="curAccountId" jdbcType="BIGINT" />
  19. <result column="cur_group_name" property="curGroupName" jdbcType="VARCHAR" />
  20. <result column="cur_position_name" property="curPositionName" jdbcType="VARCHAR" />
  21. <result column="cur_account_name" property="curAccountName" jdbcType="VARCHAR" />
  22. </resultMap>
  23. <sql id="WfExampleInsDto_Cols">
  24. A.oc_id,
  25. A.example_id,
  26. A.example_title,
  27. A.example_desc,
  28. W.wf_def_id,
  29. W.wf_ins_id,
  30. W.cur_activity_title,
  31. W.cur_activity_code,
  32. W.cur_form_code,
  33. W.cur_activity_ins_id,
  34. W.cur_group_id,
  35. W.cur_activity_begin_time,
  36. W.cur_group_id,
  37. W.cur_group_name,
  38. W.cur_position_id,
  39. W.cur_position_name,
  40. W.cur_account_id,
  41. W.cur_account_name
  42. </sql>
  43. <!--根据ID获取信息-->
  44. <select id="getById" resultMap="WfExampleInsDtoResultMap">
  45. SELECT
  46. <include refid="WfExampleInsDto_Cols"/>
  47. FROM wf_example AS A
  48. LEFT JOIN wf_ins AS W ON (A.oc_id = W.oc_id AND A.example_id = W.wf_ins_id)
  49. WHERE A.deleted_flag = 0
  50. <if test="ocId != null">
  51. AND A.oc_id = #{ocId ,jdbcType=BIGINT}
  52. </if>
  53. <if test="exampleId != null">
  54. AND A.example_id = #{exampleId ,jdbcType=BIGINT}
  55. </if>
  56. </select>
  57. <!--分页查询信息-->
  58. <select id="getByPage" parameterType="java.util.Map" resultMap="WfExampleInsDtoResultMap">
  59. SELECT
  60. <include refid="WfExampleInsDto_Cols"/>
  61. FROM wf_example AS A
  62. LEFT JOIN wf_ins AS W ON (A.oc_id = W.oc_id AND A.example_id = W.wf_ins_id)
  63. WHERE A.deleted_flag = 0
  64. <if test="ocId != null">
  65. AND A.oc_id = #{ocId ,jdbcType=BIGINT}
  66. </if>
  67. <if test="keywords != null and keywords != ''">
  68. and A.example_title like "%"#{keywords}"%"
  69. </if>
  70. ORDER BY example_id ASC
  71. </select>
  72. <select id="getByList" resultMap="WfExampleInsDtoResultMap" parameterType="java.util.Map">
  73. SELECT
  74. <include refid="WfExampleInsDto_Cols"/>
  75. FROM wf_example AS A
  76. LEFT JOIN wf_ins AS W ON (A.oc_id = W.oc_id AND A.example_id = W.wf_ins_id)
  77. WHERE A.deleted_flag = 0
  78. <if test="ocId != null">
  79. AND A.oc_id = #{ocId ,jdbcType=BIGINT}
  80. </if>
  81. <if test="keywords != null and keywords != ''">
  82. and A.example_title like "%"#{keywords}"%"
  83. </if>
  84. </select>
  85. <insert id="create" parameterType="com.zhyc.xps.bpm.entity.WfExample">
  86. INSERT INTO wf_example
  87. <trim prefix="(" suffix=")" suffixOverrides=",">
  88. <if test="ocId != null">
  89. oc_id,
  90. </if>
  91. <if test="exampleId != null">
  92. example_id,
  93. </if>
  94. <if test="exampleTitle != null">
  95. example_title,
  96. </if>
  97. <if test="exampleDesc != null">
  98. example_desc,
  99. </if>
  100. <if test="status != null">
  101. status,
  102. </if>
  103. </trim>
  104. <trim prefix="values (" suffix=")" suffixOverrides=",">
  105. <if test="ocId != null">
  106. #{ocId ,jdbcType=BIGINT},
  107. </if>
  108. <if test="exampleId != null">
  109. #{exampleId ,jdbcType=BIGINT},
  110. </if>
  111. <if test="exampleTitle != null">
  112. #{exampleTitle ,jdbcType=VARCHAR},
  113. </if>
  114. <if test="exampleDesc != null">
  115. #{exampleDesc ,jdbcType=VARCHAR},
  116. </if>
  117. <if test="status != null">
  118. #{status ,jdbcType=BIGINT},
  119. </if>
  120. </trim>
  121. </insert>
  122. <!--更新-->
  123. <update id="update" parameterType="com.zhyc.xps.bpm.entity.WfExample">
  124. UPDATE wf_example
  125. <trim suffixOverrides=",">
  126. <set>
  127. <if test="exampleTitle != null and exampleTitle != ''">
  128. example_title = #{exampleTitle, jdbcType=VARCHAR},
  129. </if>
  130. <if test="exampleDesc != null and exampleDesc != ''">
  131. example_desc = #{exampleDesc, jdbcType=VARCHAR},
  132. </if>
  133. </set>
  134. </trim>
  135. WHERE 1 = 1
  136. <if test="ocId != null">
  137. AND oc_id = #{ocId ,jdbcType=BIGINT}
  138. </if>
  139. <if test="exampleId != null">
  140. AND example_id = #{exampleId ,jdbcType=BIGINT}
  141. </if>
  142. </update>
  143. <!--删除-->
  144. <delete id="delete" parameterType="java.util.Map">
  145. delete from wf_example
  146. WHERE oc_id = #{ocId ,jdbcType=BIGINT}
  147. <if test="exampleId != null">
  148. AND example_id = #{exampleId ,jdbcType=BIGINT}
  149. </if>
  150. </delete>
  151. </mapper>