BisInspPblmMendPriDao.xml 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145
  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.BisInspPblmMendPriDao">
  4. <resultMap type="cn.com.goldenwater.dcproj.model.BisInspPblmMendPri" id="bisInspPblmMendPriResultMap">
  5. <result property="id" column="ID"/>
  6. <result property="mandPersId" column="MAND_PERS_ID"/>
  7. <result property="pblmClassify" column="PBLM_CLASSIFY"/>
  8. <result property="note" column="NOTE"/>
  9. <result property="intm" column="INTM"/>
  10. <result property="uptm" column="UPTM"/>
  11. <result property="dataStat" column="DATA_STAT"/>
  12. <result property="persId" column="PERS_ID"/>
  13. <result property="persName" column="PERS_NAME"/>
  14. </resultMap>
  15. <sql id="table_columns">
  16. ID,
  17. MAND_PERS_ID,
  18. PBLM_CLASSIFY,
  19. NOTE,
  20. INTM,
  21. UPTM,
  22. DATA_STAT,
  23. PERS_ID,
  24. PERS_NAME
  25. </sql>
  26. <sql id="entity_properties">
  27. #{id},
  28. #{mandPersId},
  29. #{pblmClassify},
  30. #{note},
  31. #{intm},
  32. #{uptm},
  33. #{dataStat},
  34. #{persId},
  35. #{persName}
  36. </sql>
  37. <!-- 使用like用法:columnName like concat('%',#columnName#,'%') -->
  38. <sql id="page_where">
  39. <trim prefix="where" prefixOverrides="and | or ">
  40. DATA_STAT= '0'
  41. <if test="mandPersId != null and mandPersId != ''">and MAND_PERS_ID = #{mandPersId}</if>
  42. <if test="pblmClassify != null and pblmClassify != ''">and PBLM_CLASSIFY = #{pblmClassify}</if>
  43. <if test="note != null and note != ''">and NOTE = #{note}</if>
  44. <if test="intm != null">and INTM = #{intm}</if>
  45. <if test="uptm != null">and UPTM = #{uptm}</if>
  46. <if test="dataStat != null and dataStat != ''">and DATA_STAT = #{dataStat}</if>
  47. <if test="persId != null and persId != ''">and PERS_ID = #{persId}</if>
  48. <if test="persName != null and persName != ''">and PERS_NAME = #{persName}</if>
  49. </trim>
  50. </sql>
  51. <select id="get" resultMap="bisInspPblmMendPriResultMap" parameterType="String">
  52. select
  53. <include refid="table_columns"/>
  54. from BIS_INSP_PBLM_MEND_PRI where ID = #{id}
  55. </select>
  56. <select id="getBy" resultMap="bisInspPblmMendPriResultMap">
  57. select
  58. <include refid="table_columns"/>
  59. from BIS_INSP_PBLM_MEND_PRI
  60. <include refid="page_where"/>
  61. </select>
  62. <select id="findAll" resultMap="bisInspPblmMendPriResultMap">
  63. select
  64. <include refid="table_columns"/>
  65. from BIS_INSP_PBLM_MEND_PRI
  66. </select>
  67. <select id="findList" resultMap="bisInspPblmMendPriResultMap">
  68. select
  69. <include refid="table_columns"/>
  70. from BIS_INSP_PBLM_MEND_PRI
  71. <include refid="page_where"/>
  72. </select>
  73. <select id="selectCount" resultType="int">
  74. select count(ID) from BIS_INSP_PBLM_MEND_PRI
  75. <include refid="page_where"/>
  76. </select>
  77. <insert id="insert" parameterType="cn.com.goldenwater.dcproj.model.BisInspPblmMendPri">
  78. insert into BIS_INSP_PBLM_MEND_PRI(
  79. <include refid="table_columns"/>
  80. )
  81. values (
  82. <include refid="entity_properties"/>
  83. )
  84. </insert>
  85. <delete id="delete" parameterType="java.lang.String">
  86. update BIS_INSP_PBLM_MEND_PRI set DATA_STAT='9' where ID = #{id}
  87. </delete>
  88. <delete id="deleteBy" parameterType="cn.com.goldenwater.dcproj.model.BisInspPblmMendPri">
  89. update BIS_INSP_PBLM_MEND_PRI set DATA_STAT='9'
  90. <include refid="page_where"/>
  91. </delete>
  92. <update id="deleteInFlag" parameterType="java.lang.String">
  93. update BIS_INSP_PBLM_MEND_PRI set flag_valid = 0 where ID = #{id}
  94. </update>
  95. <update id="update" parameterType="cn.com.goldenwater.dcproj.model.BisInspPblmMendPri">
  96. update BIS_INSP_PBLM_MEND_PRI
  97. <trim prefix="set" suffixOverrides=",">
  98. <if test="mandPersId != null and mandPersId != ''">MAND_PERS_ID = #{mandPersId},</if>
  99. <if test="pblmClassify != null and pblmClassify != ''">PBLM_CLASSIFY = #{pblmClassify},</if>
  100. <if test="note != null and note != ''">NOTE = #{note},</if>
  101. <if test="intm != null">INTM = #{intm},</if>
  102. <if test="uptm != null">UPTM = #{uptm},</if>
  103. <if test="dataStat != null and dataStat != ''">DATA_STAT = #{dataStat},</if>
  104. <if test="persId != null and persId != ''">PERS_ID = #{persId},</if>
  105. <if test="persName != null and persName != ''">PERS_NAME = #{persName},</if>
  106. </trim>
  107. <where>ID = #{id}</where>
  108. </update>
  109. <update id="updateBy" parameterType="cn.com.goldenwater.dcproj.model.BisInspPblmMendPri">
  110. update BIS_INSP_PBLM_MEND_PRI
  111. <trim prefix="set" suffixOverrides=",">
  112. <if test="mandPersId != null and mandPersId != ''">MAND_PERS_ID = #{mandPersId},</if>
  113. <if test="pblmClassify != null and pblmClassify != ''">PBLM_CLASSIFY = #{pblmClassify},</if>
  114. <if test="note != null and note != ''">NOTE = #{note},</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. <if test="persId != null and persId != ''">PERS_ID = #{persId},</if>
  119. <if test="persName != null and persName != ''">PERS_NAME = #{persName},</if>
  120. </trim>
  121. <include refid="page_where"/>
  122. </update>
  123. <!-- 其他自定义SQL -->
  124. </mapper>