生成账单费用合并;
This commit is contained in:
@@ -8,70 +8,70 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
|
||||
<select id="queryList" parameterType="com.mhd.bms.domain.billManage.repository.todo.BillManageDO" resultType="com.mhd.bms.domain.billManage.repository.po.BillManagePO">
|
||||
select
|
||||
*
|
||||
from bill_manage
|
||||
where del_flag = 1
|
||||
a.*,b.SETTLEMENT_ENTITY_ID as settlementEntityId
|
||||
from bill_manage a LEFT JOIN SETTLEMENT_CUSTOMERS b on a.SETTLEMENT_CUSTOMERS_ID = b.SETTLEMENT_CUSTOMERS_ID
|
||||
where a.del_flag = 1
|
||||
<include refid="common_where"/>
|
||||
ORDER BY create_time DESC
|
||||
ORDER BY a.create_time DESC
|
||||
</select>
|
||||
|
||||
<sql id="common_where">
|
||||
<if test="billManageDO.createTimeStart != null and billManageDO.createTimeStart != ''">
|
||||
AND date_format(create_time,'%Y-%m-%d') <![CDATA[>=]]> #{billManageDO.createTimeStart}
|
||||
AND date_format(a.create_time,'%Y-%m-%d') <![CDATA[>=]]> #{billManageDO.createTimeStart}
|
||||
</if>
|
||||
<if test="billManageDO.createTimeEnd != null and billManageDO.createTimeEnd != ''">
|
||||
AND date_format(create_time,'%Y-%m-%d') <![CDATA[<=]]> #{billManageDO.createTimeEnd}
|
||||
AND date_format(a.create_time,'%Y-%m-%d') <![CDATA[<=]]> #{billManageDO.createTimeEnd}
|
||||
</if>
|
||||
<if test="billManageDO.createByName != null and billManageDO.createByName != ''">
|
||||
AND create_by_name like concat('%', #{billManageDO.createByName}, '%')
|
||||
AND a.create_by_name like concat('%', #{billManageDO.createByName}, '%')
|
||||
</if>
|
||||
<if test="billManageDO.organizationId != null">
|
||||
AND organization_id = #{billManageDO.organizationId}
|
||||
AND a.organization_id = #{billManageDO.organizationId}
|
||||
</if>
|
||||
<if test="billManageDO.topOrganizationId != null and billManageDO.topOrganizationId != ''">
|
||||
AND top_organization_id = #{billManageDO.topOrganizationId}
|
||||
AND a.top_organization_id = #{billManageDO.topOrganizationId}
|
||||
</if>
|
||||
<if test="billManageDO.updateTimeStart != null and billManageDO.updateTimeStart != ''">
|
||||
AND date_format(update_time,'%Y-%m-%d') <![CDATA[>=]]> #{billManageDO.updateTimeStart}
|
||||
AND date_format(a.update_time,'%Y-%m-%d') <![CDATA[>=]]> #{billManageDO.updateTimeStart}
|
||||
</if>
|
||||
<if test="billManageDO.updateTimeEnd != null and billManageDO.updateTimeEnd != ''">
|
||||
AND date_format(update_time,'%Y-%m-%d') <![CDATA[<=]]> #{billManageDO.updateTimeEnd}
|
||||
AND date_format(a.update_time,'%Y-%m-%d') <![CDATA[<=]]> #{billManageDO.updateTimeEnd}
|
||||
</if>
|
||||
<if test="billManageDO.updateByName != null and billManageDO.updateByName != ''">
|
||||
AND update_by_name like concat('%', #{billManageDO.updateByName}, '%')
|
||||
AND a.update_by_name like concat('%', #{billManageDO.updateByName}, '%')
|
||||
</if>
|
||||
<if test="billManageDO.billNumber != null and billManageDO.billNumber != ''">
|
||||
AND bill_number like concat('%', #{billManageDO.billNumber}, '%')
|
||||
AND a.bill_number like concat('%', #{billManageDO.billNumber}, '%')
|
||||
</if>
|
||||
<if test="billManageDO.belongModule != null and billManageDO.belongModule != ''">
|
||||
AND belong_module like concat('%', #{billManageDO.belongModule}, '%')
|
||||
AND a.belong_module like concat('%', #{billManageDO.belongModule}, '%')
|
||||
</if>
|
||||
<if test="billManageDO.settlementEntity != null and billManageDO.settlementEntity != ''">
|
||||
AND settlement_entity like concat('%', #{billManageDO.settlementEntity}, '%')
|
||||
AND a.settlement_entity like concat('%', #{billManageDO.settlementEntity}, '%')
|
||||
</if>
|
||||
<if test="billManageDO.billState != null">
|
||||
AND bill_state = #{billManageDO.billState}
|
||||
AND a.bill_state = #{billManageDO.billState}
|
||||
</if>
|
||||
<if test="billManageDO.isInvoice != null">
|
||||
AND IS_INVOICE = #{billManageDO.isInvoice}
|
||||
AND a.IS_INVOICE = #{billManageDO.isInvoice}
|
||||
</if>
|
||||
<if test="billManageDO.reconciliationStatus != null">
|
||||
AND reconciliation_status = #{billManageDO.reconciliationStatus}
|
||||
AND a.reconciliation_status = #{billManageDO.reconciliationStatus}
|
||||
</if>
|
||||
<if test="billManageDO.billType != null">
|
||||
AND bill_type = #{billManageDO.billType}
|
||||
AND a.bill_type = #{billManageDO.billType}
|
||||
</if>
|
||||
<if test="billManageDO.queryParam != null and billManageDO.queryParam == 1">
|
||||
AND bill_state <![CDATA[<]]> 5
|
||||
AND a.bill_state <![CDATA[<]]> 5
|
||||
</if>
|
||||
<if test="billManageDO.queryParam != null and billManageDO.queryParam == 2">
|
||||
AND bill_state = 5
|
||||
AND a.bill_state = 5
|
||||
</if>
|
||||
<if test="billManageDO.queryParam != null and billManageDO.queryParam == 3">
|
||||
AND bill_state = 6
|
||||
AND a.bill_state = 6
|
||||
</if>
|
||||
<if test="billManageDO.billManageIdSet != null and billManageDO.billManageIdSet.size() > 0">
|
||||
and bill_manage_id in
|
||||
and a.bill_manage_id in
|
||||
<foreach item="id" collection="billManageDO.billManageIdSet" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
@@ -112,4 +112,16 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
and interface_type = #{interfaceType} limit 1
|
||||
</select>
|
||||
|
||||
<select id="getCustomerUserDept" parameterType="java.lang.String" resultType="java.lang.String">
|
||||
SELECT DEPARTMENT_ID FROM NGWL_TEST_USER."USER" where DEL_FLAG = '1' and user_id = #{userId} limit 1
|
||||
</select>
|
||||
|
||||
<select id="getDeptValue" parameterType="java.lang.String" resultType="java.lang.String">
|
||||
SELECT dict_value FROM NGWL_TEST_SYSTEM."SYS_DICT_DATA" where status = '0' and dict_type = 'department' and dict_code = #{dictCode} limit 1
|
||||
</select>
|
||||
|
||||
<select id="getDeptName" parameterType="java.lang.String" resultType="java.lang.String">
|
||||
SELECT dict_label FROM NGWL_TEST_SYSTEM."SYS_DICT_DATA" where status = '0' and dict_type = 'department' and dict_code = #{dictCode} limit 1
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
Reference in New Issue
Block a user