BisInspRsfcoRgstrTflwliiDao.xml 7.0 KB

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