package com.mandi.fendan.mapper; import java.util.List; import java.util.Map; import org.apache.ibatis.annotations.Delete; import org.apache.ibatis.annotations.Insert; import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Select; import org.apache.ibatis.annotations.Update; import com.mandi.basicconfig.persist.Ncywdy; import com.mandi.fendan.persist.Fd_Company; import com.mandi.fendan.persist.Fd_Company_Ywdy; public interface Fd_CompanyMapper{ @Select("select a.* from fd_company a where a.id=#{id}") public Fd_Company get(String id); @Select("select a.* from fd_company a where a.companyNo=#{companyNo}") public Fd_Company getByCompanyNo(String companyNo); @Select("select top 1 a.* from fd_company a where a.hasSPR=#{hasSPR}") public Fd_Company getFdcbyhasSPR(boolean hasSPR); @Delete("delete from fd_company where id=#{id}") public int del(String id); @Delete("delete from fd_company where companyNo=#{companyNo}") public int delByCompanyNo(String companyNo); @Update("update fd_company set cname=#{cname},companyNo=#{companyNo},ctime=#{ctime},hdpinyin=#{hdpinyin},name=#{name},shortName=#{shortName},note=#{note},pinyin=#{pinyin},hasSPR=#{hasSPR} where id=#{id} ") public int update(Fd_Company fd_company); @Insert("insert into fd_company (id,cname,companyNo,ctime,hdpinyin,name,shortName,note,pinyin,hasSPR) values (#{id},#{cname},#{companyNo},#{ctime},#{hdpinyin},#{name},#{shortName},#{note},#{pinyin},#{hasSPR})") public int insert(Fd_Company fd_company); /** * 列表分页查询 * @param mp * @return */ public List getList1(Map mp); public List getList(Map mp); public int getPages(Map mp); @Select("select * from fd_company ") public List getall(); @Select("select * from fd_company_ywdy where companyNo=#{companyNo}") public List getcynexuslist(String companyNo); @Select("select b.code code,b.name name from fd_company_ywdy a LEFT JOIN nc_ywdy b on a.ywdyNo=b.code where companyNo=#{companyNo} ") public List getncYwdylist(String companyNo); @Delete("delete from fd_company_ywdy where companyNo=#{companyNo}") public int delCYnexus(String companyNo); @Insert("insert into fd_company_ywdy (companyNo,ywdyNo) values (#{companyNo},#{ywdyNo})") public int insertCYnexus(@Param("companyNo")String companyNo,@Param("ywdyNo") String ywdyNo); }