bms2发票相关;
This commit is contained in:
@@ -0,0 +1,40 @@
|
||||
<?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.mhd.bms.domain.bmsInvoiceInfo.repository.mapper.BmsInvoiceInfoMapper">
|
||||
<select id="queryList" parameterType="java.lang.String" resultType="com.mhd.bms.domain.bmsInvoiceInfo.repository.vo.BmsInvoiceInfoVO">
|
||||
select
|
||||
<include refid="field_where"></include>
|
||||
from
|
||||
tms_invoice_info a
|
||||
where a.is_delete = 0
|
||||
<include refid="common_where"></include>
|
||||
order by a.create_time desc
|
||||
</select>
|
||||
<sql id="common_where">
|
||||
<if test="tmsInvoiceInfoDTO.id !=null and tmsInvoiceInfoDTO.id != ''"> and a.id = #{tmsInvoiceInfoDTO.id} </if>
|
||||
<if test="tmsInvoiceInfoDTO.id!=null and tmsInvoiceInfoDTO.id!=''"> and instr(a.id ,#{tmsInvoiceInfoDTO.id}) > 0 </if>
|
||||
<if test="tmsInvoiceInfoDTO.createBy !=null and tmsInvoiceInfoDTO.createBy != ''"> and a.create_by = #{tmsInvoiceInfoDTO.createBy} </if>
|
||||
<if test="@org.jeecg.common.util.oConvertUtils@isNotEmpty(tmsInvoiceInfoDTO.invoiceTitle)">
|
||||
and a.invoice_title LIKE CONCAT('%',#{tmsInvoiceInfoDTO.invoiceTitle},'%')
|
||||
</if>
|
||||
<if test="@org.jeecg.common.util.oConvertUtils@isNotEmpty(tmsInvoiceInfoDTO.taxRegAccount)">
|
||||
and a.tax_reg_account LIKE CONCAT('%',#{tmsInvoiceInfoDTO.taxRegAccount},'%')
|
||||
</if>
|
||||
<if test="@org.jeecg.common.util.oConvertUtils@isNotEmpty(tmsInvoiceInfoDTO.createByName)">
|
||||
and a.create_by_name LIKE CONCAT('%',#{tmsInvoiceInfoDTO.createByName},'%')
|
||||
</if>
|
||||
<if test="tmsInvoiceInfoDTO.createTime!=null and tmsInvoiceInfoDTO.createTime!=''">
|
||||
and STR_TO_DATE(a.create_time, '%Y-%m-%d') <= #{tmsInvoiceInfoDTO.createTime}
|
||||
</if>
|
||||
<!-- 部门 -->
|
||||
<if test="tmsInvoiceInfoDTO.sysOrgCode!=null and tmsInvoiceInfoDTO.sysOrgCode!=''">
|
||||
and a.sys_org_code = #{tmsInvoiceInfoDTO.sysOrgCode}
|
||||
</if>
|
||||
|
||||
</sql>
|
||||
|
||||
<sql id="field_where">
|
||||
a.id,a.shipper_id,a.invoice_type,a.invoice_title,a.tax_reg_account,a.bank_name,a.basic_account_number,a.reg_place_address,a.reg_landline_phone
|
||||
,a.business_certificate_img_url,a.create_by ,a.create_by_name,a.create_time ,a.update_by ,a.update_time ,a.is_delete ,a.sys_org_code
|
||||
</sql>
|
||||
</mapper>
|
||||
@@ -0,0 +1,136 @@
|
||||
<?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.mhd.bms.domain.bmsInvoiceList.repository.mapper.BmsInvoiceListMapper">
|
||||
<select id="queryList" parameterType="java.lang.String" resultType="com.mhd.bms.domain.bmsInvoiceList.repository.vo.BmsInvoiceListVO">
|
||||
select
|
||||
<include refid="field_where"></include>
|
||||
FROM
|
||||
bms_invoice_list a
|
||||
LEFT JOIN bms_waybill_invoiced b ON a.id = b.invoice_list_id
|
||||
where a.is_delete = 0
|
||||
<include refid="common_where"></include>
|
||||
group by a.id
|
||||
order by a.create_time desc
|
||||
</select>
|
||||
<select id="getById" parameterType="java.lang.String" resultType="com.mhd.bms.domain.bmsInvoiceList.repository.vo.BmsInvoiceListDetailsVO">
|
||||
select
|
||||
<include refid="field_where2"></include>
|
||||
from
|
||||
bms_invoice_list a
|
||||
LEFT JOIN bms_invoice_info b
|
||||
ON a.invoice_title = b.invoice_title
|
||||
where a.id = #{id} and a.is_delete = 0
|
||||
group by a.id
|
||||
</select>
|
||||
<sql id="common_where">
|
||||
<if test="bmsInvoiceListQueryDTO.id !=null and bmsInvoiceListQueryDTO.id != ''"> and a.id = #{bmsInvoiceListQueryDTO.id} </if>
|
||||
<if test="bmsInvoiceListQueryDTO.id!=null and bmsInvoiceListQueryDTO.id!=''"> and instr(a.id ,#{bmsInvoiceListQueryDTO.id}) > 0 </if>
|
||||
<if test="bmsInvoiceListQueryDTO.invoiceState!=null"> and instr(a.invoice_state ,#{bmsInvoiceListQueryDTO.invoiceState}) > 0 </if>
|
||||
<if test="bmsInvoiceListQueryDTO.createStartTime!=null and bmsInvoiceListQueryDTO.createEndTime!=null ">
|
||||
and DATE_FORMAT(a.invoice_apply_time,'%Y-%m-%d') <![CDATA[>=]]> DATE_FORMAT(#{bmsInvoiceListQueryDTO.createStartTime},'%Y-%m-%d')
|
||||
and DATE_FORMAT(a.invoice_apply_time,'%Y-%m-%d') <![CDATA[<=]]> DATE_FORMAT(#{bmsInvoiceListQueryDTO.createEndTime},'%Y-%m-%d')
|
||||
</if>
|
||||
<if test="bmsInvoiceListQueryDTO.invoiceMakeTimeStart!=null and bmsInvoiceListQueryDTO.invoiceMakeTimeEnd!=null ">
|
||||
and DATE_FORMAT(a.invoice_make_time,'%Y-%m-%d') <![CDATA[>=]]> DATE_FORMAT(#{bmsInvoiceListQueryDTO.invoiceMakeTimeStart},'%Y-%m-%d')
|
||||
and DATE_FORMAT(a.invoice_make_time,'%Y-%m-%d') <![CDATA[<=]]> DATE_FORMAT(#{bmsInvoiceListQueryDTO.invoiceMakeTimeEnd},'%Y-%m-%d')
|
||||
</if>
|
||||
|
||||
<if test="bmsInvoiceListQueryDTO.managerTimeStart!=null and bmsInvoiceListQueryDTO.managerTimeEnd!=null ">
|
||||
and DATE_FORMAT(a.manager_time,'%Y-%m-%d') <![CDATA[>=]]> DATE_FORMAT(#{bmsInvoiceListQueryDTO.managerTimeeStart},'%Y-%m-%d')
|
||||
and DATE_FORMAT(a.manager_time,'%Y-%m-%d') <![CDATA[<=]]> DATE_FORMAT(#{bmsInvoiceListQueryDTO.managerTimeTimeEnd},'%Y-%m-%d')
|
||||
</if>
|
||||
|
||||
<if test="bmsInvoiceListQueryDTO.remark !=null and bmsInvoiceListQueryDTO.remark != ''">
|
||||
and a.remark LIKE CONCAT('%',#{bmsInvoiceListQueryDTO.remark},'%')
|
||||
</if>
|
||||
<if test="bmsInvoiceListQueryDTO.createBy !=null and bmsInvoiceListQueryDTO.createBy != ''"> and a.create_by = #{bmsInvoiceListQueryDTO.createBy} </if>
|
||||
<!-- 部门 -->
|
||||
<if test="bmsInvoiceListQueryDTO.sysOrgCode!=null and bmsInvoiceListQueryDTO.sysOrgCode!=''">
|
||||
and a.sys_org_code = #{bmsInvoiceListQueryDTO.sysOrgCode}
|
||||
</if>
|
||||
<if test="@org.jeecg.common.util.oConvertUtils@isNotEmpty(bmsInvoiceListQueryDTO.applyNumber)">
|
||||
and a.apply_number LIKE CONCAT('%',#{bmsInvoiceListQueryDTO.applyNumber},'%')
|
||||
</if>
|
||||
<if test="@org.jeecg.common.util.oConvertUtils@isNotEmpty(bmsInvoiceListQueryDTO.shipperName)">
|
||||
and a.shipper_name LIKE CONCAT('%',#{bmsInvoiceListQueryDTO.shipperName},'%')
|
||||
</if>
|
||||
<if test="@org.jeecg.common.util.oConvertUtils@isNotEmpty(bmsInvoiceListQueryDTO.shipperId)">
|
||||
and a.shipper_id = #{bmsInvoiceListQueryDTO.shipperId}
|
||||
</if>
|
||||
<if test="@org.jeecg.common.util.oConvertUtils@isNotEmpty(bmsInvoiceListQueryDTO.companyName)">
|
||||
and a.company_name LIKE CONCAT('%',#{bmsInvoiceListQueryDTO.companyName},'%')
|
||||
</if>
|
||||
<if test="@org.jeecg.common.util.oConvertUtils@isNotEmpty(bmsInvoiceListQueryDTO.invoiceTitle)">
|
||||
and a.invoice_title LIKE CONCAT('%',#{bmsInvoiceListQueryDTO.invoiceTitle},'%')
|
||||
</if>
|
||||
<if test="bmsInvoiceListQueryDTO.organizationId != null ">
|
||||
and a.organization_id = #{bmsInvoiceListQueryDTO.organizationId}
|
||||
and a.organization_name IS NOT NULL
|
||||
</if>
|
||||
<if test="bmsInvoiceListQueryDTO.topOrganizationId != null ">
|
||||
and a.top_organization_id = #{bmsInvoiceListQueryDTO.topOrganizationId}
|
||||
<if test="bmsInvoiceListQueryDTO.organizationId == null">
|
||||
and a.organization_name IS NOT NULL
|
||||
</if>
|
||||
</if>
|
||||
<if test="bmsInvoiceListQueryDTO.organizationName != null and bmsInvoiceListQueryDTO.organizationName != ''">
|
||||
and a.organization_name LIKE CONCAT('%',#{bmsInvoiceListQueryDTO.organizationName},'%')
|
||||
</if>
|
||||
</sql>
|
||||
|
||||
<sql id="field_where">
|
||||
a.id,
|
||||
a.invoice_title,
|
||||
a.invoice_value,
|
||||
a.remark,
|
||||
a.invoice_state,
|
||||
(CASE
|
||||
a.invoice_state
|
||||
WHEN 0 THEN
|
||||
'未开票'
|
||||
WHEN 1 THEN
|
||||
'已取消申请'
|
||||
WHEN 2 THEN
|
||||
'已开票'
|
||||
WHEN 3 THEN
|
||||
'已驳回'
|
||||
WHEN 4 THEN
|
||||
'已寄出'
|
||||
WHEN 5 THEN
|
||||
'已作废' ELSE NULL
|
||||
END
|
||||
) AS invoice_state_name,
|
||||
a.invoice_apply_time,
|
||||
a.applicant_id,
|
||||
a.reject_reason,
|
||||
a.transportation_ids,
|
||||
a.refund_remark,
|
||||
a.manager_id,
|
||||
a.manager_time,
|
||||
a.send_by_id,
|
||||
a.send_time,
|
||||
a.send_postage,
|
||||
a.courier_services_company,
|
||||
a.receiving_address_id,
|
||||
a.create_by,
|
||||
a.create_time,
|
||||
a.update_by,
|
||||
a.update_time,
|
||||
a.is_delete,
|
||||
a.sys_org_code,
|
||||
a.invoice_type,
|
||||
a.invoice_nature,
|
||||
a.invoice_number,
|
||||
a.invoice_code,
|
||||
a.tracking_number,
|
||||
a.apply_number,
|
||||
a.organization_id AS organizationId,
|
||||
a.organization_name AS organizationName,
|
||||
a.top_organization_id AS topOrganizationId
|
||||
</sql>
|
||||
<sql id="field_where2">
|
||||
a.id,a.invoice_title,a.invoice_value,a.remark,a.invoice_state,a.invoice_apply_time,a.applicant_id,a.reject_reason,a.manager_id,a.manager_time,
|
||||
a.send_by_id,a.send_time,a.send_postage, a.courier_services_company,a.receiving_address_id,a.create_time,b.tax_reg_account,a.transportation_ids,
|
||||
b.tax_reg_account,b.invoice_title,a.shipper_id,a.shipper_name,a.company_name,a.invoice_make_time,a.tax_reg_account reg_account
|
||||
</sql>
|
||||
</mapper>
|
||||
@@ -0,0 +1,5 @@
|
||||
<?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.mhd.bms.domain.bmsMakeOutInvoice.repository.mapper.BmsMakeOutInvoiceMapper">
|
||||
|
||||
</mapper>
|
||||
Reference in New Issue
Block a user