TOrderApprovalMapper.xml 3.6 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.goafanti.common.dao.TOrderApprovalMapper">
  6. <resultMap id="BaseResultMap" type="com.goafanti.common.model.TOrderApproval">
  7. <id property="id" column="id" jdbcType="INTEGER"/>
  8. <result property="orderNo" column="order_no" jdbcType="VARCHAR"/>
  9. <result property="type" column="type" jdbcType="INTEGER"/>
  10. <result property="typeExplain" column="type_explain" jdbcType="VARCHAR"/>
  11. </resultMap>
  12. <sql id="Base_Column_List">
  13. id,order_no,type,
  14. type_explain
  15. </sql>
  16. <select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
  17. select
  18. <include refid="Base_Column_List" />
  19. from t_order_approval
  20. where id = #{id,jdbcType=INTEGER}
  21. </select>
  22. <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
  23. delete from t_order_approval
  24. where id = #{id,jdbcType=INTEGER}
  25. </delete>
  26. <insert id="insert" keyColumn="id" keyProperty="id" parameterType="com.goafanti.common.model.TOrderApproval" useGeneratedKeys="true">
  27. insert into t_order_approval
  28. ( id,order_no,type
  29. ,type_explain)
  30. values (#{id,jdbcType=INTEGER},#{orderNo,jdbcType=VARCHAR},#{type,jdbcType=INTEGER}
  31. ,#{typeExplain,jdbcType=VARCHAR})
  32. </insert>
  33. <insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="com.goafanti.common.model.TOrderApproval" useGeneratedKeys="true">
  34. insert into t_order_approval
  35. <trim prefix="(" suffix=")" suffixOverrides=",">
  36. <if test="id != null">id,</if>
  37. <if test="orderNo != null">order_no,</if>
  38. <if test="type != null">type,</if>
  39. <if test="typeExplain != null">type_explain,</if>
  40. </trim>
  41. <trim prefix="values (" suffix=")" suffixOverrides=",">
  42. <if test="id != null">#{id,jdbcType=INTEGER},</if>
  43. <if test="orderNo != null">#{orderNo,jdbcType=VARCHAR},</if>
  44. <if test="type != null">#{type,jdbcType=INTEGER},</if>
  45. <if test="typeExplain != null">#{typeExplain,jdbcType=VARCHAR},</if>
  46. </trim>
  47. </insert>
  48. <update id="updateByPrimaryKeySelective" parameterType="com.goafanti.common.model.TOrderApproval">
  49. update t_order_approval
  50. <set>
  51. <if test="orderNo != null">
  52. order_no = #{orderNo,jdbcType=VARCHAR},
  53. </if>
  54. <if test="type != null">
  55. type = #{type,jdbcType=INTEGER},
  56. </if>
  57. <if test="typeExplain != null">
  58. type_explain = #{typeExplain,jdbcType=VARCHAR},
  59. </if>
  60. </set>
  61. where id = #{id,jdbcType=INTEGER}
  62. </update>
  63. <update id="updateByPrimaryKey" parameterType="com.goafanti.common.model.TOrderApproval">
  64. update t_order_approval
  65. set
  66. order_no = #{orderNo,jdbcType=VARCHAR},
  67. type = #{type,jdbcType=INTEGER},
  68. type_explain = #{typeExplain,jdbcType=VARCHAR}
  69. where id = #{id,jdbcType=INTEGER}
  70. </update>
  71. <delete id="deleteByOderNo">
  72. delete from t_order_approval
  73. where order_no= #{orderNo}
  74. </delete>
  75. <select id="selectByOrderNo" resultMap="BaseResultMap">
  76. select
  77. <include refid="Base_Column_List" />
  78. from t_order_approval
  79. where order_no= #{orderNo}
  80. </select>
  81. </mapper>