<?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!= null">
<!-- namespace:必须与对应的接口全类名一致 id:必须与对应接口的某个对应的方法名一致 <!DOCTYPE mapper PUBLIC
"-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> -->

<mapper namespace="">
<resultMap type="HrsBabyHealth" id="HrsBabyHealthAll">
<result property="babyId" column="BABY_ID"/>
<result property="babaNo" column="BABA_NO"/>
<result property="userId" column="USER_ID_"/>
<result property="petName" column="PET_NAME"/>
<result property="name" column="NAME"/>
<result property="idCard" column="ID_CARD"/>
<result property="genderId" column="GENDER_ID"/>
<result property="birthday" column="BIRTHDAY"/>
<result property="birthTime" column="BIRTH_TIME"/>
<result property="inputDate" column="INPUT_DATE_"/>
<result property="dataSource" column="DATA_SOURCE"/>
<result property="orgName" column="ORG_NAME"/>
<result property="className" column="CLASS_NAME"/>
<result property="orgNameStr" column="ORG_NAMESTR"/>
<result property="classNameStr" column="CLASS_NAMESTR"/>
<result property="trueAge" column="TRUE_AGE"/>
<result property="delStatue" column="DEL_STATUE"/>
</resultMap>
<select id="findHrsBabyHealthCount" parameterType="HrsBabyHealth" resultType="java.lang.Long">
select count(*)
from HRS_BABY_HEALTH
<where>
<if test = " babaNo != null"> BABA_NO = #{babaNo} </if>
<if test = " userId != null">AND USER_ID_ = #{userId} </if>
<if test = " petName != null">AND PET_NAME = #{petName} </if>
<if test = " name != null">AND NAME = #{name} </if>
<if test = " idCard != null">AND ID_CARD = #{idCard} </if>
<if test = " genderId != null">AND GENDER_ID = #{genderId} </if>
<if test = " birthday != null">AND BIRTHDAY = #{birthday} </if>
<if test = " birthTime != null">AND BIRTH_TIME = #{birthTime} </if>
<if test = " inputDate != null">AND INPUT_DATE_ = #{inputDate} </if>
<if test = " dataSource != null">AND DATA_SOURCE = #{dataSource} </if>
<!-- <if test = " orgName != null">AND ORG_NAME in (${orgName}) </if> -->
<if test = " orgNameList != null">
AND ORG_NAME in
<foreach collection="orgNameList" item="item" index="index" separator="," open="(" close=")">
${item}
</foreach>
</if>
<if test = " className != null">AND CLASS_NAME = #{className} </if>
<if test = " trueAge != null">AND TRUE_AGE = #{trueAge} </if>
<if test = " delStatue != null">AND DEL_STATUE = #{delStatue} </if>
</where>
</select>
<select id="findHrsBabyHealthAllByWhere" parameterType="HrsBabyHealth" resultMap="HrsBabyHealthAll">
select BABY_ID,BABA_NO,USER_ID_,PET_NAME,NAME,ID_CARD,GENDER_ID,BIRTHDAY,BIRTH_TIME,h.INPUT_DATE_,DATA_SOURCE,ORG_NAME,CLASS_NAME,TRUE_AGE,g.GROUP_NAME AS CLASS_NAMESTR,o.NAME_ AS ORG_NAMESTR,h.DEL_STATUE
from HRS_BABY_HEALTH h
LEFT JOIN hrs_group g ON g.GROUP_ID=h.CLASS_NAME
LEFT JOIN organization_ o ON o.ORG_ID_=h.ORG_NAME
<where>
<if test = " babyId != null">AND BABY_ID = #{babyId} </if>
<if test = " babaNo != null">AND BABA_NO = #{babaNo} </if>
<if test = " userId != null">AND h.USER_ID_ = #{userId} </if>
<if test = " petName != null">AND PET_NAME like '%'||#{petName}||'%' </if>
<if test = " name != null">AND h.NAME like '%'||#{name}||'%' </if>
<if test = " idCard != null">AND ID_CARD = #{idCard} </if>
<if test = " genderId != null">AND GENDER_ID = #{genderId} </if>
<if test = " birthday != null">AND h.BIRTHDAY = #{birthday} </if>
<if test = " birthTime != null">AND h.BIRTH_TIME = #{birthTime} </if>
<if test = " inputDate != null">AND h.INPUT_DATE_ = #{inputDate} </if>
<if test = " dataSource != null">AND DATA_SOURCE = #{dataSource} </if>
<if test = " orgNameList != null">
AND h.ORG_NAME in
<foreach item="item" index="index" collection="orgNameList"
separator="," open ="(" close=")" >
${item}
</foreach>
</if>
<if test = " className != null">AND h.CLASS_NAME = #{className} </if>
<if test = " trueAge != null">AND h.TRUE_AGE = #{trueAge} </if>
<if test = " delStatue != null">AND h.DEL_STATUE = #{delStatue} </if>
</where>
ORDER BY BABY_ID desc
<if test = "start != null and limit != null">limit #{start},#{limit}</if>
</select>
</mapper>

最新文章

  1. 为什么基于Windows Server 2008 R2的网络负载均衡(NLB)配置的时候总会报错&ldquo;主机不可访问&rdquo;?
  2. java.lang.NoClassDefFoundError: Lorg/slf4j/Logger;
  3. 一步一步拆解一个简单的iOS轮播图(三图)
  4. 防止多次领取红包进行ID锁
  5. Linux环境变量(小马哥推荐)
  6. uva 558 - Wormholes(Bellman Ford判断负环)
  7. ie下jquery ajax 80020101错误的解决方法
  8. HTML+CSS学习笔记(2) - 认识标签(1)
  9. sublime text2卸载和重新安装
  10. php 求水仙花数优化
  11. libsvm中的dec_values以及分类结果评分问题
  12. IDEA Show Line Number
  13. sourcetree和gitlab配置图解
  14. iOS中 通知中心Text (实例)
  15. vue事件修饰符
  16. ansible报错Using a SSH password instead of a key is not possible because Host Key checking is enabled and sshpass does not support this
  17. ThinkPHP中where()使用方法详解
  18. mysql不存在插入否则更新
  19. mysql主从复制常见故障解决
  20. Hdu5385 The path

热门文章

  1. 转:浅谈Spectral Clustering 谱聚类
  2. hadoop 使用Avro排序
  3. BZOJ3143:[HNOI2013]游走——题解
  4. BZOJ2705:[SDOI2012]Longge的问题——题解
  5. CF549H:Degenerate Matrix ——题解
  6. [Leetcode] combination sum ii 组合之和
  7. mybatis中parameterType可以写的别名
  8. 在某OC字符串中,搜索指定的某字符串:-rangeOfString:
  9. mybatis &lt;where&gt;、&lt;set&gt;、&lt;trim&gt;、&lt;sql&gt;、&lt;foreach&gt;标签的使用
  10. TCP ------ TCP三次握手(建立连接)及其相关内容