BisInspHystpRunDao.xml 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133
  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.BisInspHystpRunDao">
  4. <resultMap type="cn.com.goldenwater.dcproj.model.BisInspHystpRun" id="bisInspHystpRunResultMap">
  5. <result property="dataStat" column="DATA_STAT"/>
  6. <result property="state" column="STATE"/>
  7. <result property="powDutyNum" column="POW_DUTY_NUM"/>
  8. <result property="persId" column="PERS_ID"/>
  9. <result property="intm" column="INTM"/>
  10. <result property="uptm" column="UPTM"/>
  11. <result property="note" column="NOTE"/>
  12. <result property="id" column="ID"/>
  13. <result property="rgstrId" column="RGSTR_ID"/>
  14. <result property="powPersNum" column="POW_PERS_NUM"/>
  15. </resultMap>
  16. <sql id="table_columns">
  17. DATA_STAT,
  18. STATE,
  19. POW_DUTY_NUM,
  20. PERS_ID,
  21. INTM,
  22. UPTM,
  23. NOTE,
  24. ID,
  25. RGSTR_ID,
  26. POW_PERS_NUM
  27. </sql>
  28. <sql id="entity_properties">
  29. #{dataStat},
  30. #{state},
  31. #{powDutyNum},
  32. #{persId},
  33. #{intm},
  34. #{uptm},
  35. #{note},
  36. #{id},
  37. #{rgstrId},
  38. #{powPersNum}
  39. </sql>
  40. <!-- 使用like用法:columnName like concat('%',#columnName#,'%') -->
  41. <sql id="page_where">
  42. <trim prefix="where" prefixOverrides="and | or ">
  43. <if test="state != null and state != ''">and STATE = #{state}</if>
  44. <if test="powDutyNum != null and powDutyNum != ''">and POW_DUTY_NUM = #{powDutyNum}</if>
  45. <if test="persId != null and persId != ''">and PERS_ID = #{persId}</if>
  46. <if test="intm != null">and INTM = #{intm}</if>
  47. <if test="uptm != null">and UPTM = #{uptm}</if>
  48. <if test="note != null and note != ''">and NOTE = #{note}</if>
  49. <if test="id != null and id != ''">and ID = #{id}</if>
  50. <if test="rgstrId != null and rgstrId != ''">and RGSTR_ID = #{rgstrId}</if>
  51. <if test="powPersNum != null and powPersNum != ''">and POW_PERS_NUM = #{powPersNum}</if>
  52. </trim>
  53. </sql>
  54. <select id="get" resultMap="bisInspHystpRunResultMap" parameterType="String" >
  55. select <include refid="table_columns" /> from BIS_INSP_HYSTP_RUN where RGSTR_ID = #{id}
  56. </select>
  57. <select id="getBy" resultMap="bisInspHystpRunResultMap">
  58. select <include refid="table_columns" /> from BIS_INSP_HYSTP_RUN <include refid="page_where" />
  59. </select>
  60. <select id="findAll" resultMap="bisInspHystpRunResultMap">
  61. select <include refid="table_columns" /> from BIS_INSP_HYSTP_RUN
  62. </select>
  63. <select id="findList" resultMap="bisInspHystpRunResultMap">
  64. select <include refid="table_columns" /> from BIS_INSP_HYSTP_RUN <include refid="page_where" />
  65. </select>
  66. <select id="selectCount" resultType="int" >
  67. select count(ID) from BIS_INSP_HYSTP_RUN <include refid="page_where" />
  68. </select>
  69. <insert id="insert" parameterType="cn.com.goldenwater.dcproj.model.BisInspHystpRun">
  70. insert into BIS_INSP_HYSTP_RUN( <include refid="table_columns" /> )
  71. values ( <include refid="entity_properties" /> )
  72. </insert>
  73. <delete id="delete" parameterType="java.lang.String">
  74. update BIS_INSP_HYSTP_RUN set DATA_STAT='9' where ID = #{id}
  75. </delete>
  76. <delete id="deleteBy" parameterType="cn.com.goldenwater.dcproj.model.BisInspHystpRun">
  77. delete from BIS_INSP_HYSTP_RUN <include refid="page_where" />
  78. </delete>
  79. <update id="deleteInFlag" parameterType="java.lang.String">
  80. update BIS_INSP_HYSTP_RUN set flag_valid = 0 where ID = #{id}
  81. </update>
  82. <update id="update" parameterType="cn.com.goldenwater.dcproj.model.BisInspHystpRun">
  83. update BIS_INSP_HYSTP_RUN
  84. <trim prefix="set" suffixOverrides=",">
  85. <if test="state != null and state != ''">STATE = #{state},</if>
  86. <if test="powDutyNum != null and powDutyNum != ''">POW_DUTY_NUM = #{powDutyNum},</if>
  87. <if test="persId != null and persId != ''">PERS_ID = #{persId},</if>
  88. <if test="intm != null">INTM = #{intm},</if>
  89. <if test="uptm != null">UPTM = #{uptm},</if>
  90. <if test="note != null and note != ''">NOTE = #{note},</if>
  91. <if test="id != null and id != ''">ID = #{id},</if>
  92. <if test="rgstrId != null and rgstrId != ''">RGSTR_ID = #{rgstrId},</if>
  93. <if test="powPersNum != null and powPersNum != ''">POW_PERS_NUM = #{powPersNum},</if>
  94. </trim>
  95. <where>ID = #{id}</where>
  96. </update>
  97. <update id="updateBy" parameterType="cn.com.goldenwater.dcproj.model.BisInspHystpRun">
  98. update BIS_INSP_HYSTP_RUN
  99. <trim prefix="set" suffixOverrides=",">
  100. <if test="state != null and state != ''">STATE = #{state},</if>
  101. <if test="powDutyNum != null and powDutyNum != ''">POW_DUTY_NUM = #{powDutyNum},</if>
  102. <if test="persId != null and persId != ''">PERS_ID = #{persId},</if>
  103. <if test="intm != null">INTM = #{intm},</if>
  104. <if test="uptm != null">UPTM = #{uptm},</if>
  105. <if test="note != null and note != ''">NOTE = #{note},</if>
  106. <if test="id != null and id != ''">ID = #{id},</if>
  107. <if test="rgstrId != null and rgstrId != ''">RGSTR_ID = #{rgstrId},</if>
  108. <if test="powPersNum != null and powPersNum != ''">POW_PERS_NUM = #{powPersNum},</if>
  109. </trim>
  110. <include refid="page_where" />
  111. </update>
  112. <!-- 其他自定义SQL -->
  113. </mapper>