631eb08bdfa11cd2cc9da8d1b8d111bebc133d05.svn-base 3.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  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.ErrorDao">
  4. <resultMap type="cn.com.goldenwater.dcproj.model.Error" id="errorResultMap">
  5. <result property="id" column="ID"/>
  6. <result property="intm" column="INTM"/>
  7. <result property="content" column="CONTENT"/>
  8. <result property="url" column="URL"/>
  9. </resultMap>
  10. <sql id="table_columns">
  11. ID,
  12. INTM,
  13. CONTENT,
  14. URL
  15. </sql>
  16. <sql id="entity_properties">
  17. #{id},
  18. #{intm},
  19. #{content},
  20. #{url}
  21. </sql>
  22. <!-- 使用like用法:columnName like concat('%',#columnName#,'%') -->
  23. <sql id="page_where">
  24. <trim prefix="where" prefixOverrides="and | or ">
  25. <if test="intm != null">and INTM = #{intm}</if>
  26. <if test="content != null and content != ''">and CONTENT = #{content}</if>
  27. <if test="url != null and url != ''">and URL = #{url}</if>
  28. </trim>
  29. </sql>
  30. <select id="get" resultMap="errorResultMap" parameterType="String" >
  31. select <include refid="table_columns" /> from GW_SYS_ERROR where ID = #{id}
  32. </select>
  33. <select id="getBy" resultMap="errorResultMap">
  34. select <include refid="table_columns" /> from GW_SYS_ERROR <include refid="page_where" />
  35. </select>
  36. <select id="findAll" resultMap="errorResultMap">
  37. select <include refid="table_columns" /> from GW_SYS_ERROR
  38. </select>
  39. <select id="findList" resultMap="errorResultMap">
  40. select <include refid="table_columns" /> from GW_SYS_ERROR <include refid="page_where" />
  41. </select>
  42. <select id="selectCount" resultType="int" >
  43. select count(ID) from GW_SYS_ERROR <include refid="page_where" />
  44. </select>
  45. <insert id="insert" parameterType="cn.com.goldenwater.dcproj.model.Error">
  46. insert into GW_SYS_ERROR( <include refid="table_columns" /> )
  47. values ( <include refid="entity_properties" /> )
  48. </insert>
  49. <delete id="delete" parameterType="java.lang.String">
  50. delete from GW_SYS_ERROR where ID = #{id}
  51. </delete>
  52. <delete id="deleteBy" parameterType="cn.com.goldenwater.dcproj.model.Error">
  53. delete from GW_SYS_ERROR <include refid="page_where" />
  54. </delete>
  55. <update id="deleteInFlag" parameterType="java.lang.String">
  56. update GW_SYS_ERROR set flag_valid = 0 where ID = #{id}
  57. </update>
  58. <update id="update" parameterType="cn.com.goldenwater.dcproj.model.Error">
  59. update GW_SYS_ERROR
  60. <trim prefix="set" suffixOverrides=",">
  61. <if test="intm != null">INTM = #{intm},</if>
  62. <if test="content != null and content != ''">CONTENT = #{content},</if>
  63. <if test="url != null and url != ''">URL = #{url},</if>
  64. </trim>
  65. <where>ID = #{id}</where>
  66. </update>
  67. <update id="updateBy" parameterType="cn.com.goldenwater.dcproj.model.Error">
  68. update GW_SYS_ERROR
  69. <trim prefix="set" suffixOverrides=",">
  70. <if test="intm != null">INTM = #{intm},</if>
  71. <if test="content != null and content != ''">CONTENT = #{content},</if>
  72. <if test="url != null and url != ''">URL = #{url},</if>
  73. </trim>
  74. <include refid="page_where" />
  75. </update>
  76. <!-- 其他自定义SQL -->
  77. </mapper>