BillDetailInfo.xml 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137
  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
  3. "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
  4. <!-- namespace必须指向DAO接口 -->
  5. <mapper namespace="com.jpsoft.enterprise.modules.base.dao.BillDetailInfoDAO">
  6. <resultMap id="BillDetailInfoMap" type="com.jpsoft.enterprise.modules.base.entity.BillDetailInfo">
  7. <id property="id" column="id_" />
  8. <result property="billId" column="bill_id" />
  9. <result property="orderId" column="order_id" />
  10. <result property="companyId" column="company_id"/>
  11. <result property="billDetail" column="bill_detail" />
  12. <result property="rushStatus" column="rush_status"/>
  13. <result property="createBy" column="create_by" />
  14. <result property="createTime" column="create_time" />
  15. <result property="updateBy" column="update_by" />
  16. <result property="updateTime" column="update_time" />
  17. <result property="delFlag" column="del_flag" />
  18. <result property="sortNo" column="sort_no"/>
  19. <result property="ticketUrl" column="ticket_url"/>
  20. </resultMap>
  21. <insert id="insert" parameterType="com.jpsoft.enterprise.modules.base.entity.BillDetailInfo">
  22. <!--
  23. <selectKey resultType="java.lang.String" order="BEFORE" keyProperty="id">
  24. select sys_guid() from dual
  25. </selectKey>
  26. -->
  27. <![CDATA[
  28. insert into base_bill_detail_info
  29. (id_,bill_id,order_id,company_id,bill_detail,rush_status,create_by,create_time,update_by,update_time,del_flag,sort_no,ticket_url)
  30. values
  31. (
  32. #{id,jdbcType=VARCHAR}
  33. ,#{billId,jdbcType=VARCHAR}
  34. ,#{orderId,jdbcType=VARCHAR}
  35. ,#{companyId,jdbcType=NUMERIC}
  36. ,#{billDetail,jdbcType=VARCHAR}
  37. ,#{rushStatus,jdbcType=VARCHAR}
  38. ,#{createBy,jdbcType=VARCHAR}
  39. ,#{createTime,jdbcType= TIMESTAMP }
  40. ,#{updateBy,jdbcType=VARCHAR}
  41. ,#{updateTime,jdbcType= TIMESTAMP }
  42. ,#{delFlag,jdbcType= NUMERIC }
  43. ,#{sortNo,jdbcType=INTEGER}
  44. ,#{ticketUrl,jdbcType=VARCHAR}
  45. )
  46. ]]>
  47. </insert>
  48. <delete id="delete" parameterType="string">
  49. delete from base_bill_detail_info where id_=#{id,jdbcType=VARCHAR}
  50. </delete>
  51. <update id="update" parameterType="com.jpsoft.enterprise.modules.base.entity.BillDetailInfo">
  52. update base_bill_detail_info
  53. <set>
  54. <if test="billId!=null">
  55. bill_id=#{billId,jdbcType=VARCHAR},
  56. </if>
  57. <if test="orderId!=null">
  58. order_id=#{orderId,jdbcType=VARCHAR},
  59. </if>
  60. <if test="companyId!=null">
  61. company_id=#{companyId,jdbcType=VARCHAR},
  62. </if>
  63. <if test="billDetail!=null">
  64. bill_detail=#{billDetail,jdbcType=VARCHAR},
  65. </if>
  66. <if test="rushStatus != null">
  67. rush_status = #{rushStatus,jdbcType=VARCHAR},
  68. </if>
  69. <if test="createBy!=null">
  70. create_by=#{createBy,jdbcType=VARCHAR},
  71. </if>
  72. <if test="createTime!=null">
  73. create_time=#{createTime,jdbcType= TIMESTAMP },
  74. </if>
  75. <if test="updateBy!=null">
  76. update_by=#{updateBy,jdbcType=VARCHAR},
  77. </if>
  78. <if test="updateTime!=null">
  79. update_time=#{updateTime,jdbcType= TIMESTAMP },
  80. </if>
  81. <if test="delFlag!=null">
  82. del_flag=#{delFlag,jdbcType= NUMERIC },
  83. </if>
  84. <if test="sortNo != null">
  85. sort_no = #{sortNo,jdbcType=INTEGER},
  86. </if>
  87. <if test="ticketUrl != null">
  88. ticket_url = #{ticketUrl,jdbcType=VARCHAR}
  89. </if>
  90. </set>
  91. where id_=#{id}
  92. </update>
  93. <select id="get" parameterType="string" resultMap="BillDetailInfoMap">
  94. select * from base_bill_detail_info where id_=#{0}
  95. </select>
  96. <select id="exist" parameterType="string" resultType="int">
  97. select count(*) from base_bill_detail_info where id_=#{0}
  98. </select>
  99. <select id="list" resultMap="BillDetailInfoMap">
  100. select * from base_bill_detail_info where del_flag = 0 order by create_time asc
  101. </select>
  102. <select id="findByBillId" resultMap="BillDetailInfoMap">
  103. select * from base_bill_detail_info where del_flag = 0 and bill_id = #{0} order by create_time asc
  104. </select>
  105. <select id="search" parameterType="hashmap" resultMap="BillDetailInfoMap">
  106. <![CDATA[
  107. SELECT
  108. a.*
  109. FROM
  110. base_bill_detail_info a
  111. left join base_bill_info b on b.id_ = a.bill_id
  112. left join base_order_info c on c.id_ = a.order_id
  113. ]]>
  114. <where>
  115. a.del_flag = 0
  116. and b.del_flag = 0
  117. and c.del_flag = 0
  118. <if test="searchParams.id != null">
  119. and a.ID_ like #{searchParams.id}
  120. </if>
  121. <if test="searchParams.companyId != null ">
  122. and a.company_id = #{searchParams.companyId}
  123. </if>
  124. <if test="searchParams.billId != null ">
  125. and a.bill_id = #{searchParams.billId}
  126. </if>
  127. <if test="searchParams.status != null">
  128. and b.status_ = #{searchParams.status}
  129. </if>
  130. </where>
  131. <foreach item="sort" collection="sortList" open="order by" separator=",">
  132. ${sort.name} ${sort.order}
  133. </foreach>
  134. </select>
  135. </mapper>