TacEvalationConfigDao.xml 4.5 KB

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