|
@@ -23,52 +23,76 @@
|
|
|
<result column="productLevelId" property="productLevelId"/>
|
|
|
<result column="organizationId" property="organizationId"/>
|
|
|
<result column="payOrganizationId" property="payOrganizationId"/>
|
|
|
+ <collection property="invoice" ofType="com.bosshand.virgo.api.workark.model.Invoice" resultMap="com.bosshand.virgo.api.workark.dao.InvoiceDao.result" columnPrefix="invoice_"/>
|
|
|
</resultMap>
|
|
|
|
|
|
+ <sql id="query">
|
|
|
+ select a.*,
|
|
|
+ b.id as invoice_id,
|
|
|
+ b.invoiceModelId as invoice_invoiceModelId,
|
|
|
+ b.organizationId as invoice_organizationId,
|
|
|
+ b.userId as invoice_userId,
|
|
|
+ b.createTime as invoice_createTime,
|
|
|
+ b.updateTime as invoice_updateTime,
|
|
|
+ b.orderNo as invoice_orderNo,
|
|
|
+ b.type as invoice_type,
|
|
|
+ b.name as invoice_name,
|
|
|
+ b.taxpayerIdentificationNumber as invoice_taxpayerIdentificationNumber,
|
|
|
+ b.address as invoice_address,
|
|
|
+ b.phone as invoice_phone,
|
|
|
+ b.bankAccount as invoice_bankAccount,
|
|
|
+ b.bankAccountNumber as invoice_bankAccountNumber,
|
|
|
+ b.content as invoice_content,
|
|
|
+ b.amount as invoice_amount,
|
|
|
+ b.file as invoice_file,
|
|
|
+ b.state as invoice_state
|
|
|
+ from workark_orderInfo a left join workark_invoice b on a.orderNo = b.orderNo
|
|
|
+ </sql>
|
|
|
+
|
|
|
<select id="get" resultMap="result">
|
|
|
- select * from workark_orderInfo where id = #{id}
|
|
|
+ <include refid="query" /> where a.id = #{id}
|
|
|
</select>
|
|
|
|
|
|
<select id="getOrderNo" resultMap="result">
|
|
|
- select * from workark_orderInfo where orderNo = #{orderNo}
|
|
|
+ <include refid="query" /> where a.orderNo = #{orderNo}
|
|
|
</select>
|
|
|
|
|
|
<select id="getNoPayOrderByProductId" resultMap="result">
|
|
|
- select * from workark_orderInfo where productId = #{productId} AND userId =#{userId} AND orderStatus=#{orderStatus}
|
|
|
+ <include refid="query" /> a.productId = #{productId} AND a.userId =#{userId} AND a.orderStatus=#{orderStatus}
|
|
|
</select>
|
|
|
|
|
|
<select id="getList" resultMap="result">
|
|
|
- select * from workark_orderInfo
|
|
|
+ <include refid="query" />
|
|
|
<where>
|
|
|
<if test="title != null">
|
|
|
- and title = #{title}
|
|
|
+ and a.title = #{title}
|
|
|
</if>
|
|
|
<if test="orderNo != null">
|
|
|
- and orderNo = #{orderNo}
|
|
|
+ and a.orderNo = #{orderNo}
|
|
|
</if>
|
|
|
<if test="userId != null">
|
|
|
- and userId = #{userId}
|
|
|
+ and a.userId = #{userId}
|
|
|
</if>
|
|
|
<if test="productId != null">
|
|
|
- and productId = #{productId}
|
|
|
+ and a.productId = #{productId}
|
|
|
</if>
|
|
|
<if test="orderStatus != null">
|
|
|
- and orderStatus = #{orderStatus}
|
|
|
+ and a.orderStatus = #{orderStatus}
|
|
|
</if>
|
|
|
<if test="status != null">
|
|
|
- and status = #{status}
|
|
|
+ and a.status = #{status}
|
|
|
</if>
|
|
|
<if test="paymentType != null">
|
|
|
- and paymentType = #{paymentType}
|
|
|
+ and a.paymentType = #{paymentType}
|
|
|
</if>
|
|
|
<if test="productLevelId != 0">
|
|
|
- and productLevelId = #{productLevelId}
|
|
|
+ and a.productLevelId = #{productLevelId}
|
|
|
</if>
|
|
|
<if test="organizationId != 0">
|
|
|
- and organizationId = #{organizationId}
|
|
|
+ and a.organizationId = #{organizationId}
|
|
|
</if>
|
|
|
<if test="payOrganizationId != 0">
|
|
|
- and payOrganizationId = #{payOrganizationId}
|
|
|
+ and a.payOrganizationId = #{payOrganizationId}
|
|
|
</if>
|
|
|
</where>
|
|
|
</select>
|
|
@@ -110,40 +134,40 @@
|
|
|
</select>
|
|
|
|
|
|
<select id="getLimit" resultMap="result">
|
|
|
- select * from workark_orderInfo
|
|
|
+ <include refid="query" />
|
|
|
<where>
|
|
|
<if test="p.title != null">
|
|
|
- and title = #{p.title}
|
|
|
+ and a.title = #{p.title}
|
|
|
</if>
|
|
|
<if test="p.orderNo != null">
|
|
|
- and orderNo = #{p.orderNo}
|
|
|
+ and a.orderNo = #{p.orderNo}
|
|
|
</if>
|
|
|
<if test="p.userId != null">
|
|
|
- and userId = #{p.userId}
|
|
|
+ and a.userId = #{p.userId}
|
|
|
</if>
|
|
|
<if test="p.productId != null">
|
|
|
- and productId = #{p.productId}
|
|
|
+ and a.productId = #{p.productId}
|
|
|
</if>
|
|
|
<if test="p.orderStatus != null">
|
|
|
- and orderStatus = #{p.orderStatus}
|
|
|
+ and a.orderStatus = #{p.orderStatus}
|
|
|
</if>
|
|
|
<if test="p.status != null">
|
|
|
- and status = #{p.status}
|
|
|
+ and a.status = #{p.status}
|
|
|
</if>
|
|
|
<if test="p.paymentType != null">
|
|
|
- and paymentType = #{p.paymentType}
|
|
|
+ and a.paymentType = #{p.paymentType}
|
|
|
</if>
|
|
|
<if test="p.productLevelId != 0">
|
|
|
- and productLevelId = #{p.productLevelId}
|
|
|
+ and a.productLevelId = #{p.productLevelId}
|
|
|
</if>
|
|
|
<if test="p.organizationId != 0">
|
|
|
- and organizationId = #{p.organizationId}
|
|
|
+ and a.organizationId = #{p.organizationId}
|
|
|
</if>
|
|
|
<if test="p.payOrganizationId != 0">
|
|
|
- and payOrganizationId = #{p.payOrganizationId}
|
|
|
+ and a.payOrganizationId = #{p.payOrganizationId}
|
|
|
</if>
|
|
|
</where>
|
|
|
- order by createTime desc limit #{currIndex} , #{pageSize}
|
|
|
+ order by a.createTime desc limit #{currIndex} , #{pageSize}
|
|
|
</select>
|
|
|
|
|
|
<insert id="save" useGeneratedKeys="true" keyProperty="id">
|