Files
nanguangszwlback/mhd_bms/src/main/resources/mapper/BillingRulesMapper.xml
T

125 lines
5.9 KiB
XML

<?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.billingRules.repository.mapper.BillingRulesMapper">
<sql id="selectBillingRulesPo1">
<where>
<if test="createByName != null and createByName != ''">
and create_by_name like concat('%', #{createByName}, '%')
</if>
<if test="updateByName != null and updateByName != ''">
and update_by_name like concat('%', #{updateByName}, '%')
</if>
<if test="topOrganizationId != null ">
and top_organization_id = #{topOrganizationId}
</if>
<if test="organizationId != null ">
and organization_id = #{organizationId}
</if>
<if test="organizationName != null and organizationName != ''">
and organization_name like concat('%', #{organizationName}, '%')
</if>
<if test="serviceItemsCode != null and serviceItemsCode != ''">
and service_items_code = #{serviceItemsCode}
</if>
<if test="serviceItemsName != null and serviceItemsName != ''">
and service_items_name like concat('%', #{serviceItemsName}, '%')
</if>
<if test="firstSubjectCode != null and firstSubjectCode != ''">
and first_subject_code = #{firstSubjectCode}
</if>
<if test="firstSubjectName != null and firstSubjectName != ''">
and first_subject_name like concat('%', #{firstSubjectName}, '%')
</if>
<if test="secondSubjectCode != null and secondSubjectCode != ''">
and second_subject_code = #{secondSubjectCode}
</if>
<if test="secondSubjectName != null and secondSubjectName != ''">
and second_subject_name like concat('%', #{secondSubjectName}, '%')
</if>
<if test="documentTypeCode != null and documentTypeCode != ''">
and document_type_code = #{documentTypeCode}
</if>
<if test="documentType != null and documentType != ''">
and document_type = #{documentType}
</if>
<if test="billingRulesIllustrate != null and billingRulesIllustrate != ''">
and billing_rules_illustrate = #{billingRulesIllustrate}
</if>
<if test="billingRulesState != null ">
and billing_rules_state = #{billingRulesState}
</if>
<if test="billingParamsId != null and billingParamsId != ''">
and billing_params_id = #{billingParamsId}
</if>
<if test="billingFormula != null and billingFormula != ''">
and billing_formula = #{billingFormula}
</if>
</where>
</sql>
<select id="queryList" parameterType="com.mhd.bms.domain.billingRules.repository.todo.BillingRulesDO"
resultType="com.mhd.bms.domain.billingRules.repository.po.BillingRulesPO">
select
*
from billing_rules
where del_flag = 1
<include refid="common_where"/>
order by create_time desc
</select>
<sql id="common_where">
<if test="billingRulesDO.topOrganizationId != null ">
and top_organization_id = #{billingRulesDO.topOrganizationId}
</if>
<if test="billingRulesDO.billingRulesCode != null and billingRulesDO.billingRulesCode != ''">
and billing_rules_code like concat('%',#{billingRulesDO.billingRulesCode},'%')
</if>
<if test="billingRulesDO.billingRulesName != null and billingRulesDO.billingRulesName != ''">
and billing_rules_name like concat('%',#{billingRulesDO.billingRulesName},'%')
</if>
<if test="billingRulesDO.documentTypeCode != null and billingRulesDO.documentTypeCode != ''">
and document_type_code = #{billingRulesDO.documentTypeCode}
</if>
<if test="billingRulesDO.serviceItemsCode != null and billingRulesDO.serviceItemsCode != ''">
and service_items_code = #{billingRulesDO.serviceItemsCode}
</if>
<if test="billingRulesDO.serviceItemsName != null and billingRulesDO.serviceItemsName != ''">
and service_items_name like concat('%',#{billingRulesDO.serviceItemsName},'%')
</if>
<if test="billingRulesDO.firstSubjectCode != null and billingRulesDO.firstSubjectCode != ''">
and first_subject_code = #{billingRulesDO.firstSubjectCode}
</if>
<if test="billingRulesDO.firstSubjectName != null and billingRulesDO.firstSubjectName != ''">
and first_subject_name like concat('%',#{billingRulesDO.firstSubjectName},'%')
</if>
<if test="billingRulesDO.secondSubjectCode != null and billingRulesDO.secondSubjectCode != ''">
and second_subject_code = #{billingRulesDO.secondSubjectCode}
</if>
<if test="billingRulesDO.secondSubjectName != null and billingRulesDO.secondSubjectName != ''">
and second_subject_name like concat('%',#{billingRulesDO.secondSubjectName},'%')
</if>
<if test="billingRulesDO.billingRulesState != null">
and billing_rules_state = #{billingRulesDO.billingRulesState}
</if>
<if test="billingRulesDO.createTimeStart != null and billingRulesDO.createTimeStart != ''">
AND date_format(create_time,'%Y-%m-%d') <![CDATA[>=]]> #{billingRulesDO.createTimeStart}
</if>
<if test="billingRulesDO.createTimeEnd != null and billingRulesDO.createTimeEnd != ''">
AND date_format(create_time,'%Y-%m-%d') <![CDATA[<=]]> #{billingRulesDO.createTimeEnd}
</if>
<if test="billingRulesDO.createByName != null and billingRulesDO.createByName != ''">
AND create_by_name like concat('%', #{billingRulesDO.createByName}, '%')
</if>
<if test="billingRulesDO.organizationId != null">
and organization_id = #{billingRulesDO.organizationId}
</if>
</sql>
</mapper>