Commit 72b73e57 by wangli

修改

1 parent d9b57431
...@@ -5,6 +5,7 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper; ...@@ -5,6 +5,7 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select; import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.SelectProvider;
import java.util.List; import java.util.List;
...@@ -17,9 +18,19 @@ public interface EngineerInfoMPDao extends BaseMapper<EngineerInfo> { ...@@ -17,9 +18,19 @@ public interface EngineerInfoMPDao extends BaseMapper<EngineerInfo> {
@Select("select * from engineer_info where engineer_code = #{engineerCode}") @Select("select * from engineer_info where engineer_code = #{engineerCode}")
List<EngineerInfo> selectByEngineerCode(String engineerCode); List<EngineerInfo> selectByEngineerCode(String engineerCode);
@Select({"select * from engineer_info where engineer_code in <foreach item='engineerCode' index='index' collection='engineerCodes' open='(' separator=',' close=')'>#{engineerCode}</foreach>"}) @SelectProvider(type=SqlProvider.class, method = "selectByOrderIds")
List<EngineerInfo> selectByEngineerCodes(@Param("engineerCodes") List<String> engineerCodes); List<EngineerInfo> selectByEngineerCodes(@Param("engineerCodes") List<String> engineerCodes);
@Select("select * from engineer_info where group_id = #{groupId}") @Select("select * from engineer_info where group_id = #{groupId}")
List<EngineerInfo> selectByGroupId(String groupId); List<EngineerInfo> selectByGroupId(String groupId);
}
class SqlProvider {
public String selectByOrderIds(@Param("orderIds") List<String> orderIds) {
StringBuilder sb = new StringBuilder();
sb.append("SELECT * FROM order_request WHERE order_id IN ");
sb.append("<foreach item='orderId' collection='orderIds' open='(' separator=',' close=')'>#{orderId}</foreach>");
return sb.toString();
}
} }
\ No newline at end of file
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!