KwtWaybillOrderTicketMapper.xml 4.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  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.sckw.transport.dao.KwtWaybillOrderTicketMapper">
  4. <resultMap id="BaseResultMap" type="com.sckw.transport.model.KwtWaybillOrderTicket">
  5. <id column="id" jdbcType="BIGINT" property="id" />
  6. <result column="w_order_id" jdbcType="BIGINT" property="wOrderId" />
  7. <result column="type" jdbcType="INTEGER" property="type" />
  8. <result column="unit" jdbcType="VARCHAR" property="unit" />
  9. <result column="amount" jdbcType="DECIMAL" property="amount" />
  10. <result column="gross_amount" jdbcType="DECIMAL" property="grossAmount" />
  11. <result column="tare_amount" jdbcType="DECIMAL" property="tareAmount" />
  12. <result column="urls" jdbcType="VARCHAR" property="urls" />
  13. <result column="operate_time" jdbcType="TIMESTAMP" property="operateTime" />
  14. <result column="remark" jdbcType="VARCHAR" property="remark" />
  15. <result column="status" jdbcType="INTEGER" property="status" />
  16. <result column="create_by" jdbcType="BIGINT" property="createBy" />
  17. <result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
  18. <result column="update_by" jdbcType="BIGINT" property="updateBy" />
  19. <result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
  20. <result column="del_flag" jdbcType="INTEGER" property="delFlag" />
  21. </resultMap>
  22. <sql id="Base_Column_List">
  23. id, w_order_id, `type`, unit, amount, gross_amount, tare_amount, urls, operate_time, remark, `status`,
  24. create_by, create_time, update_by, update_time, del_flag
  25. </sql>
  26. <select id="findWaybillOrderTicket" resultType="com.sckw.transport.model.KwtWaybillOrderTicket" >
  27. select
  28. id, w_order_id wOrderId, w_subtask_id wSubtaskId, w_address_id wAddressId, `type`, unit, amount,
  29. gross_amount grossAmount, tare_amount tareAmount, urls, operate_time, remark, `status`, create_by createBy,
  30. create_time createTime, update_by updateBy, update_time updateTime
  31. from kwt_waybill_order_ticket
  32. where del_flag = 0
  33. <if test="wOrderId != null and wOrderId != ''">
  34. and w_order_id = #{wOrderId, jdbcType=BIGINT}
  35. </if>
  36. <if test="wSubtaskId != null and wSubtaskId != ''">
  37. and w_subtask_id = #{wSubtaskId, jdbcType=BIGINT}
  38. </if>
  39. <if test="type != null and type != ''">
  40. and type = #{type, jdbcType=INTEGER}
  41. </if>
  42. </select>
  43. <select id="findWaybillOrderTicketV1" resultType="com.sckw.transport.model.KwtWaybillOrderTicket" >
  44. select
  45. id, w_order_id wOrderId, w_subtask_id wSubtaskId, w_address_id wAddressId, `type`, unit, amount,
  46. gross_amount grossAmount, tare_amount tareAmount, urls, operate_time, remark, `status`, create_by createBy,
  47. create_time createTime, update_by updateBy, update_time updateTime
  48. from kwt_waybill_order_ticket
  49. where del_flag = 0
  50. <if test="wOrderId != null and wOrderId != ''">
  51. and w_order_id = #{wOrderId, jdbcType=BIGINT}
  52. </if>
  53. <if test="wSubtaskId != null and wSubtaskId != ''">
  54. and w_subtask_id = #{wSubtaskId, jdbcType=BIGINT}
  55. </if>
  56. <if test="type != null and type != ''">
  57. and type = #{type, jdbcType=INTEGER}
  58. </if>
  59. <if test="unit != null and unit != ''">
  60. and unit = #{unit, jdbcType=VARCHAR}
  61. </if>
  62. </select>
  63. <select id="findWaybillOrderTicketV2" resultType="com.sckw.transport.model.KwtWaybillOrderTicket" >
  64. select
  65. id, w_order_id wOrderId, w_subtask_id wSubtaskId, w_address_id wAddressId, `type`, unit, amount,
  66. gross_amount grossAmount, tare_amount tareAmount, urls, operate_time, remark, `status`, create_by createBy,
  67. create_time createTime, update_by updateBy, update_time updateTime
  68. from kwt_waybill_order_ticket
  69. where del_flag = 0
  70. <if test="wAddressId != null and wAddressId != ''">
  71. and w_address_id = #{wAddressId, jdbcType=BIGINT}
  72. </if>
  73. <if test="unit != null and unit != ''">
  74. and unit = #{unit, jdbcType=VARCHAR}
  75. </if>
  76. order by update_time limit 1
  77. </select>
  78. <update id="deleteTicket">
  79. UPDATE kwt_waybill_order_ticket set del_flag = 1
  80. WHERE del_flag = 0
  81. and w_order_id = #{wOrderId, jdbcType=BIGINT}
  82. and type = #{type, jdbcType=INTEGER}
  83. </update>
  84. </mapper>