b4e6dcdbecee59b66b8693ec1d77a90e36fdb40c.svn-base 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126
  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. NM,
  16. OBJ_TYPE,
  17. IS_DEFAULT,
  18. INTM,
  19. UPTM,
  20. DATA_STAT
  21. </sql>
  22. <sql id="entity_properties">
  23. #{id},
  24. #{nm},
  25. #{objType},
  26. #{isDefault},
  27. #{intm},
  28. #{uptm},
  29. #{dataStat}
  30. </sql>
  31. <sql id="page_where">
  32. <trim prefix="where" prefixOverrides="and | or ">
  33. <if test="nm != null and nm != ''">and NM LIKE '%${nm}%'</if>
  34. <if test="objType != null and objType != ''">and OBJ_TYPE = #{objType}</if>
  35. <if test="isDefault != null and isDefault != ''">and IS_DEFAULT = #{isDefault}</if>
  36. and DATA_STAT='0'
  37. </trim>
  38. </sql>
  39. <select id="get" resultMap="bisInspPblmPResultMap" parameterType="String" >
  40. select <include refid="table_columns" /> from BIS_INSP_PBLM_P where ID = #{id}
  41. </select>
  42. <select id="getBy" resultMap="bisInspPblmPResultMap">
  43. select <include refid="table_columns" /> from BIS_INSP_PBLM_P
  44. <trim prefix="where" prefixOverrides="and | or ">
  45. <if test="nm != null and nm != ''">and NM = #{nm}</if>
  46. <if test="objType != null and objType != ''">and OBJ_TYPE = #{objType}</if>
  47. <if test="isDefault != null and isDefault != ''">and IS_DEFAULT = #{isDefault}</if>
  48. and DATA_STAT='0'
  49. </trim>
  50. </select>
  51. <select id="findAll" resultMap="bisInspPblmPResultMap">
  52. select <include refid="table_columns" /> from BIS_INSP_PBLM_P
  53. </select>
  54. <select id="findList" resultMap="bisInspPblmPResultMap">
  55. select <include refid="table_columns" /> from BIS_INSP_PBLM_P <include refid="page_where" />
  56. </select>
  57. <select id="selectCount" resultType="int" >
  58. select count(ID) from BIS_INSP_PBLM_P <include refid="page_where" />
  59. </select>
  60. <insert id="insert" parameterType="cn.com.goldenwater.dcproj.model.BisInspPblmP">
  61. insert into BIS_INSP_PBLM_P( <include refid="table_columns" /> )
  62. values ( <include refid="entity_properties" /> )
  63. </insert>
  64. <delete id="delete" parameterType="java.lang.String">
  65. update BIS_INSP_PBLM_P set DATA_STAT='9' where ID = #{id}
  66. </delete>
  67. <delete id="deleteBy" parameterType="cn.com.goldenwater.dcproj.model.BisInspPblmP">
  68. update BIS_INSP_PBLM_P set DATA_STAT='9' <include refid="page_where" />
  69. </delete>
  70. <update id="deleteInFlag" parameterType="java.lang.String">
  71. update BIS_INSP_PBLM_P set DATA_STAT = '9' where ID = #{id}
  72. </update>
  73. <update id="update" parameterType="cn.com.goldenwater.dcproj.model.BisInspPblmP">
  74. update BIS_INSP_PBLM_P
  75. <trim prefix="set" suffixOverrides=",">
  76. <if test="nm != null and nm != ''">NM = #{nm},</if>
  77. <if test="objType != null and objType != ''">OBJ_TYPE = #{objType},</if>
  78. <if test="isDefault != null and isDefault != ''">IS_DEFAULT = #{isDefault},</if>
  79. <if test="intm != null">INTM = #{intm},</if>
  80. <if test="uptm != null">UPTM = #{uptm},</if>
  81. <if test="dataStat != null and dataStat != ''">DATA_STAT = #{dataStat},</if>
  82. </trim>
  83. <where>ID = #{id}</where>
  84. </update>
  85. <update id="updateBy" parameterType="cn.com.goldenwater.dcproj.model.BisInspPblmP">
  86. update BIS_INSP_PBLM_P
  87. <trim prefix="set" suffixOverrides=",">
  88. <if test="nm != null and nm != ''">NM = #{nm},</if>
  89. <if test="objType != null and objType != ''">OBJ_TYPE = #{objType},</if>
  90. <if test="isDefault != null and isDefault != ''">IS_DEFAULT = #{isDefault},</if>
  91. <if test="intm != null">INTM = #{intm},</if>
  92. <if test="uptm != null">UPTM = #{uptm},</if>
  93. <if test="dataStat != null and dataStat != ''">DATA_STAT = #{dataStat},</if>
  94. </trim>
  95. <include refid="page_where" />
  96. </update>
  97. <!-- 其他自定义SQL -->
  98. <select id="getIdByRgstrId" resultType="string">
  99. SELECT D.ID
  100. FROM BIS_INSP_GENRL_RGSTR A
  101. JOIN BIS_INSP_ALL_OBJ B ON A.OBJ_ID = B.OBJ_ID
  102. JOIN BIS_INSP_BASE_NEW C ON B.CODE = C.ID
  103. JOIN BIS_INSP_PBLM_P D ON C.OBJ_TYPE = D.OBJ_TYPE
  104. WHERE A.ID = #{rgstrId}
  105. AND D.DATA_STAT = '0'
  106. AND D.IS_DEFAULT = '1'
  107. </select>
  108. </mapper>