TacEvalationNormDao.xml 5.0 KB

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