package cn.hnthyy.thmz.mapper.his.mz;

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

public interface MzYshConfigMapper {
    /**
     * 加锁
     * @return
     */
    @Update("update mz_ysh_config set req_no =req_no ")
    int updateForBlock();

    @Select("select * from mz_ysh_config where item_no = 1")
    MzYshConfig selectMzYshConfig();

    /**
     * 更新医生配置表的序号
     * @param mzYshConfig
     * @return
     */
    @Update({"<script>",
            "update mz_ysh_config " +
                    "<trim prefix='set' prefixOverrides=',' suffix=' where item_no=1' >",
            "<when test='reqNo!=null'>",
            "req_no =#{reqNo,jdbcType=INTEGER}",
            "</when>",
            "<when test='reqPageNo!=null'>",
            "req_page_no =#{reqPageNo,jdbcType=INTEGER}",
            "</when>",
            "<when test='blNo!=null'>",
            "bl_no =#{blNo,jdbcType=INTEGER}",
            "</when>",
            "</trim>",
            "</script>"})
    int updateMzYshConfig(MzYshConfig mzYshConfig);
}
