FsIntegralExchangeMapper.xml 3.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <!DOCTYPE mapper
  3. PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
  4. "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
  5. <mapper namespace="com.fs.his.mapper.FsIntegralExchangeMapper">
  6. <resultMap type="FsIntegralExchange" id="FsIntegralExchangeResult">
  7. <result property="id" column="id" />
  8. <result property="userId" column="user_id" />
  9. <result property="integral" column="integral" />
  10. <result property="createTime" column="create_time" />
  11. <result property="status" column="status" />
  12. <result property="phone" column="phone" />
  13. <result property="nickName" column="nick_name" />
  14. </resultMap>
  15. <sql id="selectFsIntegralExchangeVo">
  16. select id, user_id, integral, create_time, status, phone, nick_name from fs_integral_exchange
  17. </sql>
  18. <select id="selectFsIntegralExchangeList" parameterType="FsIntegralExchange" resultMap="FsIntegralExchangeResult">
  19. <include refid="selectFsIntegralExchangeVo"/>
  20. <where>
  21. <if test="userId != null "> and user_id = #{userId}</if>
  22. <if test="integral != null "> and integral = #{integral}</if>
  23. <if test="status != null "> and status = #{status}</if>
  24. <if test="phone != null and phone != ''"> and phone = #{phone}</if>
  25. <if test="nickName != null and nickName != ''"> and nick_name like concat('%', #{nickName}, '%')</if>
  26. </where>
  27. </select>
  28. <select id="selectFsIntegralExchangeById" parameterType="Long" resultMap="FsIntegralExchangeResult">
  29. <include refid="selectFsIntegralExchangeVo"/>
  30. where id = #{id}
  31. </select>
  32. <insert id="insertFsIntegralExchange"
  33. parameterType="com.fs.his.domain.FsIntegralExchange"
  34. useGeneratedKeys="true"
  35. keyProperty="id">
  36. insert into fs_integral_exchange
  37. (user_id, integral, create_time, status, phone, nick_name)
  38. values
  39. (#{userId}, #{integral}, #{createTime}, #{status}, #{phone}, #{nickName})
  40. </insert>
  41. <update id="updateFsIntegralExchange" parameterType="FsIntegralExchange">
  42. update fs_integral_exchange
  43. <trim prefix="SET" suffixOverrides=",">
  44. <if test="userId != null">user_id = #{userId},</if>
  45. <if test="integral != null">integral = #{integral},</if>
  46. <if test="createTime != null">create_time = #{createTime},</if>
  47. <if test="status != null">status = #{status},</if>
  48. <if test="phone != null">phone = #{phone},</if>
  49. <if test="nickName != null">nick_name = #{nickName},</if>
  50. </trim>
  51. where id = #{id}
  52. </update>
  53. <delete id="deleteFsIntegralExchangeById" parameterType="Long">
  54. delete from fs_integral_exchange where id = #{id}
  55. </delete>
  56. <delete id="deleteFsIntegralExchangeByIds" parameterType="String">
  57. delete from fs_integral_exchange where id in
  58. <foreach item="id" collection="array" open="(" separator="," close=")">
  59. #{id}
  60. </foreach>
  61. </delete>
  62. </mapper>