AdYoukuAccountMapper.xml 4.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  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.ad.mapper.AdYoukuAccountMapper">
  6. <resultMap type="AdYoukuAccount" id="AdYoukuAccountResult">
  7. <result property="id" column="id" />
  8. <result property="accountId" column="account_id" />
  9. <result property="accountName" column="account_name" />
  10. <result property="appKey" column="app_key" />
  11. <result property="token" column="token" />
  12. <result property="createTime" column="create_time" />
  13. <result property="createBy" column="create_by" />
  14. <result property="updateBy" column="update_by" />
  15. <result property="updateTime" column="update_time" />
  16. <result property="remark" column="remark" />
  17. </resultMap>
  18. <sql id="selectAdYoukuAccountVo">
  19. select id, account_id, account_name, app_key, token, create_time, create_by, update_by, update_time, remark from ad_youku_account
  20. </sql>
  21. <select id="selectAdYoukuAccountList" parameterType="AdYoukuAccount" resultMap="AdYoukuAccountResult">
  22. <include refid="selectAdYoukuAccountVo"/>
  23. <where>
  24. <if test="accountId != null and accountId != ''"> and account_id = #{accountId}</if>
  25. <if test="accountName != null and accountName != ''"> and account_name like concat('%', #{accountName}, '%')</if>
  26. <if test="appKey != null and appKey != ''"> and app_key = #{appKey}</if>
  27. <if test="token != null and token != ''"> and token = #{token}</if>
  28. </where>
  29. </select>
  30. <select id="selectAdYoukuAccountById" parameterType="Long" resultMap="AdYoukuAccountResult">
  31. <include refid="selectAdYoukuAccountVo"/>
  32. where id = #{id}
  33. </select>
  34. <insert id="insertAdYoukuAccount" parameterType="AdYoukuAccount" useGeneratedKeys="true" keyProperty="id">
  35. insert into ad_youku_account
  36. <trim prefix="(" suffix=")" suffixOverrides=",">
  37. <if test="accountId != null">account_id,</if>
  38. <if test="accountName != null">account_name,</if>
  39. <if test="appKey != null">app_key,</if>
  40. <if test="token != null">token,</if>
  41. <if test="createTime != null">create_time,</if>
  42. <if test="createBy != null">create_by,</if>
  43. <if test="updateBy != null">update_by,</if>
  44. <if test="updateTime != null">update_time,</if>
  45. <if test="remark != null">remark,</if>
  46. </trim>
  47. <trim prefix="values (" suffix=")" suffixOverrides=",">
  48. <if test="accountId != null">#{accountId},</if>
  49. <if test="accountName != null">#{accountName},</if>
  50. <if test="appKey != null">#{appKey},</if>
  51. <if test="token != null">#{token},</if>
  52. <if test="createTime != null">#{createTime},</if>
  53. <if test="createBy != null">#{createBy},</if>
  54. <if test="updateBy != null">#{updateBy},</if>
  55. <if test="updateTime != null">#{updateTime},</if>
  56. <if test="remark != null">#{remark},</if>
  57. </trim>
  58. </insert>
  59. <update id="updateAdYoukuAccount" parameterType="AdYoukuAccount">
  60. update ad_youku_account
  61. <trim prefix="SET" suffixOverrides=",">
  62. <if test="accountId != null">account_id = #{accountId},</if>
  63. <if test="accountName != null">account_name = #{accountName},</if>
  64. <if test="appKey != null">app_key = #{appKey},</if>
  65. <if test="token != null">token = #{token},</if>
  66. <if test="createTime != null">create_time = #{createTime},</if>
  67. <if test="createBy != null">create_by = #{createBy},</if>
  68. <if test="updateBy != null">update_by = #{updateBy},</if>
  69. <if test="updateTime != null">update_time = #{updateTime},</if>
  70. <if test="remark != null">remark = #{remark},</if>
  71. </trim>
  72. where id = #{id}
  73. </update>
  74. <delete id="deleteAdYoukuAccountById" parameterType="Long">
  75. delete from ad_youku_account where id = #{id}
  76. </delete>
  77. <delete id="deleteAdYoukuAccountByIds" parameterType="String">
  78. delete from ad_youku_account where id in
  79. <foreach item="id" collection="array" open="(" separator="," close=")">
  80. #{id}
  81. </foreach>
  82. </delete>
  83. </mapper>