AppUsersCashAccountMapper.xml 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  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.game.business.mapper.AppUsersCashAccountMapper">
  6. <resultMap type="com.game.business.domain.AppUsersCashAccount" id="AppUsersCashAccountResult">
  7. <result property="id" column="id" />
  8. <result property="account" column="account" />
  9. <result property="accountBank" column="account_bank" />
  10. <result property="addtime" column="addtime" />
  11. <result property="branch" column="branch" />
  12. <result property="isDefault" column="is_default" />
  13. <result property="name" column="name" />
  14. <result property="type" column="type" />
  15. <result property="uid" column="uid" />
  16. </resultMap>
  17. <sql id="selectAppUsersCashAccountVo">
  18. select id, account, account_bank, addtime, branch, is_default, name, type, uid from app_users_cash_account
  19. </sql>
  20. <select id="selectAppUsersCashAccountList" parameterType="com.game.business.domain.AppUsersCashAccount" resultMap="AppUsersCashAccountResult">
  21. <include refid="selectAppUsersCashAccountVo"/>
  22. <where>
  23. <if test="account != null and account != ''"> and account = #{account}</if>
  24. <if test="accountBank != null and accountBank != ''"> and account_bank = #{accountBank}</if>
  25. <if test="addtime != null "> and addtime = #{addtime}</if>
  26. <if test="branch != null and branch != ''"> and branch = #{branch}</if>
  27. <if test="isDefault != null "> and is_default = #{isDefault}</if>
  28. <if test="name != null and name != ''"> and name like concat('%', #{name}, '%')</if>
  29. <if test="type != null "> and type = #{type}</if>
  30. <if test="uid != null "> and uid = #{uid}</if>
  31. </where>
  32. </select>
  33. <select id="selectAppUsersCashAccountById" parameterType="Long" resultMap="AppUsersCashAccountResult">
  34. <include refid="selectAppUsersCashAccountVo"/>
  35. where id = #{id}
  36. </select>
  37. <insert id="insertAppUsersCashAccount" parameterType="com.game.business.domain.AppUsersCashAccount">
  38. insert into app_users_cash_account
  39. <trim prefix="(" suffix=")" suffixOverrides=",">
  40. <if test="id != null">id,</if>
  41. <if test="account != null">account,</if>
  42. <if test="accountBank != null">account_bank,</if>
  43. <if test="addtime != null">addtime,</if>
  44. <if test="branch != null">branch,</if>
  45. <if test="isDefault != null">is_default,</if>
  46. <if test="name != null">name,</if>
  47. <if test="type != null">type,</if>
  48. <if test="uid != null">uid,</if>
  49. </trim>
  50. <trim prefix="values (" suffix=")" suffixOverrides=",">
  51. <if test="id != null">#{id},</if>
  52. <if test="account != null">#{account},</if>
  53. <if test="accountBank != null">#{accountBank},</if>
  54. <if test="addtime != null">#{addtime},</if>
  55. <if test="branch != null">#{branch},</if>
  56. <if test="isDefault != null">#{isDefault},</if>
  57. <if test="name != null">#{name},</if>
  58. <if test="type != null">#{type},</if>
  59. <if test="uid != null">#{uid},</if>
  60. </trim>
  61. </insert>
  62. <update id="updateAppUsersCashAccount" parameterType="com.game.business.domain.AppUsersCashAccount">
  63. update app_users_cash_account
  64. <trim prefix="SET" suffixOverrides=",">
  65. <if test="account != null">account = #{account},</if>
  66. <if test="accountBank != null">account_bank = #{accountBank},</if>
  67. <if test="addtime != null">addtime = #{addtime},</if>
  68. <if test="branch != null">branch = #{branch},</if>
  69. <if test="isDefault != null">is_default = #{isDefault},</if>
  70. <if test="name != null">name = #{name},</if>
  71. <if test="type != null">type = #{type},</if>
  72. <if test="uid != null">uid = #{uid},</if>
  73. </trim>
  74. where id = #{id}
  75. </update>
  76. <delete id="deleteAppUsersCashAccountById" parameterType="Long">
  77. delete from app_users_cash_account where id = #{id}
  78. </delete>
  79. <delete id="deleteAppUsersCashAccountByIds" parameterType="String">
  80. delete from app_users_cash_account where id in
  81. <foreach item="id" collection="array" open="(" separator="," close=")">
  82. #{id}
  83. </foreach>
  84. </delete>
  85. </mapper>