You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
test/target/classes/mapper/GuahaoDao.xml

166 lines
8.7 KiB

<?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.dao.GuahaoDao">
<!-- 通用查询结果列 -->
<sql id="Base_Column_List">
a.id as id
,a.yisheng_id as yishengId
,a.yonghu_id as yonghuId
,a.guahao_uuin_number as guahaoUuinNumber
,a.guahao_time as guahaoTime
,a.guahao_types as guahaoTypes
,a.guahao_status_types as guahaoStatusTypes
,a.guahao_yesno_types as guahaoYesnoTypes
,a.guahao_yesno_text as guahaoYesnoText
,a.create_time as createTime
</sql>
<select id="selectListView" parameterType="map" resultType="com.entity.view.GuahaoView" >
SELECT
<include refid="Base_Column_List" />
-- 级联表的字段
,yisheng.yisheng_uuid_number as yishengUuidNumber
,yisheng.yisheng_name as yishengName
,yisheng.yisheng_types as yishengTypes
,yisheng.zhiwei_types as zhiweiTypes
,yisheng.yisheng_zhichneg as yishengZhichneg
,yisheng.yisheng_photo as yishengPhoto
,yisheng.yisheng_phone as yishengPhone
,yisheng.yisheng_guahao as yishengGuahao
,yisheng.yisheng_email as yishengEmail
,yisheng.yisheng_new_money as yishengNewMoney
,yisheng.yisheng_content as yishengContent
,yonghu.yonghu_name as yonghuName
,yonghu.yonghu_photo as yonghuPhoto
,yonghu.yonghu_phone as yonghuPhone
,yonghu.yonghu_id_number as yonghuIdNumber
,yonghu.yonghu_email as yonghuEmail
,yonghu.new_money as newMoney
,yonghu.yonghu_delete as yonghuDelete
FROM guahao a
left JOIN yisheng yisheng ON a.yisheng_id = yisheng.id
left JOIN yonghu yonghu ON a.yonghu_id = yonghu.id
<where>
<if test="params.ids != null">
and a.id in
<foreach item="item" index="index" collection="params.ids" open="(" separator="," close=")">
#{item}
</foreach>
</if>
<if test="params.yishengId != null and params.yishengId != ''">
and (
a.yisheng_id = #{params.yishengId}
)
</if>
<if test="params.yonghuId != null and params.yonghuId != ''">
and (
a.yonghu_id = #{params.yonghuId}
)
</if>
<if test="params.guahaoUuinNumberStart != null and params.guahaoUuinNumberStart != ''">
<![CDATA[ and a.guahao_uuin_number >= #{params.guahaoUuinNumberStart} ]]>
</if>
<if test="params.guahaoUuinNumberEnd != null and params.guahaoUuinNumberEnd != ''">
<![CDATA[ and a.guahao_uuin_number <= #{params.guahaoUuinNumberEnd} ]]>
</if>
<if test="params.guahaoUuinNumber != null and params.guahaoUuinNumber != ''">
and a.guahao_uuin_number = #{params.guahaoUuinNumber}
</if>
<if test=" params.guahaoTimeStart != '' and params.guahaoTimeStart != null ">
<![CDATA[ and UNIX_TIMESTAMP(a.guahao_time) >= UNIX_TIMESTAMP(#{params.guahaoTimeStart}) ]]>
</if>
<if test=" params.guahaoTimeEnd != '' and params.guahaoTimeEnd != null ">
<![CDATA[ and UNIX_TIMESTAMP(a.guahao_time) <= UNIX_TIMESTAMP(#{params.guahaoTimeEnd}) ]]>
</if>
<if test="params.guahaoTypes != null and params.guahaoTypes != ''">
and a.guahao_types = #{params.guahaoTypes}
</if>
<if test="params.guahaoStatusTypes != null and params.guahaoStatusTypes != ''">
and a.guahao_status_types = #{params.guahaoStatusTypes}
</if>
<if test="params.guahaoYesnoTypes != null and params.guahaoYesnoTypes != ''">
and a.guahao_yesno_types = #{params.guahaoYesnoTypes}
</if>
<if test=" params.guahaoYesnoText != '' and params.guahaoYesnoText != null and params.guahaoYesnoText != 'null' ">
and a.guahao_yesno_text like CONCAT('%',#{params.guahaoYesnoText},'%')
</if>
<!-- 判断医生的id不为空 -->
<if test=" params.yishengIdNotNull != '' and params.yishengIdNotNull != null and params.yishengIdNotNull != 'null' ">
and a.yisheng_id IS NOT NULL
</if>
<if test=" params.yishengUuidNumber != '' and params.yishengUuidNumber != null and params.yishengUuidNumber != 'null' ">
and yisheng.yisheng_uuid_number like CONCAT('%',#{params.yishengUuidNumber},'%')
</if>
<if test=" params.yishengName != '' and params.yishengName != null and params.yishengName != 'null' ">
and yisheng.yisheng_name like CONCAT('%',#{params.yishengName},'%')
</if>
<if test="params.yishengTypes != null and params.yishengTypes != ''">
and yisheng.yisheng_types = #{params.yishengTypes}
</if>
<if test="params.zhiweiTypes != null and params.zhiweiTypes != ''">
and yisheng.zhiwei_types = #{params.zhiweiTypes}
</if>
<if test=" params.yishengZhichneg != '' and params.yishengZhichneg != null and params.yishengZhichneg != 'null' ">
and yisheng.yisheng_zhichneg like CONCAT('%',#{params.yishengZhichneg},'%')
</if>
<if test=" params.yishengPhone != '' and params.yishengPhone != null and params.yishengPhone != 'null' ">
and yisheng.yisheng_phone like CONCAT('%',#{params.yishengPhone},'%')
</if>
<if test=" params.yishengGuahao != '' and params.yishengGuahao != null and params.yishengGuahao != 'null' ">
and yisheng.yisheng_guahao like CONCAT('%',#{params.yishengGuahao},'%')
</if>
<if test=" params.yishengEmail != '' and params.yishengEmail != null and params.yishengEmail != 'null' ">
and yisheng.yisheng_email like CONCAT('%',#{params.yishengEmail},'%')
</if>
<if test="params.yishengNewMoneyStart != null ">
<![CDATA[ and yisheng.yisheng_new_money >= #{params.yishengNewMoneyStart} ]]>
</if>
<if test="params.yishengNewMoneyEnd != null ">
<![CDATA[ and yisheng.yisheng_new_money <= #{params.yishengNewMoneyEnd} ]]>
</if>
<if test=" params.yishengContent != '' and params.yishengContent != null and params.yishengContent != 'null' ">
and yisheng.yisheng_content like CONCAT('%',#{params.yishengContent},'%')
</if>
<!-- 判断用户的id不为空 -->
<if test=" params.yonghuIdNotNull != '' and params.yonghuIdNotNull != null and params.yonghuIdNotNull != 'null' ">
and a.yonghu_id IS NOT NULL
</if>
<if test=" params.yonghuName != '' and params.yonghuName != null and params.yonghuName != 'null' ">
and yonghu.yonghu_name like CONCAT('%',#{params.yonghuName},'%')
</if>
<if test=" params.yonghuPhone != '' and params.yonghuPhone != null and params.yonghuPhone != 'null' ">
and yonghu.yonghu_phone like CONCAT('%',#{params.yonghuPhone},'%')
</if>
<if test=" params.yonghuIdNumber != '' and params.yonghuIdNumber != null and params.yonghuIdNumber != 'null' ">
and yonghu.yonghu_id_number like CONCAT('%',#{params.yonghuIdNumber},'%')
</if>
<if test=" params.yonghuEmail != '' and params.yonghuEmail != null and params.yonghuEmail != 'null' ">
and yonghu.yonghu_email like CONCAT('%',#{params.yonghuEmail},'%')
</if>
<if test="params.newMoneyStart != null ">
<![CDATA[ and yonghu.new_money >= #{params.newMoneyStart} ]]>
</if>
<if test="params.newMoneyEnd != null ">
<![CDATA[ and yonghu.new_money <= #{params.newMoneyEnd} ]]>
</if>
<if test="params.yonghuDeleteStart != null and params.yonghuDeleteStart != '' ">
<![CDATA[ and yonghu.yonghu_delete >= #{params.yonghuDeleteStart} ]]>
</if>
<if test="params.yonghuDeleteEnd != null and params.yonghuDeleteEnd != '' ">
<![CDATA[ and yonghu.yonghu_delete <= #{params.yonghuDeleteEnd} ]]>
</if>
<if test="params.yonghuDelete != null and params.yonghuDelete != '' ">
and yonghu.yonghu_delete = #{params.yonghuDelete}
</if>
</where>
order by a.${params.orderBy} desc
</select>
</mapper>