AskaChannelnosMapper.xml 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  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.mofangchuxing.aska.dao.mapper.AskaChannelnosMapper">
  6. <resultMap id="BaseResultMap" type="com.mofangchuxing.aska.dao.domain.AskaChannelnos">
  7. <id property="id" column="id" jdbcType="INTEGER"/>
  8. <result property="channelId" column="channelId" jdbcType="INTEGER"/>
  9. <result property="channelNo" column="channelNo" jdbcType="CHAR"/>
  10. <result property="channelName" column="channelName" jdbcType="CHAR"/>
  11. <result property="status" column="status" jdbcType="CHAR"/>
  12. <result property="note" column="note" jdbcType="VARCHAR"/>
  13. </resultMap>
  14. <sql id="Base_Column_List">
  15. id,channelId,channelNo,
  16. channelName,status,note
  17. </sql>
  18. <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
  19. select
  20. <include refid="Base_Column_List" />
  21. from aska_channelnos
  22. where id = #{id,jdbcType=INTEGER}
  23. </select>
  24. <select id="searchAll" resultMap="BaseResultMap">
  25. select
  26. <include refid="Base_Column_List" />
  27. from aska_channelnos
  28. where 1=1
  29. <if test="channelId != null and channelId != ''">
  30. and channelId = #{channelId}
  31. </if>
  32. </select>
  33. <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
  34. delete from aska_channelnos
  35. where id = #{id,jdbcType=INTEGER}
  36. </delete>
  37. <insert id="insert" keyColumn="id" keyProperty="id" parameterType="com.mofangchuxing.aska.dao.domain.AskaChannelnos" useGeneratedKeys="true">
  38. insert into aska_channelnos
  39. ( id,channelId,channelNo
  40. ,channelName,status,note
  41. )
  42. values (#{id,jdbcType=INTEGER},#{channelId,jdbcType=INTEGER},#{channelNo,jdbcType=CHAR}
  43. ,#{channelName,jdbcType=CHAR},#{status,jdbcType=CHAR},#{note,jdbcType=VARCHAR}
  44. )
  45. </insert>
  46. <insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="com.mofangchuxing.aska.dao.domain.AskaChannelnos" useGeneratedKeys="true">
  47. insert into aska_channelnos
  48. <trim prefix="(" suffix=")" suffixOverrides=",">
  49. <if test="id != null">id,</if>
  50. <if test="channelId != null">channelId,</if>
  51. <if test="channelNo != null">channelNo,</if>
  52. <if test="channelName != null">channelName,</if>
  53. <if test="status != null">status,</if>
  54. <if test="note != null">note,</if>
  55. </trim>
  56. <trim prefix="values (" suffix=")" suffixOverrides=",">
  57. <if test="id != null">#{id,jdbcType=INTEGER},</if>
  58. <if test="channelId != null">#{channelId,jdbcType=INTEGER},</if>
  59. <if test="channelNo != null">#{channelNo,jdbcType=CHAR},</if>
  60. <if test="channelName != null">#{channelName,jdbcType=CHAR},</if>
  61. <if test="status != null">#{status,jdbcType=CHAR},</if>
  62. <if test="note != null">#{note,jdbcType=VARCHAR},</if>
  63. </trim>
  64. </insert>
  65. <update id="updateByPrimaryKeySelective" parameterType="com.mofangchuxing.aska.dao.domain.AskaChannelnos">
  66. update aska_channelnos
  67. <set>
  68. <if test="channelId != null">
  69. channelId = #{channelId,jdbcType=INTEGER},
  70. </if>
  71. <if test="channelNo != null">
  72. channelNo = #{channelNo,jdbcType=CHAR},
  73. </if>
  74. <if test="channelName != null">
  75. channelName = #{channelName,jdbcType=CHAR},
  76. </if>
  77. <if test="status != null">
  78. status = #{status,jdbcType=CHAR},
  79. </if>
  80. <if test="note != null">
  81. note = #{note,jdbcType=VARCHAR},
  82. </if>
  83. </set>
  84. where id = #{id,jdbcType=INTEGER}
  85. </update>
  86. <update id="updateByPrimaryKey" parameterType="com.mofangchuxing.aska.dao.domain.AskaChannelnos">
  87. update aska_channelnos
  88. set
  89. channelId = #{channelId,jdbcType=INTEGER},
  90. channelNo = #{channelNo,jdbcType=CHAR},
  91. channelName = #{channelName,jdbcType=CHAR},
  92. status = #{status,jdbcType=CHAR},
  93. note = #{note,jdbcType=VARCHAR}
  94. where id = #{id,jdbcType=INTEGER}
  95. </update>
  96. </mapper>