BillDetailInfo.xml 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125
  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. </resultMap>
  20. <insert id="insert" parameterType="com.jpsoft.enterprise.modules.base.entity.BillDetailInfo">
  21. <!--
  22. <selectKey resultType="java.lang.String" order="BEFORE" keyProperty="id">
  23. select sys_guid() from dual
  24. </selectKey>
  25. -->
  26. <![CDATA[
  27. insert into base_bill_detail_info
  28. (id_,bill_id,order_id,company_id,bill_detail,rush_status,create_by,create_time,update_by,update_time,del_flag,sort_no)
  29. values
  30. (
  31. #{id,jdbcType=VARCHAR}
  32. ,#{billId,jdbcType=VARCHAR}
  33. ,#{orderId,jdbcType=VARCHAR}
  34. ,#{companyId,jdbcType=NUMERIC}
  35. ,#{billDetail,jdbcType=VARCHAR}
  36. ,#{rushStatus,jdbcType=VARCHAR}
  37. ,#{createBy,jdbcType=VARCHAR}
  38. ,#{createTime,jdbcType= TIMESTAMP }
  39. ,#{updateBy,jdbcType=VARCHAR}
  40. ,#{updateTime,jdbcType= TIMESTAMP }
  41. ,#{delFlag,jdbcType= NUMERIC }
  42. ,#{sortNo,jdbcType=INTEGER}
  43. )
  44. ]]>
  45. </insert>
  46. <delete id="delete" parameterType="string">
  47. delete from base_bill_detail_info where id_=#{id,jdbcType=VARCHAR}
  48. </delete>
  49. <update id="update" parameterType="com.jpsoft.enterprise.modules.base.entity.BillDetailInfo">
  50. update base_bill_detail_info
  51. <set>
  52. <if test="billId!=null">
  53. bill_id=#{billId,jdbcType=VARCHAR},
  54. </if>
  55. <if test="orderId!=null">
  56. order_id=#{orderId,jdbcType=VARCHAR},
  57. </if>
  58. <if test="companyId!=null">
  59. company_id=#{companyId,jdbcType=VARCHAR},
  60. </if>
  61. <if test="billDetail!=null">
  62. bill_detail=#{billDetail,jdbcType=VARCHAR},
  63. </if>
  64. <if test="rushStatus != null">
  65. rush_status = #{rushStatus,jdbcType=VARCHAR},
  66. </if>
  67. <if test="createBy!=null">
  68. create_by=#{createBy,jdbcType=VARCHAR},
  69. </if>
  70. <if test="createTime!=null">
  71. create_time=#{createTime,jdbcType= TIMESTAMP },
  72. </if>
  73. <if test="updateBy!=null">
  74. update_by=#{updateBy,jdbcType=VARCHAR},
  75. </if>
  76. <if test="updateTime!=null">
  77. update_time=#{updateTime,jdbcType= TIMESTAMP },
  78. </if>
  79. <if test="delFlag!=null">
  80. del_flag=#{delFlag,jdbcType= NUMERIC },
  81. </if>
  82. <if test="sortNo != null">
  83. sort_no = #{sortNo,jdbcType=INTEGER}
  84. </if>
  85. </set>
  86. where id_=#{id}
  87. </update>
  88. <select id="get" parameterType="string" resultMap="BillDetailInfoMap">
  89. select * from base_bill_detail_info where id_=#{0}
  90. </select>
  91. <select id="exist" parameterType="string" resultType="int">
  92. select count(*) from base_bill_detail_info where id_=#{0}
  93. </select>
  94. <select id="list" resultMap="BillDetailInfoMap">
  95. select * from base_bill_detail_info where del_flag = 0 order by create_time asc
  96. </select>
  97. <select id="search" parameterType="hashmap" resultMap="BillDetailInfoMap">
  98. <![CDATA[
  99. SELECT
  100. a.*
  101. FROM
  102. base_bill_detail_info a
  103. left join base_bill_info b on b.id_ = a.bill_id
  104. left join base_order_info c on c.id_ = a.order_id
  105. ]]>
  106. <where>
  107. a.del_flag = 0
  108. and b.del_flag = 0
  109. and c.del_flag = 0
  110. <if test="searchParams.id != null">
  111. and a.ID_ like #{searchParams.id}
  112. </if>
  113. <if test="searchParams.companyId != null ">
  114. and a.company_id = #{searchParams.companyId}
  115. </if>
  116. <if test="searchParams.status != null">
  117. and b.status_ = #{searchParams.status}
  118. </if>
  119. </where>
  120. <foreach item="sort" collection="sortList" open="order by" separator=",">
  121. ${sort.name} ${sort.order}
  122. </foreach>
  123. </select>
  124. </mapper>