BisPntBaseDao.xml 6.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155
  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.BisPntBaseDao">
  4. <resultMap type="cn.com.goldenwater.dcproj.model.BisPntBase" id="bisPntBaseResultMap">
  5. <result property="guid" column="GUID"/>
  6. <result property="pblmId" column="PBLM_ID"/>
  7. <result property="inspObjGuid" column="INSP_OBJ_GUID"/>
  8. <result property="pntCont" column="PNT_CONT"/>
  9. <result property="pblshOrgGuid" column="PBLSH_ORG_GUID"/>
  10. <result property="inspPblmDep" column="INSP_PBLM_DEP"/>
  11. <result property="isResp" column="IS_RESP"/>
  12. <result property="dataStat" column="DATA_STAT"/>
  13. <result property="recPers" column="REC_PERS"/>
  14. <result property="collTime" column="COLL_TIME"/>
  15. <result property="note" column="NOTE"/>
  16. </resultMap>
  17. <sql id="table_columns">
  18. GUID,
  19. PBLM_ID,
  20. INSP_OBJ_GUID,
  21. PNT_CONT,
  22. PBLSH_ORG_GUID,
  23. INSP_PBLM_DEP,
  24. IS_RESP,
  25. DATA_STAT,
  26. REC_PERS,
  27. COLL_TIME,
  28. NOTE
  29. </sql>
  30. <sql id="entity_properties">
  31. #{guid},
  32. #{pblmId},
  33. #{inspObjGuid},
  34. #{pntCont},
  35. #{pblshOrgGuid},
  36. #{inspPblmDep},
  37. #{isResp},
  38. #{dataStat},
  39. #{recPers},
  40. #{collTime},
  41. #{note}
  42. </sql>
  43. <!-- 使用like用法:columnName like concat('%',#columnName#,'%') -->
  44. <sql id="page_where">
  45. <trim prefix="where" prefixOverrides="and | or ">
  46. <if test="pblmId != null and pblmId != ''">and PBLM_ID = #{pblmId}</if>
  47. <if test="inspObjGuid != null and inspObjGuid != ''">and INSP_OBJ_GUID = #{inspObjGuid}</if>
  48. <if test="pntCont != null and pntCont != ''">and PNT_CONT = #{pntCont}</if>
  49. <if test="pblshOrgGuid != null and pblshOrgGuid != ''">and PBLSH_ORG_GUID = #{pblshOrgGuid}</if>
  50. <if test="inspPblmDep != null and inspPblmDep != ''">and INSP_PBLM_DEP = #{inspPblmDep}</if>
  51. <if test="isResp != null and isResp != ''">and IS_RESP = #{isResp}</if>
  52. <if test="dataStat != null and dataStat != ''">and DATA_STAT = #{dataStat}</if>
  53. <if test="recPers != null and recPers != ''">and REC_PERS = #{recPers}</if>
  54. <if test="collTime != null">and COLL_TIME = #{collTime}</if>
  55. <if test="note != null and note != ''">and NOTE = #{note}</if>
  56. </trim>
  57. </sql>
  58. <select id="get" resultMap="bisPntBaseResultMap" parameterType="String">
  59. select
  60. <include refid="table_columns"/>
  61. from bis_pnt_base where ID = #{id}
  62. </select>
  63. <select id="getBy" resultMap="bisPntBaseResultMap">
  64. select
  65. <include refid="table_columns"/>
  66. from bis_pnt_base
  67. <include refid="page_where"/>
  68. </select>
  69. <select id="findAll" resultMap="bisPntBaseResultMap">
  70. select
  71. <include refid="table_columns"/>
  72. from bis_pnt_base
  73. </select>
  74. <select id="findList" resultMap="bisPntBaseResultMap">
  75. select
  76. <include refid="table_columns"/>
  77. from bis_pnt_base
  78. <include refid="page_where"/>
  79. </select>
  80. <select id="selectCount" resultType="int">
  81. select count(ID) from bis_pnt_base
  82. <include refid="page_where"/>
  83. </select>
  84. <insert id="insert" parameterType="cn.com.goldenwater.dcproj.model.BisPntBase">
  85. insert into bis_pnt_base(
  86. <include refid="table_columns"/>
  87. )
  88. values (
  89. <include refid="entity_properties"/>
  90. )
  91. </insert>
  92. <delete id="delete" parameterType="java.lang.String">
  93. delete from bis_pnt_base where ID = #{id}
  94. </delete>
  95. <delete id="deleteBy" parameterType="cn.com.goldenwater.dcproj.model.BisPntBase">
  96. delete from bis_pnt_base
  97. <include refid="page_where"/>
  98. </delete>
  99. <update id="deleteInFlag" parameterType="java.lang.String">
  100. update bis_pnt_base set flag_valid = 0 where ID = #{id}
  101. </update>
  102. <update id="update" parameterType="cn.com.goldenwater.dcproj.model.BisPntBase">
  103. update bis_pnt_base
  104. <trim prefix="set" suffixOverrides=",">
  105. <if test="pblmId != null and pblmId != ''">PBLM_ID = #{pblmId},</if>
  106. <if test="inspObjGuid != null and inspObjGuid != ''">INSP_OBJ_GUID = #{inspObjGuid},</if>
  107. <if test="pntCont != null and pntCont != ''">PNT_CONT = #{pntCont},</if>
  108. <if test="pblshOrgGuid != null and pblshOrgGuid != ''">PBLSH_ORG_GUID = #{pblshOrgGuid},</if>
  109. <if test="inspPblmDep != null and inspPblmDep != ''">INSP_PBLM_DEP = #{inspPblmDep},</if>
  110. <if test="isResp != null and isResp != ''">IS_RESP = #{isResp},</if>
  111. <if test="dataStat != null and dataStat != ''">DATA_STAT = #{dataStat},</if>
  112. <if test="recPers != null and recPers != ''">REC_PERS = #{recPers},</if>
  113. <if test="collTime != null">COLL_TIME = #{collTime},</if>
  114. <if test="note != null and note != ''">NOTE = #{note},</if>
  115. </trim>
  116. <where>ID = #{id}</where>
  117. </update>
  118. <update id="updateBy" parameterType="cn.com.goldenwater.dcproj.model.BisPntBase">
  119. update bis_pnt_base
  120. <trim prefix="set" suffixOverrides=",">
  121. <if test="pblmId != null and pblmId != ''">PBLM_ID = #{pblmId},</if>
  122. <if test="inspObjGuid != null and inspObjGuid != ''">INSP_OBJ_GUID = #{inspObjGuid},</if>
  123. <if test="pntCont != null and pntCont != ''">PNT_CONT = #{pntCont},</if>
  124. <if test="pblshOrgGuid != null and pblshOrgGuid != ''">PBLSH_ORG_GUID = #{pblshOrgGuid},</if>
  125. <if test="inspPblmDep != null and inspPblmDep != ''">INSP_PBLM_DEP = #{inspPblmDep},</if>
  126. <if test="isResp != null and isResp != ''">IS_RESP = #{isResp},</if>
  127. <if test="dataStat != null and dataStat != ''">DATA_STAT = #{dataStat},</if>
  128. <if test="recPers != null and recPers != ''">REC_PERS = #{recPers},</if>
  129. <if test="collTime != null">COLL_TIME = #{collTime},</if>
  130. <if test="note != null and note != ''">NOTE = #{note},</if>
  131. </trim>
  132. <include refid="page_where"/>
  133. </update>
  134. <!-- 其他自定义SQL -->
  135. </mapper>