<?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.kidgrow.oprationcenter.mapper.ScreeningOrganizationInfoMapper">
|
<!--定义查询列-->
|
<sql id="Column_List">
|
|
*
|
|
</sql>
|
|
<!--sql查询片段-->
|
<sql id="where">
|
<where>
|
<!--查询条件自行添加-->
|
<if test="p.id != null and p.id != ''">
|
and id = #{p.id}
|
</if>
|
<if test="p.province != null and p.province != ''">
|
and province = #{p.province}
|
</if>
|
<if test="p.city != null and p.city != ''">
|
and city = #{p.city}
|
</if>
|
<if test="p.area != null and p.area != ''">
|
and area = #{p.area}
|
</if>
|
<if test="p.organizationName != null and p.organizationName != ''">
|
and organization_name = #{p.organizationName}
|
</if>
|
<if test="p.organizationNameLike != null and p.organizationNameLike != ''">
|
and organization_name like '%${p.organizationNameLike}%'
|
</if>
|
<if test="p.contactName != null and p.contactName != ''">
|
and contact_name = #{p.contactName}
|
</if>
|
<if test="p.contactNumber != null and p.contactNumber != ''">
|
and contact_number = #{p.contactNumber}
|
</if>
|
<if test="p.sourceHospitalId != null and p.sourceHospitalId != ''">
|
and source_hospital_id = #{p.sourceHospitalId}
|
</if>
|
<if test="p.sourceHospitalName != null and p.sourceHospitalName != ''">
|
and source_hospital_name = #{p.sourceHospitalName}
|
</if>
|
<if test="p.remarks != null and p.remarks != ''">
|
and remarks = #{p.remarks}
|
</if>
|
<if test="p.createTime != null and p.createTime != ''">
|
and create_time = #{p.createTime}
|
</if>
|
<if test="p.abbreviation != null and p.abbreviation != ''">
|
and abbreviation = #{p.abbreviation}
|
</if>
|
<if test="p.qrCode != null and p.qrCode != ''">
|
and qr_code = #{p.qrCode}
|
</if>
|
<if test="p.community != null and p.community != ''">
|
and community = #{p.community}
|
</if>
|
<if test="p.organizationNo != null and p.organizationNo != ''">
|
and organization_no = #{p.organizationNo}
|
</if>
|
<if test="p.createUserId != null and p.createUserId != ''">
|
and create_user_id = #{p.createUserId}
|
</if>
|
<if test="p.updateTime != null and p.updateTime != ''">
|
and update_time = #{p.updateTime}
|
</if>
|
<if test="p.updateUserId != null and p.updateUserId != ''">
|
and update_user_id = #{p.updateUserId}
|
</if>
|
<if test="p.areaCode != null and p.areaCode != ''">
|
and area_code = #{p.areaCode}
|
</if>
|
<if test="p.parentId != null and p.parentId != ''">
|
and parent_id = #{p.parentId}
|
</if>
|
<if test="p.orgLevel != null and p.orgLevel != ''">
|
and org_level = #{p.orgLevel}
|
</if>
|
</where>
|
</sql>
|
|
<!--定义根据-OrganizationInfo当作查询条件返回对象-->
|
<select id="findByObject" resultType="com.kidgrow.oprationcenter.model.ScreeningOrganizationInfo">
|
select
|
<include refid="Column_List"/>
|
from screening_organization_info
|
<include refid="where"/>
|
order by id desc
|
limit 1
|
|
</select>
|
|
<!--定义根据-OrganizationInfo当作查询条件返回对象集合-->
|
<select id="findList" resultType="com.kidgrow.oprationcenter.model.ScreeningOrganizationInfo">
|
select
|
<include refid="Column_List"/>
|
from screening_organization_info
|
<include refid="where"/>
|
order by id desc
|
</select>
|
|
<select id="findByHospitalId" resultType="com.kidgrow.oprationcenter.model.ScreeningOrganizationInfo" parameterType="java.lang.Long">
|
select
|
<include refid="Column_List"/>
|
from screening_organization_info
|
where source_hospital_id=#{t}
|
</select>
|
|
<select id="findByKeyWord" resultType="com.kidgrow.oprationcenter.model.ScreeningOrganizationInfo" parameterType="java.util.Map" >
|
SELECT
|
*
|
FROM
|
screening_organization_info
|
WHERE
|
source_hospital_id=${p.id}
|
<if test="p.keyword != null and p.keyword != ''">
|
and organization_name LIKE '%${p.keyword}%'
|
</if>
|
</select>
|
</mapper>
|