BisInspPlandpRlDao.xml 5.6 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="cn.com.goldenwater.dcproj.dao.BisInspPlandpRlDao">
  4. <resultMap type="cn.com.goldenwater.dcproj.model.BisInspPlandpRl" id="bisInspPlandpRlResultMap">
  5. <result property="id" column="ID"/>
  6. <result property="planId" column="PLAN_ID"/>
  7. <result property="planDpId" column="PLAN_DP_ID"/>
  8. <result property="stage" column="STAGE"/>
  9. <result property="persId" column="PERS_ID"/>
  10. <result property="intm" column="INTM"/>
  11. <result property="uptm" column="UPTM"/>
  12. <result property="dataStat" column="DATA_STAT"/>
  13. </resultMap>
  14. <sql id="table_columns">
  15. ID,
  16. PLAN_ID,
  17. PLAN_DP_ID,
  18. STAGE,
  19. PERS_ID,
  20. INTM,
  21. UPTM,
  22. DATA_STAT
  23. </sql>
  24. <sql id="entity_properties">
  25. #{id},
  26. #{planId},
  27. #{planDpId},
  28. #{stage},
  29. #{persId},
  30. #{intm},
  31. #{uptm},
  32. #{dataStat}
  33. </sql>
  34. <!-- 使用like用法:columnName like concat('%',#columnName#,'%') -->
  35. <sql id="page_where">
  36. <trim prefix="where" prefixOverrides="and | or ">
  37. <if test='planId != null and planId != ""'>and PLAN_ID = #{planId}</if>
  38. <if test='planDpId != null and planDpId != ""'>and PLAN_DP_ID = #{planDpId}</if>
  39. <if test='stage != null and stage != ""'>and STAGE = #{stage}</if>
  40. <if test='persId != null and persId != ""'>and PERS_ID = #{persId}</if>
  41. <if test="intm != null">and INTM = #{intm}</if>
  42. <if test="uptm != null">and UPTM = #{uptm}</if>
  43. and DATA_STAT='0'
  44. </trim>
  45. </sql>
  46. <select id="get" resultMap="bisInspPlandpRlResultMap" parameterType="String">
  47. select
  48. <include refid="table_columns"/>
  49. from BIS_INSP_PLANDP_RL where ID = #{id}
  50. </select>
  51. <select id="getBy" resultMap="bisInspPlandpRlResultMap">
  52. select
  53. <include refid="table_columns"/>
  54. from BIS_INSP_PLANDP_RL
  55. <include refid="page_where"/>
  56. </select>
  57. <select id="findAll" resultMap="bisInspPlandpRlResultMap">
  58. select
  59. <include refid="table_columns"/>
  60. from BIS_INSP_PLANDP_RL
  61. </select>
  62. <select id="findList" resultMap="bisInspPlandpRlResultMap">
  63. select
  64. <include refid="table_columns"/>
  65. from BIS_INSP_PLANDP_RL
  66. <include refid="page_where"/>
  67. </select>
  68. <select id="selectCount" resultType="int">
  69. select count(ID) from BIS_INSP_PLANDP_RL
  70. <include refid="page_where"/>
  71. </select>
  72. <select id="findByPlanDpIdList" resultType="java.lang.String">
  73. select PLAN_DP_ID from BIS_INSP_PLANDP_RL
  74. <include refid="page_where"/>
  75. </select>
  76. <insert id="insert" parameterType="cn.com.goldenwater.dcproj.model.BisInspPlandpRl">
  77. insert into BIS_INSP_PLANDP_RL(
  78. <include refid="table_columns"/>
  79. )
  80. values (
  81. <include refid="entity_properties"/>
  82. )
  83. </insert>
  84. <insert id="batchInsert" parameterType="java.util.ArrayList">
  85. insert all into BIS_INSP_PLANDP_RL(
  86. <include refid="table_columns"/>
  87. )
  88. select
  89. <foreach collection="list" item="item" index="index" separator="UNION select" >
  90. #{item.id},
  91. #{item.planId},
  92. #{item.planDpId},
  93. #{item.stage},
  94. #{item.persId},
  95. #{item.intm},
  96. #{item.uptm},
  97. #{item.dataStat} from dual
  98. </foreach>
  99. </insert>
  100. <delete id="delete" parameterType="java.lang.String">
  101. update BIS_INSP_PLANDP_RL
  102. set DATA_STAT='9'
  103. where ID = #{id}
  104. </delete>
  105. <delete id="deleteBy" parameterType="cn.com.goldenwater.dcproj.model.BisInspPlandpRl">
  106. update BIS_INSP_PLANDP_RL set DATA_STAT='9'
  107. <include refid="page_where"/>
  108. </delete>
  109. <update id="deleteInFlag" parameterType="java.lang.String">
  110. update BIS_INSP_PLANDP_RL
  111. set DATA_STAT = '9'
  112. where ID = #{id}
  113. </update>
  114. <update id="update" parameterType="cn.com.goldenwater.dcproj.model.BisInspPlandpRl">
  115. update BIS_INSP_PLANDP_RL
  116. <trim prefix="set" suffixOverrides=",">
  117. <if test="planId != null and planId != ''">PLAN_ID = #{planId},</if>
  118. <if test="planDpId != null and planDpId != ''">PLAN_DP_ID = #{planDpId},</if>
  119. <if test="stage != null and stage != ''">STAGE = #{stage},</if>
  120. <if test="persId != null and persId != ''">PERS_ID = #{persId},</if>
  121. <if test="intm != null">INTM = #{intm},</if>
  122. <if test="uptm != null">UPTM = #{uptm},</if>
  123. <if test="dataStat != null and dataStat != ''">DATA_STAT = #{dataStat},</if>
  124. </trim>
  125. <where>ID = #{id}</where>
  126. </update>
  127. <update id="updateBy" parameterType="cn.com.goldenwater.dcproj.model.BisInspPlandpRl">
  128. update BIS_INSP_PLANDP_RL
  129. <trim prefix="set" suffixOverrides=",">
  130. <if test="planId != null and planId != ''">PLAN_ID = #{planId},</if>
  131. <if test="planDpId != null and planDpId != ''">PLAN_DP_ID = #{planDpId},</if>
  132. <if test="stage != null and stage != ''">STAGE = #{stage},</if>
  133. <if test="persId != null and persId != ''">PERS_ID = #{persId},</if>
  134. <if test="intm != null">INTM = #{intm},</if>
  135. <if test="uptm != null">UPTM = #{uptm},</if>
  136. <if test="dataStat != null and dataStat != ''">DATA_STAT = #{dataStat},</if>
  137. </trim>
  138. <include refid="page_where"/>
  139. </update>
  140. <!-- 其他自定义SQL -->
  141. </mapper>