TOrderServiceMapper.xml 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  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.TOrderServiceMapper">
  4. <resultMap id="BaseResultMap" type="com.goafanti.common.model.TOrderService">
  5. <id column="id" jdbcType="INTEGER" property="id" />
  6. <result column="order_no" jdbcType="VARCHAR" property="orderNo" />
  7. <result column="service_time" jdbcType="DATE" property="serviceTime" />
  8. <result column="content" jdbcType="VARCHAR" property="content" />
  9. <result column="remarks" jdbcType="VARCHAR" property="remarks" />
  10. <result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
  11. </resultMap>
  12. <sql id="Base_Column_List">
  13. id, order_no, service_time, content, remarks, create_time
  14. </sql>
  15. <select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
  16. select
  17. <include refid="Base_Column_List" />
  18. from t_order_service
  19. where id = #{id,jdbcType=INTEGER}
  20. </select>
  21. <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
  22. delete from t_order_service
  23. where id = #{id,jdbcType=INTEGER}
  24. </delete>
  25. <insert id="insert" keyColumn="id" keyProperty="id" parameterType="com.goafanti.common.model.TOrderService" useGeneratedKeys="true">
  26. insert into t_order_service (order_no, service_time, content,
  27. remarks, create_time)
  28. values (#{orderNo,jdbcType=VARCHAR}, #{serviceTime,jdbcType=DATE}, #{content,jdbcType=VARCHAR},
  29. #{remarks,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP})
  30. </insert>
  31. <insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="com.goafanti.common.model.TOrderService" useGeneratedKeys="true">
  32. insert into t_order_service
  33. <trim prefix="(" suffix=")" suffixOverrides=",">
  34. <if test="orderNo != null">
  35. order_no,
  36. </if>
  37. <if test="serviceTime != null">
  38. service_time,
  39. </if>
  40. <if test="content != null">
  41. content,
  42. </if>
  43. <if test="remarks != null">
  44. remarks,
  45. </if>
  46. <if test="createTime != null">
  47. create_time,
  48. </if>
  49. </trim>
  50. <trim prefix="values (" suffix=")" suffixOverrides=",">
  51. <if test="orderNo != null">
  52. #{orderNo,jdbcType=VARCHAR},
  53. </if>
  54. <if test="serviceTime != null">
  55. #{serviceTime,jdbcType=DATE},
  56. </if>
  57. <if test="content != null">
  58. #{content,jdbcType=VARCHAR},
  59. </if>
  60. <if test="remarks != null">
  61. #{remarks,jdbcType=VARCHAR},
  62. </if>
  63. <if test="createTime != null">
  64. #{createTime,jdbcType=TIMESTAMP},
  65. </if>
  66. </trim>
  67. </insert>
  68. <update id="updateByPrimaryKeySelective" parameterType="com.goafanti.common.model.TOrderService">
  69. update t_order_service
  70. <set>
  71. <if test="orderNo != null">
  72. order_no = #{orderNo,jdbcType=VARCHAR},
  73. </if>
  74. <if test="serviceTime != null">
  75. service_time = #{serviceTime,jdbcType=DATE},
  76. </if>
  77. <if test="content != null">
  78. content = #{content,jdbcType=VARCHAR},
  79. </if>
  80. <if test="remarks != null">
  81. remarks = #{remarks,jdbcType=VARCHAR},
  82. </if>
  83. <if test="createTime != null">
  84. create_time = #{createTime,jdbcType=TIMESTAMP},
  85. </if>
  86. </set>
  87. where id = #{id,jdbcType=INTEGER}
  88. </update>
  89. <update id="updateByPrimaryKey" parameterType="com.goafanti.common.model.TOrderService">
  90. update t_order_service
  91. set order_no = #{orderNo,jdbcType=VARCHAR},
  92. service_time = #{serviceTime,jdbcType=DATE},
  93. content = #{content,jdbcType=VARCHAR},
  94. remarks = #{remarks,jdbcType=VARCHAR},
  95. create_time = #{createTime,jdbcType=TIMESTAMP}
  96. where id = #{id,jdbcType=INTEGER}
  97. </update>
  98. <select id="orderServiceList" resultType="com.goafanti.order.bo.TOrderServiceBo">
  99. select id,order_no orderNo,date_format(service_time,'%Y-%m-%d')serviceTimes,
  100. content ,remarks
  101. from t_order_service
  102. where order_no = #{orderNo}
  103. </select>
  104. </mapper>