c1b921a3932c5204a59a76f1d8d3d5bb40efebfb.svn-base 5.4 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.BisInspPblmPDao">
  4. <resultMap type="cn.com.goldenwater.dcproj.model.BisInspPblmP" id="bisInspPblmPResultMap">
  5. <result property="id" column="ID"/>
  6. <result property="nm" column="NM"/>
  7. <result property="objType" column="OBJ_TYPE"/>
  8. <result property="isDefault" column="IS_DEFAULT"/>
  9. <result property="intm" column="INTM"/>
  10. <result property="uptm" column="UPTM"/>
  11. <result property="dataStat" column="DATA_STAT"/>
  12. </resultMap>
  13. <sql id="table_columns">
  14. ID
  15. ,
  16. NM,
  17. OBJ_TYPE,
  18. IS_DEFAULT,
  19. INTM,
  20. UPTM,
  21. DATA_STAT
  22. </sql>
  23. <sql id="entity_properties">
  24. #{id}
  25. ,
  26. #{nm},
  27. #{objType},
  28. #{isDefault},
  29. #{intm},
  30. #{uptm},
  31. #{dataStat}
  32. </sql>
  33. <sql id="page_where">
  34. <trim prefix="where" prefixOverrides="and | or ">
  35. <if test="nm != null and nm != ''">and NM LIKE '%${nm}%'</if>
  36. <if test="objType != null and objType != ''">and OBJ_TYPE = #{objType}</if>
  37. <if test="isDefault != null and isDefault != ''">and IS_DEFAULT = #{isDefault}</if>
  38. and DATA_STAT='0'
  39. </trim>
  40. </sql>
  41. <select id="get" resultMap="bisInspPblmPResultMap" parameterType="String">
  42. select
  43. <include refid="table_columns"/>
  44. from BIS_INSP_PBLM_P where ID = #{id}
  45. </select>
  46. <select id="getBy" resultMap="bisInspPblmPResultMap">
  47. select
  48. <include refid="table_columns"/>
  49. from BIS_INSP_PBLM_P
  50. <trim prefix="where" prefixOverrides="and | or ">
  51. <if test="nm != null and nm != ''">and NM = #{nm}</if>
  52. <if test="objType != null and objType != ''">and OBJ_TYPE = #{objType}</if>
  53. <if test="isDefault != null and isDefault != ''">and IS_DEFAULT = #{isDefault}</if>
  54. and DATA_STAT='0'
  55. </trim>
  56. </select>
  57. <select id="findAll" resultMap="bisInspPblmPResultMap">
  58. select
  59. <include refid="table_columns"/>
  60. from BIS_INSP_PBLM_P
  61. </select>
  62. <select id="findList" resultMap="bisInspPblmPResultMap">
  63. select
  64. <include refid="table_columns"/>
  65. from BIS_INSP_PBLM_P
  66. <include refid="page_where"/>
  67. </select>
  68. <select id="selectCount" resultType="int">
  69. select count(ID) from BIS_INSP_PBLM_P
  70. <include refid="page_where"/>
  71. </select>
  72. <insert id="insert" parameterType="cn.com.goldenwater.dcproj.model.BisInspPblmP">
  73. insert into BIS_INSP_PBLM_P(
  74. <include refid="table_columns"/>
  75. )
  76. values (
  77. <include refid="entity_properties"/>
  78. )
  79. </insert>
  80. <delete id="delete" parameterType="java.lang.String">
  81. update BIS_INSP_PBLM_P
  82. set DATA_STAT='9'
  83. where ID = #{id}
  84. </delete>
  85. <delete id="deleteBy" parameterType="cn.com.goldenwater.dcproj.model.BisInspPblmP">
  86. update BIS_INSP_PBLM_P set DATA_STAT='9'
  87. <include refid="page_where"/>
  88. </delete>
  89. <update id="deleteInFlag" parameterType="java.lang.String">
  90. update BIS_INSP_PBLM_P
  91. set DATA_STAT = '9'
  92. where ID = #{id}
  93. </update>
  94. <update id="update" parameterType="cn.com.goldenwater.dcproj.model.BisInspPblmP">
  95. update BIS_INSP_PBLM_P
  96. <trim prefix="set" suffixOverrides=",">
  97. <if test="nm != null and nm != ''">NM = #{nm},</if>
  98. <if test="objType != null and objType != ''">OBJ_TYPE = #{objType},</if>
  99. <if test="isDefault != null and isDefault != ''">IS_DEFAULT = #{isDefault},</if>
  100. <if test="intm != null">INTM = #{intm},</if>
  101. <if test="uptm != null">UPTM = #{uptm},</if>
  102. <if test="dataStat != null and dataStat != ''">DATA_STAT = #{dataStat},</if>
  103. </trim>
  104. <where>ID = #{id}</where>
  105. </update>
  106. <update id="updateBy" parameterType="cn.com.goldenwater.dcproj.model.BisInspPblmP">
  107. update BIS_INSP_PBLM_P
  108. <trim prefix="set" suffixOverrides=",">
  109. <if test="nm != null and nm != ''">NM = #{nm},</if>
  110. <if test="objType != null and objType != ''">OBJ_TYPE = #{objType},</if>
  111. <if test="isDefault != null and isDefault != ''">IS_DEFAULT = #{isDefault},</if>
  112. <if test="intm != null">INTM = #{intm},</if>
  113. <if test="uptm != null">UPTM = #{uptm},</if>
  114. <if test="dataStat != null and dataStat != ''">DATA_STAT = #{dataStat},</if>
  115. </trim>
  116. <include refid="page_where"/>
  117. </update>
  118. <!-- 其他自定义SQL -->
  119. <select id="getIdByRgstrId" resultType="string">
  120. SELECT D.ID
  121. FROM BIS_INSP_GENRL_RGSTR A
  122. JOIN BIS_INSP_ALL_OBJ B ON A.OBJ_ID = B.OBJ_ID
  123. JOIN BIS_INSP_BASE_NEW C ON B.CODE = C.ID
  124. JOIN BIS_INSP_PBLM_P D ON C.OBJ_TYPE = D.OBJ_TYPE
  125. WHERE A.ID = #{rgstrId}
  126. AND D.DATA_STAT = '0'
  127. AND D.IS_DEFAULT = '1'
  128. </select>
  129. <select id="getIdByObjId" resultType="string">
  130. SELECT D.ID
  131. FROM BIS_INSP_ALL_OBJ B
  132. JOIN BIS_INSP_BASE_NEW C ON B.CODE = C.ID
  133. JOIN BIS_INSP_PBLM_P D ON C.OBJ_TYPE = D.OBJ_TYPE
  134. WHERE B.OBJ_ID = #{objId}
  135. AND D.DATA_STAT = '0'
  136. AND D.IS_DEFAULT = '1'
  137. </select>
  138. </mapper>