BisInspOrgBaseDao.xml 7.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179
  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.BisInspOrgBaseDao">
  4. <resultMap type="cn.com.goldenwater.dcproj.model.BisInspOrgBase" id="bisInspOrgBaseResultMap">
  5. <result property="recPers" column="REC_PERS"/>
  6. <result property="collTime" column="COLL_TIME"/>
  7. <result property="note" column="NOTE"/>
  8. <result property="guid" column="GUID"/>
  9. <result property="pguid" column="PGUID"/>
  10. <result property="orgName" column="ORG_NAME"/>
  11. <result property="orgCode" column="ORG_CODE"/>
  12. <result property="baadGuid" column="BAAD_GUID"/>
  13. <result property="orgLong" column="ORG_LONG"/>
  14. <result property="orgLat" column="ORG_LAT"/>
  15. <result property="adCode" column="AD_CODE"/>
  16. <result property="adminWiunGuid" column="ADMIN_WIUN_GUID"/>
  17. <result property="orgLevel" column="ORG_LEVEL"/>
  18. <result property="ordernum" column="ORDERNUM"/>
  19. <result property="dataStat" column="DATA_STAT"/>
  20. </resultMap>
  21. <sql id="table_columns">
  22. REC_PERS,
  23. COLL_TIME,
  24. NOTE,
  25. GUID,
  26. PGUID,
  27. ORG_NAME,
  28. ORG_CODE,
  29. BAAD_GUID,
  30. ORG_LONG,
  31. ORG_LAT,
  32. AD_CODE,
  33. ADMIN_WIUN_GUID,
  34. ORG_LEVEL,
  35. ORDERNUM,
  36. DATA_STAT
  37. </sql>
  38. <sql id="entity_properties">
  39. #{recPers},
  40. #{collTime},
  41. #{note},
  42. #{guid},
  43. #{pguid},
  44. #{orgName},
  45. #{orgCode},
  46. #{baadGuid},
  47. #{orgLong},
  48. #{orgLat},
  49. #{adCode},
  50. #{adminWiunGuid},
  51. #{orgLevel},
  52. #{ordernum},
  53. #{dataStat}
  54. </sql>
  55. <!-- 使用like用法:columnName like concat('%',#columnName#,'%') -->
  56. <sql id="page_where">
  57. <trim prefix="where" prefixOverrides="and | or ">
  58. <if test="collTime != null">and COLL_TIME = #{collTime}</if>
  59. <if test="note != null and note != ''">and NOTE = #{note}</if>
  60. <if test="guid != null and guid != ''">and GUID = #{guid}</if>
  61. <if test="pguid != null and pguid != ''">and PGUID = #{pguid}</if>
  62. <if test="orgName != null and orgName != ''">and ORG_NAME = #{orgName}</if>
  63. <if test="orgCode != null and orgCode != ''">and ORG_CODE = #{orgCode}</if>
  64. <if test="baadGuid != null and baadGuid != ''">and BAAD_GUID = #{baadGuid}</if>
  65. <if test="orgLong != null and orgLong != ''">and ORG_LONG = #{orgLong}</if>
  66. <if test="orgLat != null and orgLat != ''">and ORG_LAT = #{orgLat}</if>
  67. <if test="adCode != null and adCode != ''">and AD_CODE = #{adCode}</if>
  68. <if test="adminWiunGuid != null and adminWiunGuid != ''">and ADMIN_WIUN_GUID = #{adminWiunGuid}</if>
  69. <if test="orgLevel != null and orgLevel != ''">and ORG_LEVEL = #{orgLevel}</if>
  70. <if test="ordernum != null and ordernum != ''">and ORDERNUM = #{ordernum}</if>
  71. <if test="dataStat != null and dataStat != ''">and DATA_STAT = #{dataStat}</if>
  72. </trim>
  73. </sql>
  74. <select id="get" resultMap="bisInspOrgBaseResultMap" parameterType="String">
  75. select
  76. <include refid="table_columns"/>
  77. from bis_insp_org_base where ID = #{id}
  78. </select>
  79. <select id="getBy" resultMap="bisInspOrgBaseResultMap">
  80. select
  81. <include refid="table_columns"/>
  82. from bis_insp_org_base
  83. <include refid="page_where"/>
  84. </select>
  85. <select id="findAll" resultMap="bisInspOrgBaseResultMap">
  86. select
  87. <include refid="table_columns"/>
  88. from bis_insp_org_base
  89. </select>
  90. <select id="findList" resultMap="bisInspOrgBaseResultMap">
  91. select
  92. <include refid="table_columns"/>
  93. from bis_insp_org_base
  94. <include refid="page_where"/>
  95. </select>
  96. <select id="selectCount" resultType="int">
  97. select count(ID) from bis_insp_org_base
  98. <include refid="page_where"/>
  99. </select>
  100. <insert id="insert" parameterType="cn.com.goldenwater.dcproj.model.BisInspOrgBase">
  101. insert into bis_insp_org_base(
  102. <include refid="table_columns"/>
  103. )
  104. values (
  105. <include refid="entity_properties"/>
  106. )
  107. </insert>
  108. <delete id="delete" parameterType="java.lang.String">
  109. delete from bis_insp_org_base where ID = #{id}
  110. </delete>
  111. <delete id="deleteBy" parameterType="cn.com.goldenwater.dcproj.model.BisInspOrgBase">
  112. delete from bis_insp_org_base
  113. <include refid="page_where"/>
  114. </delete>
  115. <update id="deleteInFlag" parameterType="java.lang.String">
  116. update bis_insp_org_base set flag_valid = 0 where ID = #{id}
  117. </update>
  118. <update id="update" parameterType="cn.com.goldenwater.dcproj.model.BisInspOrgBase">
  119. update bis_insp_org_base
  120. <trim prefix="set" suffixOverrides=",">
  121. <if test="collTime != null">COLL_TIME = #{collTime},</if>
  122. <if test="note != null and note != ''">NOTE = #{note},</if>
  123. <if test="guid != null and guid != ''">GUID = #{guid},</if>
  124. <if test="pguid != null and pguid != ''">PGUID = #{pguid},</if>
  125. <if test="orgName != null and orgName != ''">ORG_NAME = #{orgName},</if>
  126. <if test="orgCode != null and orgCode != ''">ORG_CODE = #{orgCode},</if>
  127. <if test="baadGuid != null and baadGuid != ''">BAAD_GUID = #{baadGuid},</if>
  128. <if test="orgLong != null and orgLong != ''">ORG_LONG = #{orgLong},</if>
  129. <if test="orgLat != null and orgLat != ''">ORG_LAT = #{orgLat},</if>
  130. <if test="adCode != null and adCode != ''">AD_CODE = #{adCode},</if>
  131. <if test="adminWiunGuid != null and adminWiunGuid != ''">ADMIN_WIUN_GUID = #{adminWiunGuid},</if>
  132. <if test="orgLevel != null and orgLevel != ''">ORG_LEVEL = #{orgLevel},</if>
  133. <if test="ordernum != null and ordernum != ''">ORDERNUM = #{ordernum},</if>
  134. <if test="dataStat != null and dataStat != ''">DATA_STAT = #{dataStat},</if>
  135. </trim>
  136. <where>ORG_ID = #{orgId}</where>
  137. </update>
  138. <update id="updateBy" parameterType="cn.com.goldenwater.dcproj.model.BisInspOrgBase">
  139. update bis_insp_org_base
  140. <trim prefix="set" suffixOverrides=",">
  141. <if test="collTime != null">COLL_TIME = #{collTime},</if>
  142. <if test="note != null and note != ''">NOTE = #{note},</if>
  143. <if test="guid != null and guid != ''">GUID = #{guid},</if>
  144. <if test="pguid != null and pguid != ''">PGUID = #{pguid},</if>
  145. <if test="orgName != null and orgName != ''">ORG_NAME = #{orgName},</if>
  146. <if test="orgCode != null and orgCode != ''">ORG_CODE = #{orgCode},</if>
  147. <if test="baadGuid != null and baadGuid != ''">BAAD_GUID = #{baadGuid},</if>
  148. <if test="orgLong != null and orgLong != ''">ORG_LONG = #{orgLong},</if>
  149. <if test="orgLat != null and orgLat != ''">ORG_LAT = #{orgLat},</if>
  150. <if test="adCode != null and adCode != ''">AD_CODE = #{adCode},</if>
  151. <if test="adminWiunGuid != null and adminWiunGuid != ''">ADMIN_WIUN_GUID = #{adminWiunGuid},</if>
  152. <if test="orgLevel != null and orgLevel != ''">ORG_LEVEL = #{orgLevel},</if>
  153. <if test="ordernum != null and ordernum != ''">ORDERNUM = #{ordernum},</if>
  154. <if test="dataStat != null and dataStat != ''">DATA_STAT = #{dataStat},</if>
  155. </trim>
  156. <include refid="page_where"/>
  157. </update>
  158. <!-- 其他自定义SQL -->
  159. </mapper>