<?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">
|
<mapper namespace="com.stylefeng.guns.modular.system.dao.TBillMapper">
|
|
<!-- 通用查询映射结果 -->
|
<resultMap id="BaseResultMap" type="com.stylefeng.guns.modular.system.model.TBill">
|
<id column="id" property="id" />
|
<result column="orderId" property="orderId" />
|
<result column="billType" property="billType" />
|
<result column="billHeaderType" property="billHeaderType" />
|
<result column="companyName" property="companyName" />
|
<result column="companyTaxNumber" property="companyTaxNumber" />
|
<result column="billContent" property="billContent" />
|
<result column="moreContent" property="moreContent" />
|
<result column="billAmount" property="billAmount" />
|
<result column="addresseeName" property="addresseeName" />
|
<result column="addresseePhone" property="addresseePhone" />
|
<result column="addresseeEmail" property="addresseeEmail" />
|
<result column="state" property="state" />
|
<result column="createTime" property="createTime" />
|
</resultMap>
|
|
<!-- 通用查询结果列 -->
|
<sql id="Base_Column_List">
|
id, orderId, billType, billHeaderType, companyName, companyTaxNumber, billContent, moreContent, billAmount, addresseeName, addresseePhone, addresseeEmail, state, createTime
|
</sql>
|
<select id="getPageList" resultType="com.stylefeng.guns.modular.system.model.TBill">
|
SELECT b.id, b.orderId, b.billType, b.billHeaderType, b.companyName, b.companyTaxNumber, b.billContent, b.moreContent, b.billAmount, b.addresseeName, b.addresseePhone,
|
b.addresseeEmail, b.state, b.createTime
|
FROM t_bill b
|
LEFT JOIN t_order o ON b.orderId = o.id
|
<where>
|
<if test="startTime != null and startTime != '' and endTime != null and endTime != ''">
|
AND b.createTime BETWEEN #{startTime} AND #{endTime}
|
</if>
|
<if test="addresseePhone != null and addresseePhone != ''">
|
AND b.addresseePhone LIKE concat('%',#{addresseePhone},'%')
|
</if>
|
<if test="state != null">
|
AND b.state = #{state}
|
</if>
|
<if test="billType != null">
|
AND b.billType = #{billType}
|
</if>
|
<if test="billHeaderType != null">
|
AND b.billHeaderType = #{billHeaderType}
|
</if>
|
<if test="roleType != null and roleType == 2">
|
AND o.branchOfficeId = #{objectId}
|
</if>
|
<if test="roleType != null and roleType == 3">
|
AND o.agentId = #{objectId}
|
</if>
|
</where>
|
ORDER BY b.createTime DESC
|
</select>
|
|
</mapper>
|