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