<?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.glxp.mipsdl.dao.thrsys.ThrBustypeOriginDao">
    <resultMap id="BaseResultMap" type="com.glxp.mipsdl.entity.thrsys.ThrBustypeOriginEntity">
        <!--@mbg.generated-->
        <!--@Table thr_bustype_origin-->
        <id column="id" jdbcType="INTEGER" property="id"/>
        <result column="name" jdbcType="VARCHAR" property="name"/>
        <result column="action" jdbcType="VARCHAR" property="action"/>
        <result column="thirdSys" jdbcType="VARCHAR" property="thirdSys"/>
        <result column="enable" jdbcType="BOOLEAN" property="enable"/>
        <result column="inoutType" jdbcType="INTEGER" property="inoutType"/>
        <result column="updateTime" jdbcType="TIMESTAMP" property="updateTime"/>
        <result column="remark" jdbcType="VARCHAR" property="remark"/>
        <result column="createUser" jdbcType="VARCHAR" property="createUser"/>
        <result column="updateUser" jdbcType="VARCHAR" property="updateUser"/>
        <result column="createTime" jdbcType="TIMESTAMP" property="createTime"/>
    </resultMap>
    <sql id="Base_Column_List">
        <!--@mbg.generated-->
        id,
        `name`,
        `action`,
        thirdSys,
        `enable`,
        inoutType,
        updateTime,
        remark,
        `createUser`,
        updateUser,
        createTime
    </sql>

    <select id="findThirdActionByBillType" resultType="java.lang.String">
        select action
        from thr_bustype_origin
                 left join basic_bussiness_type on thr_bustype_origin.action = basic_bussiness_type.originAction
        <where>
            <if test="billType != null and billType != ''">
                AND basic_bussiness_type.action = #{billType}
            </if>
            <if test="hospCode != null and hospCode != ''">
                AND thr_bustype_origin.thirdSys = #{hospCode}
            </if>
        </where>
    </select>
</mapper>
