BisInspDvdwkDao.xml 7.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185
  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.BisInspDvdwkDao">
  4. <resultMap type="cn.com.goldenwater.dcproj.model.BisInspDvdwk" id="bisInspDvdwkResultMap">
  5. <result property="dvdwkId" column="DVDWK_ID"/>
  6. <result property="schmId" column="SCHM_ID"/>
  7. <result property="guid" column="GUID"/>
  8. <result property="orgDp" column="ORG_DP"/>
  9. <result property="dtype" column="DTYPE"/>
  10. <result property="content" column="CONTENT"/>
  11. <result property="intm" column="INTM"/>
  12. <result property="uptm" column="UPTM"/>
  13. <result property="inspNum" column="INSP_NUM"/>
  14. <result property="adCode" column="AD_CODE"/>
  15. <result property="adName" column="AD_NAME"/>
  16. <result property="orgName" column="ORG_NAME"/>
  17. <result property="inspCount" column="INSP_COUNT"/>
  18. <result property="inspScale" column="INSP_SCALE"/>
  19. </resultMap>
  20. <sql id="table_columns">
  21. DVDWK_ID,
  22. SCHM_ID,
  23. GUID,
  24. ORG_DP,
  25. DTYPE,
  26. CONTENT,
  27. INTM,
  28. UPTM,
  29. INSP_NUM,
  30. AD_CODE,
  31. AD_NAME,
  32. ORG_NAME,
  33. INSP_COUNT,
  34. INSP_SCALE
  35. </sql>
  36. <sql id="entity_properties">
  37. #{dvdwkId},
  38. #{schmId},
  39. #{guid},
  40. #{orgDp},
  41. #{dtype},
  42. #{content},
  43. #{intm},
  44. #{uptm},
  45. #{inspNum},
  46. #{adCode},
  47. #{adName},
  48. #{orgName},
  49. #{inspCount},
  50. #{inspScale}
  51. </sql>
  52. <!-- 使用like用法:columnName like concat('%',#columnName#,'%') -->
  53. <sql id="page_where">
  54. <trim prefix="where" prefixOverrides="and | or ">
  55. <if test="schmId != null and schmId != ''">and SCHM_ID = #{schmId}</if>
  56. <if test="guid != null and guid != ''">and GUID = #{guid}</if>
  57. <if test="orgDp != null and orgDp != ''">and ORG_DP = #{orgDp}</if>
  58. <if test="dtype != null and dtype != ''">and DTYPE = #{dtype}</if>
  59. <if test="content != null and content != ''">and CONTENT = #{content}</if>
  60. <if test="intm != null">and INTM = #{intm}</if>
  61. <if test="uptm != null">and UPTM = #{uptm}</if>
  62. <if test="inspNum != null and inspNum != ''">and INSP_NUM = #{inspNum}</if>
  63. <if test="adCode != null and adCode != ''">and AD_CODE = #{adCode}</if>
  64. <if test="adName != null and adName != ''">and AD_NAME = #{adName}</if>
  65. <if test="orgName != null and orgName != ''">and ORG_NAME = #{orgName}</if>
  66. <if test="inspCount != null and inspCount != ''">and INSP_COUNT = #{inspCount}</if>
  67. <if test="inspScale != null and inspScale != ''">and INSP_SCALE = #{inspScale}</if>
  68. </trim>
  69. </sql>
  70. <select id="get" resultMap="bisInspDvdwkResultMap" parameterType="String">
  71. select
  72. <include refid="table_columns"/>
  73. from BIS_INSP_DVDWK where SCHM_ID = #{id}
  74. </select>
  75. <select id="getBy" resultMap="bisInspDvdwkResultMap">
  76. select
  77. <include refid="table_columns"/>
  78. from BIS_INSP_DVDWK
  79. <include refid="page_where"/>
  80. </select>
  81. <select id="findAll" resultMap="bisInspDvdwkResultMap">
  82. select
  83. <include refid="table_columns"/>
  84. from BIS_INSP_DVDWK
  85. </select>
  86. <select id="findList" resultMap="bisInspDvdwkResultMap">
  87. select
  88. <include refid="table_columns"/>
  89. from BIS_INSP_DVDWK
  90. <include refid="page_where"/>
  91. </select>
  92. <select id="selectCount" resultType="int">
  93. select count(ID) from BIS_INSP_DVDWK
  94. <include refid="page_where"/>
  95. </select>
  96. <insert id="insert" parameterType="cn.com.goldenwater.dcproj.model.BisInspDvdwk">
  97. insert into BIS_INSP_DVDWK(
  98. <include refid="table_columns"/>
  99. )
  100. values (
  101. <include refid="entity_properties"/>
  102. )
  103. </insert>
  104. <delete id="delete" parameterType="java.lang.String">
  105. delete from BIS_INSP_DVDWK where DVDWK_ID = #{id}
  106. </delete>
  107. <delete id="deleteBy" parameterType="cn.com.goldenwater.dcproj.model.BisInspDvdwk">
  108. delete from BIS_INSP_DVDWK
  109. <include refid="page_where"/>
  110. </delete>
  111. <update id="deleteInFlag" parameterType="java.lang.String">
  112. update BIS_INSP_DVDWK set flag_valid = 0 where ID = #{id}
  113. </update>
  114. <update id="update" parameterType="cn.com.goldenwater.dcproj.model.BisInspDvdwk">
  115. update BIS_INSP_DVDWK
  116. <trim prefix="set" suffixOverrides=",">
  117. <if test="schmId != null and schmId != ''">SCHM_ID = #{schmId},</if>
  118. <if test="guid != null and guid != ''">GUID = #{guid},</if>
  119. <if test="orgDp != null and orgDp != ''">ORG_DP = #{orgDp},</if>
  120. <if test="dtype != null and dtype != ''">DTYPE = #{dtype},</if>
  121. <if test="content != null and content != ''">CONTENT = #{content},</if>
  122. <if test="intm != null">INTM = #{intm},</if>
  123. <if test="uptm != null">UPTM = #{uptm},</if>
  124. INSP_NUM = #{inspNum},
  125. <if test="adCode != null and adCode != ''">AD_CODE = #{adCode},</if>
  126. <if test="adName != null and adName != ''">AD_NAME = #{adName},</if>
  127. <if test="orgName != null and orgName != ''">ORG_NAME = #{orgName},</if>
  128. INSP_COUNT = #{inspCount},
  129. INSP_SCALE = #{inspScale},
  130. </trim>
  131. <where>DVDWK_ID = #{dvdwkId}</where>
  132. </update>
  133. <update id="updateBy" parameterType="cn.com.goldenwater.dcproj.model.BisInspDvdwk">
  134. update BIS_INSP_DVDWK
  135. <trim prefix="set" suffixOverrides=",">
  136. <if test="schmId != null and schmId != ''">SCHM_ID = #{schmId},</if>
  137. <if test="guid != null and guid != ''">GUID = #{guid},</if>
  138. <if test="orgDp != null and orgDp != ''">ORG_DP = #{orgDp},</if>
  139. <if test="dtype != null and dtype != ''">DTYPE = #{dtype},</if>
  140. <if test="content != null and content != ''">CONTENT = #{content},</if>
  141. <if test="intm != null">INTM = #{intm},</if>
  142. <if test="uptm != null">UPTM = #{uptm},</if>
  143. <if test="inspNum != null and inspNum != ''">INSP_NUM = #{inspNum},</if>
  144. <if test="adCode != null and adCode != ''">AD_CODE = #{adCode},</if>
  145. <if test="adName != null and adName != ''">AD_NAME = #{adName},</if>
  146. <if test="orgName != null and orgName != ''">ORG_NAME = #{orgName},</if>
  147. <if test="inspCount != null and inspCount != ''">INSP_COUNT = #{inspCount},</if>
  148. <if test="inspScale != null and inspScale != ''">INSP_SCALE = #{inspScale},</if>
  149. </trim>
  150. <include refid="page_where"/>
  151. </update>
  152. <!-- 其他自定义SQL -->
  153. <select id="queryDvdwk" resultType="cn.com.goldenwater.dcproj.dto.BisInspDvdwkDto">
  154. SELECT A.* FROM bis_insp_dvdwk A WHERE 1=1
  155. <if test="schmId != null and schmId != ''">and A.SCHM_ID = #{schmId}</if>
  156. <if test="orgDp != null and orgDp != ''">and A.ORG_DP = #{orgDp}</if>
  157. <if test="dtype != null and dtype != ''">and A.DTYPE = #{dtype}</if>
  158. <if test="content != null and content != ''">and A.CONTENT = #{content}</if>
  159. <if test="inspNum != null and inspNum != ''">and A.INSP_NUM = #{inspNum}</if>
  160. <if test="adCode != null and adCode != ''">and A.AD_CODE = #{adCode}</if>
  161. <if test="adName != null and adName != ''">and A.AD_NAME = #{adName}</if>
  162. <if test="orgName != null and orgName != ''">and A.ORG_NAME = #{orgName}</if>
  163. <if test="inspCount != null and inspCount != ''">and A.INSP_COUNT = #{inspCount}</if>
  164. <if test="inspScale != null and inspScale != ''">and A.INSP_SCALE = #{inspScale}</if>
  165. </select>
  166. </mapper>