package cn.hnthyy.thmz.mapper.his;

import cn.hnthyy.thmz.entity.his.YpConfig;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

public interface YpConfigMapper {
    /**
     * 查询药房配置
     * @return
     */
    @Select("select item_no,yf_plan_no,yf_out_no,yk_plan_no,yk_out_no, rtrim(rejust_type) rejust_type,rtrim(yp_in_type) yp_in_type,rtrim(mzyp_mini) mzyp_mini," +
            "cf_rows,yf_fy_no,yk_in_no,reajust_no,yf_in_no,yf_sx_amount,rtrim(update_pack_size_flag) update_pack_size_flag,rtrim(open_stock_virtual2) open_stock_virtual2  from yp_config")
    YpConfig selectYpConfig();


    /**
     * 更新药房取药号码
     * @param ypConfig
     * @return
     */
    @Update({"<script>",
            "update yp_config ",
            "<trim prefix='set' prefixOverrides=',' suffix=' where item_no = 1' >",
            "<when test='yfFyNo!=null'>",
            "yf_fy_no =#{yfFyNo,jdbcType=INTEGER}",
            "</when>",
            "</trim>"
            ,"</script>"})
    int updateYpConfig(YpConfig ypConfig);
}
