BisInspPlanDtlPtypDao.xml 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157
  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.BisInspPlanDtlPtypDao">
  4. <resultMap type="cn.com.goldenwater.dcproj.model.BisInspPlanDtlPtyp" id="bisInspPlanDtlPtypResultMap">
  5. <result property="id" column="ID"/>
  6. <result property="planDtlId" column="PLAN_DTL_ID"/>
  7. <result property="nm" column="NM"/>
  8. <result property="ptype" column="PTYPE"/>
  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_DTL_ID,
  17. NM,
  18. PTYPE,
  19. PERS_ID,
  20. INTM,
  21. UPTM,
  22. DATA_STAT
  23. </sql>
  24. <sql id="entity_properties">
  25. #{id},
  26. #{planDtlId},
  27. #{nm},
  28. #{ptype},
  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="planDtlId != null and planDtlId != ''">and PLAN_DTL_ID = #{planDtlId}</if>
  38. <if test="nm != null and nm != ''">and NM = #{nm}</if>
  39. <if test="ptype != null and ptype != ''">and PTYPE = #{ptype}</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. <if test="dataStat != null and dataStat != ''">and DATA_STAT = #{dataStat}</if>
  44. and DATA_STAT='0'
  45. </trim>
  46. </sql>
  47. <select id="get" resultMap="bisInspPlanDtlPtypResultMap" parameterType="String">
  48. select
  49. <include refid="table_columns"/>
  50. from BIS_INSP_PLAN_DTL_PTYP where ID = #{id}
  51. </select>
  52. <select id="getBy" resultMap="bisInspPlanDtlPtypResultMap">
  53. select
  54. <include refid="table_columns"/>
  55. from BIS_INSP_PLAN_DTL_PTYP
  56. <include refid="page_where"/>
  57. </select>
  58. <select id="findAll" resultMap="bisInspPlanDtlPtypResultMap">
  59. select
  60. <include refid="table_columns"/>
  61. from BIS_INSP_PLAN_DTL_PTYP
  62. </select>
  63. <select id="findList" resultMap="bisInspPlanDtlPtypResultMap">
  64. select
  65. <include refid="table_columns"/>
  66. from BIS_INSP_PLAN_DTL_PTYP
  67. <include refid="page_where"/>
  68. </select>
  69. <select id="selectCount" resultType="int">
  70. select count(ID) from BIS_INSP_PLAN_DTL_PTYP
  71. <include refid="page_where"/>
  72. </select>
  73. <insert id="insert" parameterType="cn.com.goldenwater.dcproj.model.BisInspPlanDtlPtyp">
  74. insert into BIS_INSP_PLAN_DTL_PTYP(
  75. <include refid="table_columns"/>
  76. )
  77. values (
  78. <include refid="entity_properties"/>
  79. )
  80. </insert>
  81. <delete id="delete" parameterType="java.lang.String">
  82. update BIS_INSP_PLAN_DTL_PTYP
  83. set DATA_STAT='9'
  84. where ID = #{id}
  85. </delete>
  86. <delete id="deleteBy" parameterType="cn.com.goldenwater.dcproj.model.BisInspPlanDtlPtyp">
  87. update BIS_INSP_PLAN_DTL_PTYP set DATA_STAT='9'
  88. <include refid="page_where"/>
  89. </delete>
  90. <update id="deleteInFlag" parameterType="java.lang.String">
  91. update BIS_INSP_PLAN_DTL_PTYP
  92. set DATA_STAT = '9'
  93. where ID = #{id}
  94. </update>
  95. <update id="update" parameterType="cn.com.goldenwater.dcproj.model.BisInspPlanDtlPtyp">
  96. update BIS_INSP_PLAN_DTL_PTYP
  97. <trim prefix="set" suffixOverrides=",">
  98. <if test="planDtlId != null and planDtlId != ''">PLAN_DTL_ID = #{planDtlId},</if>
  99. <if test="nm != null and nm != ''">NM = #{nm},</if>
  100. <if test="ptype != null and ptype != ''">PTYPE = #{ptype},</if>
  101. <if test="persId != null and persId != ''">PERS_ID = #{persId},</if>
  102. <if test="intm != null">INTM = #{intm},</if>
  103. <if test="uptm != null">UPTM = #{uptm},</if>
  104. <if test="dataStat != null and dataStat != ''">DATA_STAT = #{dataStat},</if>
  105. </trim>
  106. <where>ID = #{id}</where>
  107. </update>
  108. <update id="updateBy" parameterType="cn.com.goldenwater.dcproj.model.BisInspPlanDtlPtyp">
  109. update BIS_INSP_PLAN_DTL_PTYP
  110. <trim prefix="set" suffixOverrides=",">
  111. <if test="planDtlId != null and planDtlId != ''">PLAN_DTL_ID = #{planDtlId},</if>
  112. <if test="nm != null and nm != ''">NM = #{nm},</if>
  113. <if test="ptype != null and ptype != ''">PTYPE = #{ptype},</if>
  114. <if test="persId != null and persId != ''">PERS_ID = #{persId},</if>
  115. <if test="intm != null">INTM = #{intm},</if>
  116. <if test="uptm != null">UPTM = #{uptm},</if>
  117. <if test="dataStat != null and dataStat != ''">DATA_STAT = #{dataStat},</if>
  118. </trim>
  119. <include refid="page_where"/>
  120. </update>
  121. <!-- 其他自定义SQL -->
  122. <insert id="batchInsert" parameterType="java.util.ArrayList">
  123. insert all into BIS_INSP_PLAN_DTL_PTYP(
  124. <include refid="table_columns"/>
  125. )
  126. select
  127. <foreach collection="list" item="item" index="index" separator="UNION select">
  128. #{item.id},
  129. #{item.planDtlId},
  130. #{item.nm},
  131. #{item.ptype},
  132. #{item.persId},
  133. #{item.intm},
  134. #{item.uptm},
  135. #{item.dataStat} from dual
  136. </foreach>
  137. </insert>
  138. </mapper>