| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137 |
- <?xml version="1.0" encoding="UTF-8" ?>
- <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
- "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
- <!-- namespace必须指向DAO接口 -->
- <mapper namespace="com.jpsoft.enterprise.modules.base.dao.BillDetailInfoDAO">
- <resultMap id="BillDetailInfoMap" type="com.jpsoft.enterprise.modules.base.entity.BillDetailInfo">
- <id property="id" column="id_" />
- <result property="billId" column="bill_id" />
- <result property="orderId" column="order_id" />
- <result property="companyId" column="company_id"/>
- <result property="billDetail" column="bill_detail" />
- <result property="rushStatus" column="rush_status"/>
- <result property="createBy" column="create_by" />
- <result property="createTime" column="create_time" />
- <result property="updateBy" column="update_by" />
- <result property="updateTime" column="update_time" />
- <result property="delFlag" column="del_flag" />
- <result property="sortNo" column="sort_no"/>
- <result property="ticketUrl" column="ticket_url"/>
- </resultMap>
- <insert id="insert" parameterType="com.jpsoft.enterprise.modules.base.entity.BillDetailInfo">
- <!--
- <selectKey resultType="java.lang.String" order="BEFORE" keyProperty="id">
- select sys_guid() from dual
- </selectKey>
- -->
- <![CDATA[
- insert into base_bill_detail_info
- (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)
- values
- (
- #{id,jdbcType=VARCHAR}
- ,#{billId,jdbcType=VARCHAR}
- ,#{orderId,jdbcType=VARCHAR}
- ,#{companyId,jdbcType=NUMERIC}
- ,#{billDetail,jdbcType=VARCHAR}
- ,#{rushStatus,jdbcType=VARCHAR}
- ,#{createBy,jdbcType=VARCHAR}
- ,#{createTime,jdbcType= TIMESTAMP }
- ,#{updateBy,jdbcType=VARCHAR}
- ,#{updateTime,jdbcType= TIMESTAMP }
- ,#{delFlag,jdbcType= NUMERIC }
- ,#{sortNo,jdbcType=INTEGER}
- ,#{ticketUrl,jdbcType=VARCHAR}
- )
- ]]>
- </insert>
- <delete id="delete" parameterType="string">
- delete from base_bill_detail_info where id_=#{id,jdbcType=VARCHAR}
- </delete>
- <update id="update" parameterType="com.jpsoft.enterprise.modules.base.entity.BillDetailInfo">
- update base_bill_detail_info
- <set>
- <if test="billId!=null">
- bill_id=#{billId,jdbcType=VARCHAR},
- </if>
- <if test="orderId!=null">
- order_id=#{orderId,jdbcType=VARCHAR},
- </if>
- <if test="companyId!=null">
- company_id=#{companyId,jdbcType=VARCHAR},
- </if>
- <if test="billDetail!=null">
- bill_detail=#{billDetail,jdbcType=VARCHAR},
- </if>
- <if test="rushStatus != null">
- rush_status = #{rushStatus,jdbcType=VARCHAR},
- </if>
- <if test="createBy!=null">
- create_by=#{createBy,jdbcType=VARCHAR},
- </if>
- <if test="createTime!=null">
- create_time=#{createTime,jdbcType= TIMESTAMP },
- </if>
- <if test="updateBy!=null">
- update_by=#{updateBy,jdbcType=VARCHAR},
- </if>
- <if test="updateTime!=null">
- update_time=#{updateTime,jdbcType= TIMESTAMP },
- </if>
- <if test="delFlag!=null">
- del_flag=#{delFlag,jdbcType= NUMERIC },
- </if>
- <if test="sortNo != null">
- sort_no = #{sortNo,jdbcType=INTEGER},
- </if>
- <if test="ticketUrl != null">
- ticket_url = #{ticketUrl,jdbcType=VARCHAR}
- </if>
- </set>
- where id_=#{id}
- </update>
- <select id="get" parameterType="string" resultMap="BillDetailInfoMap">
- select * from base_bill_detail_info where id_=#{0}
- </select>
- <select id="exist" parameterType="string" resultType="int">
- select count(*) from base_bill_detail_info where id_=#{0}
- </select>
- <select id="list" resultMap="BillDetailInfoMap">
- select * from base_bill_detail_info where del_flag = 0 order by create_time asc
- </select>
- <select id="findByBillId" resultMap="BillDetailInfoMap">
- select * from base_bill_detail_info where del_flag = 0 and bill_id = #{0} order by create_time asc
- </select>
- <select id="search" parameterType="hashmap" resultMap="BillDetailInfoMap">
- <![CDATA[
- SELECT
- a.*
- FROM
- base_bill_detail_info a
- left join base_bill_info b on b.id_ = a.bill_id
- left join base_order_info c on c.id_ = a.order_id
- ]]>
- <where>
- a.del_flag = 0
- and b.del_flag = 0
- and c.del_flag = 0
- <if test="searchParams.id != null">
- and a.ID_ like #{searchParams.id}
- </if>
- <if test="searchParams.companyId != null ">
- and a.company_id = #{searchParams.companyId}
- </if>
- <if test="searchParams.billId != null ">
- and a.bill_id = #{searchParams.billId}
- </if>
- <if test="searchParams.status != null">
- and b.status_ = #{searchParams.status}
- </if>
- </where>
- <foreach item="sort" collection="sortList" open="order by" separator=",">
- ${sort.name} ${sort.order}
- </foreach>
- </select>
- </mapper>
|