MedOrganization.xml 3.48 KB
  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
<?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>