BisInspHystpDvcDao.xml 6.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151
  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.BisInspHystpDvcDao">
  4. <resultMap type="cn.com.goldenwater.dcproj.model.BisInspHystpDvc" id="bisInspHystpDvcResultMap">
  5. <result property="id" column="ID"/>
  6. <result property="rgstrId" column="RGSTR_ID"/>
  7. <result property="isPwrRqr" column="IS_PWR_RQR"/>
  8. <result property="isDvcChk" column="IS_DVC_CHK"/>
  9. <result property="isPlanMak" column="IS_PLAN_MAK"/>
  10. <result property="isPlanApp" column="IS_PLAN_APP"/>
  11. <result property="isPlanDemo" column="IS_PLAN_DEMO"/>
  12. <result property="persId" column="PERS_ID"/>
  13. <result property="intm" column="INTM"/>
  14. <result property="uptm" column="UPTM"/>
  15. <result property="note" column="NOTE"/>
  16. <result property="dataStat" column="DATA_STAT"/>
  17. <result property="state" column="STATE"/>
  18. </resultMap>
  19. <sql id="table_columns">
  20. ID,
  21. RGSTR_ID,
  22. IS_PWR_RQR,
  23. IS_DVC_CHK,
  24. IS_PLAN_MAK,
  25. IS_PLAN_APP,
  26. IS_PLAN_DEMO,
  27. PERS_ID,
  28. INTM,
  29. UPTM,
  30. NOTE,
  31. DATA_STAT,
  32. STATE
  33. </sql>
  34. <sql id="entity_properties">
  35. #{id},
  36. #{rgstrId},
  37. #{isPwrRqr},
  38. #{isDvcChk},
  39. #{isPlanMak},
  40. #{isPlanApp},
  41. #{isPlanDemo},
  42. #{persId},
  43. #{intm},
  44. #{uptm},
  45. #{note},
  46. #{dataStat},
  47. #{state}
  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="isPwrRqr != null and isPwrRqr != ''">and IS_PWR_RQR = #{isPwrRqr}</if>
  54. <if test="isDvcChk != null and isDvcChk != ''">and IS_DVC_CHK = #{isDvcChk}</if>
  55. <if test="isPlanMak != null and isPlanMak != ''">and IS_PLAN_MAK = #{isPlanMak}</if>
  56. <if test="isPlanApp != null and isPlanApp != ''">and IS_PLAN_APP = #{isPlanApp}</if>
  57. <if test="isPlanDemo != null and isPlanDemo != ''">and IS_PLAN_DEMO = #{isPlanDemo}</if>
  58. <if test="persId != null and persId != ''">and PERS_ID = #{persId}</if>
  59. <if test="intm != null">and INTM = #{intm}</if>
  60. <if test="uptm != null">and UPTM = #{uptm}</if>
  61. <if test="note != null and note != ''">and NOTE = #{note}</if>
  62. <if test="dataStat != null and dataStat != ''">and DATA_STAT = #{dataStat}</if>
  63. <if test="state != null and state != ''">and STATE = #{state}</if>
  64. </trim>
  65. </sql>
  66. <select id="get" resultMap="bisInspHystpDvcResultMap" parameterType="String" >
  67. select <include refid="table_columns" /> from BIS_INSP_HYSTP_DVC where RGSTR_ID = #{id}
  68. </select>
  69. <select id="getBy" resultMap="bisInspHystpDvcResultMap">
  70. select <include refid="table_columns" /> from BIS_INSP_HYSTP_DVC <include refid="page_where" />
  71. </select>
  72. <select id="findAll" resultMap="bisInspHystpDvcResultMap">
  73. select <include refid="table_columns" /> from BIS_INSP_HYSTP_DVC
  74. </select>
  75. <select id="findList" resultMap="bisInspHystpDvcResultMap">
  76. select <include refid="table_columns" /> from BIS_INSP_HYSTP_DVC <include refid="page_where" />
  77. </select>
  78. <select id="selectCount" resultType="int" >
  79. select count(ID) from BIS_INSP_HYSTP_DVC <include refid="page_where" />
  80. </select>
  81. <insert id="insert" parameterType="cn.com.goldenwater.dcproj.model.BisInspHystpDvc">
  82. insert into BIS_INSP_HYSTP_DVC( <include refid="table_columns" /> )
  83. values ( <include refid="entity_properties" /> )
  84. </insert>
  85. <delete id="delete" parameterType="java.lang.String">
  86. update BIS_INSP_HYSTP_DVC set DATA_STAT='9' where ID = #{id}
  87. </delete>
  88. <delete id="deleteBy" parameterType="cn.com.goldenwater.dcproj.model.BisInspHystpDvc">
  89. delete from BIS_INSP_HYSTP_DVC <include refid="page_where" />
  90. </delete>
  91. <update id="deleteInFlag" parameterType="java.lang.String">
  92. update BIS_INSP_HYSTP_DVC set flag_valid = 0 where ID = #{id}
  93. </update>
  94. <update id="update" parameterType="cn.com.goldenwater.dcproj.model.BisInspHystpDvc">
  95. update BIS_INSP_HYSTP_DVC
  96. <trim prefix="set" suffixOverrides=",">
  97. <if test="rgstrId != null and rgstrId != ''">RGSTR_ID = #{rgstrId},</if>
  98. <if test="isPwrRqr != null and isPwrRqr != ''">IS_PWR_RQR = #{isPwrRqr},</if>
  99. <if test="isDvcChk != null and isDvcChk != ''">IS_DVC_CHK = #{isDvcChk},</if>
  100. <if test="isPlanMak != null and isPlanMak != ''">IS_PLAN_MAK = #{isPlanMak},</if>
  101. <if test="isPlanApp != null and isPlanApp != ''">IS_PLAN_APP = #{isPlanApp},</if>
  102. <if test="isPlanDemo != null and isPlanDemo != ''">IS_PLAN_DEMO = #{isPlanDemo},</if>
  103. <if test="persId != null and persId != ''">PERS_ID = #{persId},</if>
  104. <if test="intm != null">INTM = #{intm},</if>
  105. <if test="uptm != null">UPTM = #{uptm},</if>
  106. <if test="note != null and note != ''">NOTE = #{note},</if>
  107. <if test="dataStat != null and dataStat != ''">DATA_STAT = #{dataStat},</if>
  108. <if test="state != null and state != ''">STATE = #{state},</if>
  109. </trim>
  110. <where>ID = #{id}</where>
  111. </update>
  112. <update id="updateBy" parameterType="cn.com.goldenwater.dcproj.model.BisInspHystpDvc">
  113. update BIS_INSP_HYSTP_DVC
  114. <trim prefix="set" suffixOverrides=",">
  115. <if test="rgstrId != null and rgstrId != ''">RGSTR_ID = #{rgstrId},</if>
  116. <if test="isPwrRqr != null and isPwrRqr != ''">IS_PWR_RQR = #{isPwrRqr},</if>
  117. <if test="isDvcChk != null and isDvcChk != ''">IS_DVC_CHK = #{isDvcChk},</if>
  118. <if test="isPlanMak != null and isPlanMak != ''">IS_PLAN_MAK = #{isPlanMak},</if>
  119. <if test="isPlanApp != null and isPlanApp != ''">IS_PLAN_APP = #{isPlanApp},</if>
  120. <if test="isPlanDemo != null and isPlanDemo != ''">IS_PLAN_DEMO = #{isPlanDemo},</if>
  121. <if test="persId != null and persId != ''">PERS_ID = #{persId},</if>
  122. <if test="intm != null">INTM = #{intm},</if>
  123. <if test="uptm != null">UPTM = #{uptm},</if>
  124. <if test="note != null and note != ''">NOTE = #{note},</if>
  125. <if test="dataStat != null and dataStat != ''">DATA_STAT = #{dataStat},</if>
  126. <if test="state != null and state != ''">STATE = #{state},</if>
  127. </trim>
  128. <include refid="page_where" />
  129. </update>
  130. <!-- 其他自定义SQL -->
  131. </mapper>