85 lines
4.2 KiB
XML
85 lines
4.2 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.basic.domain.serviceItemsManage.repository.mapper.ServiceItemsManageMapper">
|
|
|
|
|
|
|
|
<sql id="selectServiceItemsManagePo1">
|
|
<where>
|
|
<!-- <!– 删除标记:0-无状态,1-正常,2-已删除,查询时只查询正常的数据 –>-->
|
|
<!-- <choose>-->
|
|
<!-- <when test="delFlag != null">-->
|
|
<!-- and del_flag = #{delFlag}-->
|
|
<!-- </when>-->
|
|
<!-- <otherwise>-->
|
|
<!-- and del_flag = 1-->
|
|
<!-- </otherwise>-->
|
|
<!-- </choose>-->
|
|
<!-- <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>-->
|
|
<!-- 数据权限:南光组织(organizationId=2827)查全部,其他组织查自己 -->
|
|
<!-- 如果 organizationId 和 topOrganizationId 都为 null,表示查询所有组织的数据(不添加组织过滤条件) -->
|
|
<if test="organizationId != null">
|
|
<!-- 如果设置了 organizationId,添加 organization_id 条件 -->
|
|
and organization_id = #{organizationId}
|
|
-- and organization_name IS NOT NULL
|
|
-- and organization_name != ''
|
|
-- and LENGTH(TRIM(organization_name)) > 0
|
|
</if>
|
|
<if test="topOrganizationId != null and organizationId == null">
|
|
<!-- 如果设置了 topOrganizationId 但没有设置 organizationId,添加 top_organization_id 条件 -->
|
|
and top_organization_id = #{topOrganizationId}
|
|
-- and organization_name IS NOT NULL
|
|
-- and organization_name != ''
|
|
-- and LENGTH(TRIM(organization_name)) > 0
|
|
</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="taxRate != null ">
|
|
and tax_rate = #{taxRate}
|
|
</if>
|
|
<if test="remark != null and remark != ''">
|
|
and remark like concat('%', #{remark}, '%')
|
|
</if>
|
|
<if test="createTimeStart != null and createTimeStart != ''">
|
|
AND date_format(create_time,'%Y-%m-%d') <![CDATA[>=]]> #{createTimeStart}
|
|
</if>
|
|
<if test="createTimeEnd != null and createTimeEnd != ''">
|
|
AND date_format(create_time,'%Y-%m-%d') <![CDATA[<=]]> #{createTimeEnd}
|
|
</if>
|
|
<if test="updateTimeStart != null and updateTimeStart != ''">
|
|
AND date_format(update_time,'%Y-%m-%d') <![CDATA[>=]]> #{updateTimeStart}
|
|
</if>
|
|
<if test="updateTimeEnd != null and updateTimeEnd != ''">
|
|
AND date_format(update_time,'%Y-%m-%d') <![CDATA[<=]]> #{updateTimeEnd}
|
|
</if>
|
|
</where>
|
|
</sql>
|
|
|
|
<select id="queryList" parameterType="com.mhd.basic.domain.serviceItemsManage.repository.todo.ServiceItemsManageDO"
|
|
resultType="com.mhd.basic.domain.serviceItemsManage.repository.po.ServiceItemsManagePO">
|
|
select * from service_items_manage
|
|
<include refid="selectServiceItemsManagePo1"/>
|
|
</select>
|
|
|
|
<select id="selectServiceTypes" parameterType="com.mhd.basic.domain.serviceItemsManage.repository.todo.ServiceItemsManageDO"
|
|
resultType="com.mhd.basic.domain.serviceItemsManage.repository.po.ServiceItemsManagePO">
|
|
select organization_name,service_items_code,service_items_name,tax_rate,CONCAT(service_items_name,service_items_code) cost_type
|
|
from service_items_manage
|
|
<include refid="selectServiceItemsManagePo1"/>
|
|
</select>
|
|
</mapper>
|