JobActivityLogoMapper.xml 3.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
  3. "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
  4. <mapper namespace="com.zhyc.xps.jyprj.mapper.JobActivityLogoMapper">
  5. <resultMap id="JobActivityLogoMap" type="com.zhyc.xps.jyprj.entity.JobActivityLogo">
  6. <id column="jobactivity_id" property="jobactivityId" jdbcType="BIGINT"/>
  7. <result column="type_id" property="typeId" jdbcType="BIGINT"/><!--作业活动类型-->
  8. <result column="logo_url" property="logoUrl" jdbcType="VARCHAR"/> <!--作业活动图标地址-->
  9. <result column="jobactivity_title" property="jobactivityTitle" jdbcType="VARCHAR"/><!--作业活动名称-->
  10. </resultMap>
  11. <select id="getByList" parameterType="java.util.Map" resultMap="JobActivityLogoMap">
  12. SELECT *
  13. FROM jobactivity_logo
  14. </select>
  15. <select id="getBytypeId" resultMap="JobActivityLogoMap">
  16. SELECT *
  17. FROM jobactivity_logo
  18. WHERE type_id = #{typeId}
  19. </select>
  20. <insert id="create" parameterType="com.zhyc.xps.jyprj.entity.JobActivityLogo">
  21. insert into jobactivity_logo
  22. <trim prefix="(" suffix=")" suffixOverrides=",">
  23. <if test="jobactivityId != null">
  24. jobactivity_id,
  25. </if>
  26. <if test="typeId != null">
  27. type_id,
  28. </if>
  29. <if test="logoUrl != null and logoUrl != ''">
  30. logo_url,
  31. </if>
  32. <if test="jobactivityTitle != null and jobactivityTitle != ''">
  33. jobactivity_title,
  34. </if>
  35. </trim>
  36. <trim prefix="values (" suffix=")" suffixOverrides=",">
  37. <if test="jobactivityId != null">
  38. #{jobactivityId, jdbcType=BIGINT},
  39. </if>
  40. <if test="typeId != null">
  41. #{typeId, jdbcType=BIGINT},
  42. </if>
  43. <if test="logoUrl != null and logoUrl != ''">
  44. #{logoUrl, jdbcType=VARCHAR},
  45. </if>
  46. <if test="jobactivityTitle != null and jobactivityTitle != ''">
  47. #{jobactivityTitle, jdbcType=VARCHAR},
  48. </if>
  49. </trim>
  50. </insert>
  51. <!--Update更新-->
  52. <update id="update" parameterType="com.zhyc.xps.jyprj.entity.JobActivityLogo">
  53. UPDATE jobactivity_logo
  54. <trim suffixOverrides=",">
  55. <set>
  56. <if test="logoUrl != null">
  57. logo_url = #{logoUrl, jdbcType=VARCHAR},
  58. </if>
  59. <if test="jobactivityTitle != null">
  60. jobactivity_title = #{jobactivityTitle, jdbcType=VARCHAR},
  61. </if>
  62. </set>
  63. </trim>
  64. WHERE 1 = 1
  65. <if test="typeId != null">
  66. AND type_id = #{typeId, jdbcType=BIGINT}
  67. </if>
  68. </update>
  69. <delete id="delete" >
  70. DELETE FROM jobactivity_logo
  71. WHERE type_id = #{typeId, jdbcType=BIGINT}
  72. </delete>
  73. </mapper>