SysDictMapper.xml 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  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="com.goafanti.common.dao.SysDictMapper">
  4. <resultMap id="BaseResultMap" type="com.goafanti.common.model.SysDict">
  5. <id column="id" jdbcType="VARCHAR" property="id" />
  6. <result column="value" jdbcType="VARCHAR" property="value" />
  7. </resultMap>
  8. <sql id="Base_Column_List">
  9. id, value
  10. </sql>
  11. <select id="selectByPrimaryKey" parameterType="java.lang.String" resultMap="BaseResultMap">
  12. select
  13. <include refid="Base_Column_List" />
  14. from sys_dict
  15. where id = #{id,jdbcType=VARCHAR}
  16. </select>
  17. <delete id="deleteByPrimaryKey" parameterType="java.lang.String">
  18. delete from sys_dict
  19. where id = #{id,jdbcType=VARCHAR}
  20. </delete>
  21. <insert id="insert" parameterType="com.goafanti.common.model.SysDict">
  22. insert into sys_dict (id, value)
  23. values (#{id,jdbcType=VARCHAR}, #{value,jdbcType=VARCHAR})
  24. </insert>
  25. <insert id="insertSelective" parameterType="com.goafanti.common.model.SysDict">
  26. insert into sys_dict
  27. <trim prefix="(" suffix=")" suffixOverrides=",">
  28. <if test="id != null">
  29. id,
  30. </if>
  31. <if test="value != null">
  32. value,
  33. </if>
  34. </trim>
  35. <trim prefix="values (" suffix=")" suffixOverrides=",">
  36. <if test="id != null">
  37. #{id,jdbcType=VARCHAR},
  38. </if>
  39. <if test="value != null">
  40. #{value,jdbcType=VARCHAR},
  41. </if>
  42. </trim>
  43. </insert>
  44. <update id="updateByPrimaryKeySelective" parameterType="com.goafanti.common.model.SysDict">
  45. update sys_dict
  46. <set>
  47. <if test="value != null">
  48. value = #{value,jdbcType=VARCHAR},
  49. </if>
  50. </set>
  51. where id = #{id,jdbcType=VARCHAR}
  52. </update>
  53. <update id="updateByPrimaryKey" parameterType="com.goafanti.common.model.SysDict">
  54. update sys_dict
  55. set value = #{value,jdbcType=VARCHAR}
  56. where id = #{id,jdbcType=VARCHAR}
  57. </update>
  58. </mapper>