BisInspMfdpRgstrObjDao.xml 6.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152
  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.BisInspMfdpRgstrObjDao">
  4. <resultMap type="cn.com.goldenwater.dcproj.model.BisInspMfdpRgstrObj" id="bisInspMfdpRgstrObjResultMap">
  5. <result property="id" column="ID"/>
  6. <result property="rgstrId" column="RGSTR_ID"/>
  7. <result property="inspObjType" column="INSP_OBJ_TYPE"/>
  8. <result property="inspObjName" column="INSP_OBJ_NAME"/>
  9. <result property="adCode" column="AD_CODE"/>
  10. <result property="adName" column="AD_NAME"/>
  11. <result property="location" column="LOCATION"/>
  12. <result property="status" column="STATUS"/>
  13. <result property="recPersId" column="REC_PERS_ID"/>
  14. <result property="recPers" column="REC_PERS"/>
  15. <result property="recPersTel" column="REC_PERS_TEL"/>
  16. <result property="intm" column="INTM"/>
  17. <result property="uptm" column="UPTM"/>
  18. </resultMap>
  19. <sql id="table_columns">
  20. ID,
  21. RGSTR_ID,
  22. INSP_OBJ_TYPE,
  23. INSP_OBJ_NAME,
  24. AD_CODE,
  25. AD_NAME,
  26. LOCATION,
  27. STATUS,
  28. REC_PERS_ID,
  29. REC_PERS,
  30. REC_PERS_TEL,
  31. INTM,
  32. UPTM
  33. </sql>
  34. <sql id="entity_properties">
  35. #{id},
  36. #{rgstrId},
  37. #{inspObjType},
  38. #{inspObjName},
  39. #{adCode},
  40. #{adName},
  41. #{location},
  42. #{status},
  43. #{recPersId},
  44. #{recPers},
  45. #{recPersTel},
  46. #{intm},
  47. #{uptm}
  48. </sql>
  49. <!-- 使用like用法:columnName like concat('%',#columnName#,'%') -->
  50. <sql id="page_where">
  51. <trim prefix="where" prefixOverrides="and | or ">
  52. <if test="rgstrId != null and rgstrId != ''">and RGSTR_ID = #{rgstrId}</if>
  53. <if test="inspObjType != null and inspObjType != ''">and INSP_OBJ_TYPE = #{inspObjType}</if>
  54. <if test="inspObjName != null and inspObjName != ''">and INSP_OBJ_NAME like concat('%',concat(#{inspObjName},'%'))</if>
  55. <if test="adCode != null and adCode != ''">and AD_CODE = #{adCode}</if>
  56. <if test="adName != null and adName != ''">and AD_NAME = #{adName}</if>
  57. <if test="location != null and location != ''">and LOCATION = #{location}</if>
  58. <if test="status != null and status != ''">and STATUS = #{status}</if>
  59. <if test="recPersId != null and recPersId != ''">and REC_PERS_ID = #{recPersId}</if>
  60. <if test="recPers != null and recPers != ''">and REC_PERS = #{recPers}</if>
  61. <if test="recPersTel != null and recPersTel != ''">and REC_PERS_TEL = #{recPersTel}</if>
  62. <if test="intm != null">and INTM = #{intm}</if>
  63. <if test="uptm != null">and UPTM = #{uptm}</if>
  64. </trim>
  65. </sql>
  66. <select id="get" resultMap="bisInspMfdpRgstrObjResultMap" parameterType="String" >
  67. select <include refid="table_columns" /> from BIS_INSP_MFDP_RGSTR_OBJ where ID = #{id}
  68. </select>
  69. <select id="getBy" resultMap="bisInspMfdpRgstrObjResultMap">
  70. select <include refid="table_columns" /> from BIS_INSP_MFDP_RGSTR_OBJ <include refid="page_where" />
  71. </select>
  72. <select id="findAll" resultMap="bisInspMfdpRgstrObjResultMap">
  73. select <include refid="table_columns" /> from BIS_INSP_MFDP_RGSTR_OBJ
  74. </select>
  75. <select id="findList" resultMap="bisInspMfdpRgstrObjResultMap">
  76. select <include refid="table_columns" /> from BIS_INSP_MFDP_RGSTR_OBJ <include refid="page_where" />
  77. </select>
  78. <select id="selectCount" resultType="int" >
  79. select count(ID) from BIS_INSP_MFDP_RGSTR_OBJ <include refid="page_where" />
  80. </select>
  81. <insert id="insert" parameterType="cn.com.goldenwater.dcproj.model.BisInspMfdpRgstrObj">
  82. insert into BIS_INSP_MFDP_RGSTR_OBJ( <include refid="table_columns" /> )
  83. values ( <include refid="entity_properties" /> )
  84. </insert>
  85. <delete id="delete" parameterType="java.lang.String">
  86. delete from BIS_INSP_MFDP_RGSTR_OBJ where ID = #{id}
  87. </delete>
  88. <delete id="deleteBy" parameterType="cn.com.goldenwater.dcproj.model.BisInspMfdpRgstrObj">
  89. delete from BIS_INSP_MFDP_RGSTR_OBJ <include refid="page_where" />
  90. </delete>
  91. <update id="deleteInFlag" parameterType="java.lang.String">
  92. update BIS_INSP_MFDP_RGSTR_OBJ set flag_valid = 0 where ID = #{id}
  93. </update>
  94. <update id="update" parameterType="cn.com.goldenwater.dcproj.model.BisInspMfdpRgstrObj">
  95. update BIS_INSP_MFDP_RGSTR_OBJ
  96. <trim prefix="set" suffixOverrides=",">
  97. <if test="rgstrId != null and rgstrId != ''">RGSTR_ID = #{rgstrId},</if>
  98. <if test="inspObjType != null and inspObjType != ''">INSP_OBJ_TYPE = #{inspObjType},</if>
  99. <if test="inspObjName != null and inspObjName != ''">INSP_OBJ_NAME = #{inspObjName},</if>
  100. <if test="adCode != null and adCode != ''">AD_CODE = #{adCode},</if>
  101. <if test="adName != null and adName != ''">AD_NAME = #{adName},</if>
  102. <if test="location != null and location != ''">LOCATION = #{location},</if>
  103. <if test="status != null and status != ''">STATUS = #{status},</if>
  104. <if test="recPersId != null and recPersId != ''">REC_PERS_ID = #{recPersId},</if>
  105. <if test="recPers != null and recPers != ''">REC_PERS = #{recPers},</if>
  106. <if test="recPersTel != null and recPersTel != ''">REC_PERS_TEL = #{recPersTel},</if>
  107. <if test="intm != null">INTM = #{intm},</if>
  108. <if test="uptm != null">UPTM = #{uptm},</if>
  109. </trim>
  110. <where>ID = #{id}</where>
  111. </update>
  112. <update id="updateBy" parameterType="cn.com.goldenwater.dcproj.model.BisInspMfdpRgstrObj">
  113. update BIS_INSP_MFDP_RGSTR_OBJ
  114. <trim prefix="set" suffixOverrides=",">
  115. <if test="rgstrId != null and rgstrId != ''">RGSTR_ID = #{rgstrId},</if>
  116. <if test="inspObjType != null and inspObjType != ''">INSP_OBJ_TYPE = #{inspObjType},</if>
  117. <if test="inspObjName != null and inspObjName != ''">INSP_OBJ_NAME = #{inspObjName},</if>
  118. <if test="adCode != null and adCode != ''">AD_CODE = #{adCode},</if>
  119. <if test="adName != null and adName != ''">AD_NAME = #{adName},</if>
  120. <if test="location != null and location != ''">LOCATION = #{location},</if>
  121. <if test="status != null and status != ''">STATUS = #{status},</if>
  122. <if test="recPersId != null and recPersId != ''">REC_PERS_ID = #{recPersId},</if>
  123. <if test="recPers != null and recPers != ''">REC_PERS = #{recPers},</if>
  124. <if test="recPersTel != null and recPersTel != ''">REC_PERS_TEL = #{recPersTel},</if>
  125. <if test="intm != null">INTM = #{intm},</if>
  126. <if test="uptm != null">UPTM = #{uptm},</if>
  127. </trim>
  128. <include refid="page_where" />
  129. </update>
  130. <!-- 其他自定义SQL -->
  131. </mapper>