zjh
2024-12-06 c42f62b32bac302a7ac9fcde7489f7c5fc6e11aa
ltkj-hosp/src/main/java/com/ltkj/hosp/mapper/TjCustomerMapper.java
@@ -6,7 +6,9 @@
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.ltkj.hosp.domain.TjCustomer;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
/**
 * 客户信息Mapper接口
@@ -75,4 +77,14 @@
    @Select("SELECT * FROM tj_customer WHERE cus_idcard = #{cusIdCard}")
    ResultSet getJsonParseCustomerList(String deptId, Integer page, Integer pageSize, String cusName, String tjNumber);
    @Select("SELECT IFNULL(b.cn_name,'无')  FROM (\n" +
            "\n" +
            "SELECT a.firm_id cid FROM tj_order a WHERE a.user_id=#{cusId} ORDER BY a.order_id DESC LIMIT 1)" +
            " aa LEFT JOIN dict_comp b ON aa.cid=b.drug_manufacturer_id")
    String getCompNameByCusId(String cusId);
    @Update("update tj_customer set card_id=#{cardId} where cus_id=#{cusId}")
    void  updateCardId(@Param("cusId") Long cusId,@Param("cardId") String cardId);
}