<?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.lymsh.yimiao.main.data.dao.MedOrganizationMapper">
<resultMap id="MedOrganizationResultMap" type="com.lymsh.yimiao.main.data.model.MedOrganization">
<result column="o_id" property="oId" jdbcType="VARCHAR" />
<result column="o_name" property="oName" jdbcType="VARCHAR" />
<result column="o_contactWay" property="oContactWay" jdbcType="VARCHAR" />
<result column="o_linkMan" property="oLinkman" jdbcType="VARCHAR" />
<result column="o_provinceNo" property="oProvinceNo" jdbcType="VARCHAR" />
<result column="o_cityNo" property="oCityNo" jdbcType="VARCHAR" />
<result column="o_countyNo" property="oCountyNo" jdbcType="VARCHAR" />
<result column="o_townShipNo" property="oTownshipNo" jdbcType="VARCHAR" />
<result column="o_villageNo" property="oVillageNo" jdbcType="VARCHAR" />
<result column="o_address" property="oAddress" jdbcType="VARCHAR" />
<result column="o_isValid" property="oIsValid" jdbcType="VARCHAR" />
<result column="isDelete" property="isDelete;" jdbcType="VARCHAR" />
</resultMap>
<select id="getMedOrganization" resultMap="MedOrganizationResultMap" parameterType="java.lang.String">
select o_id,o_name,o_contactWay,o_linkMan,o_provinceNo,o_cityNo,o_countyNo,o_townShipNo,o_villageNo,o_address,o_isValid,isDelete
FROM med_organization
WHERE o_id = #{oId,jdbcType=VARCHAR}
</select>
<sql id="orderAndLimit">
<if test="sort != null and sort != '' ">
order by ${sort}
<if test="need != null">
limit #{offset, jdbcType=INTEGER} , #{limit, jdbcType=INTEGER}
</if>
</if>
</sql>
<sql id="MedOrganizationCondition">
<where>
1 = 1
<if test="oId != null and oId != ''">
and o_id = #{oId,jdbcType=VARCHAR}
</if>
<if test="oName != null and oName != ''">
and o_name = #{oName,jdbcType=VARCHAR}
</if>
<if test="oContactWay != null and oContactWay != ''">
and o_contactWay = #{oContactWay,jdbcType=VARCHAR}
</if>
<if test="oLinkman != null and oLinkman != ''">
and o_linkMan = #{oLinkman,jdbcType=VARCHAR}
</if>
<if test="oProvinceNo != null and oProvinceNo != ''">
and o_provinceNo = #{oProvinceNo,jdbcType=VARCHAR}
</if>
<if test="oCityNo != null and oCityNo != ''">
and o_cityNo = #{oCityNo,jdbcType=VARCHAR}
</if>
<if test="oCountyNo != null and oCountyNo != ''">
and o_countyNo = #{oCountyNo,jdbcType=VARCHAR}
</if>
<if test="oTownshipNo != null and oTownshipNo != ''">
and o_townShipNo = #{oTownshipNo,jdbcType=VARCHAR}
</if>
<if test="oVillageNo != null and oVillageNo != ''">
and o_villageNo = #{oVillageNo,jdbcType=VARCHAR}
</if>
<if test="oAddress != null and oAddress != ''">
and o_address = #{oAddress,jdbcType=VARCHAR}
</if>
<if test="oIsValid != null and oIsValid != ''">
and o_isValid = #{oIsValid,jdbcType=VARCHAR}
</if>
<if test="isDelete != null and isDelete != ''">
and isDelete = #{isDelete,jdbcType=VARCHAR}
</if>
</where>
</sql>
<select id="queryMedOrganization" resultMap="MedOrganizationResultMap" parameterType="com.lymsh.yimiao.main.data.model.MedOrganizationQuery">
select o_id,o_name,o_contactWay,o_linkMan,o_provinceNo,o_cityNo,o_countyNo,o_townShipNo,o_villageNo,o_address,o_isValid,isDelete
from med_organization
<include refid="MedOrganizationCondition" />
<include refid="orderAndLimit" />
</select>
<select id="queryMedOrganizationCount" resultType="int" parameterType="com.lymsh.yimiao.main.data.model.MedOrganizationQuery">
select count(1) from med_organization
<include refid="MedOrganizationCondition" />
</select>
</mapper>